Design a Double-Entry Ledger for a Balance Platform
Last updated: November 29, 2026
Quick Overview
Design the accounting system that records every money movement on a platform with millions of sub-merchant balance accounts as balanced double-entry journal entries, supports real-time available balances, and produces auditable reports.
Adyen
November 29, 20260
0
0 solved
Design the accounting system that records every money movement on a platform with millions of sub-merchant balance accounts as balanced double-entry journal entries, supports real-time available balances, and produces auditable reports.
Adyen's accounting and reporting systems sit under every payment, fee, payout and chargeback, and the numbers must reconcile exactly for regulators and merchants. Interviewers look for immutable journals, balanced entries enforced at write time, a clear split between ledger truth and derived balances, and how hot accounts are handled.
What the Interviewer Expects
- Model accounts, journal entries and postings with the debits equals credits invariant
- Keep the journal append-only and correct mistakes with reversing entries
- Distinguish pending, available and reserved balances
- Handle hot accounts that receive huge numbers of postings
- Explain how reporting and reconciliation read from the ledger
- Address multi-currency without mixing currencies in a single entry
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
- A large platform's commission account receives thousands of postings per second. How do you avoid lock contention?
- How would you show a merchant a balance that is exactly consistent with their downloadable report?
- How do you migrate the schema of a ledger table holding tens of terabytes?
- How do you detect that the ledger has drifted from the bank?
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
Every economic event (capture, fee, refund, chargeback, transfer, payout) becomes a journal entry of two or more postings that sum to zero per currency. Balances per account must be readable in real t...
High-Level Design
Producers send booking requests with an idempotency key to a ledger service. The service validates that postings balance, writes the journal entry and postings in one PostgreSQL transaction, and updat...