Design a Queryable Transaction History Service for a Public Ledger
Last updated: November 29, 2026
Quick Overview
Design a service that ingests every validated XRP Ledger ledger and serves fast API queries such as an account's transaction history with pagination, a transaction by hash, and an account's balances at a historical ledger index.
Ripple
November 29, 20260
0
0 solved
Design a service that ingests every validated XRP Ledger ledger and serves fast API queries such as an account's transaction history with pagination, a transaction by hash, and an account's balances at a historical ledger index.
Validator nodes keep limited history, so RippleX maintains a dedicated API and history server (Clio) that offloads read traffic from rippled. The interviewer is checking data modelling for append-only blockchain data, ingestion correctness with gaps and restarts, and read scaling.
What the Interviewer Expects
- Ingest only validated ledgers and process them in order with gap detection
- Model tables around access patterns (account plus ledger index, transaction hash)
- Support cursor-based pagination stable under new writes
- Explain how historical state queries work without replaying the chain
- Scale reads horizontally and keep ingestion single-writer per ledger
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you backfill ten years of history without slowing live ingestion?
- How do you answer 'balance at ledger N' for an arbitrary N efficiently?
- What consistency guarantee do clients get when reading right after a ledger validates?
- How would you serve a subscription stream of new transactions for an account?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Queries: account_tx(account, cursor, limit) newest first; tx(hash); ledger_entry(key, ledger_index) for state at a point in time; ledger(index) header. Volume: a ledger every 3 to 5 seconds wi...
High-Level Design
- ETL ingestor: subscribes to one or more trusted rippled nodes, fetches each validated ledger's header, transactions with metadata, and state diff, and writes them in ledger order.
- Storage:...