KatInterview

Scaling a High-Throughput Financial Ledger: Architecture Trade-offs

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsdatabase-scalingconsistency

Last updated

Design a transaction ledger handling 50k TPS with ACID guarantees, choosing between monolith and microservices and between sharding and replication.

Scenario

You have just joined a fintech company as a senior engineer. The company is building a new transaction ledger from scratch — a core system that records every movement of funds across millions of accounts.

The requirements are tight:

  • Throughput: the system must sustain 50,000 transactions per second at peak load
  • Consistency: every transfer must satisfy full ACID guarantees — partial or phantom updates are never acceptable
  • Growth: ledger data is expected to accumulate at several terabytes per month as the customer base expands

Engineering leadership is split on approach. One camp wants a monolithic architecture to ship quickly and keep operations simple. Another wants a microservices-based design for independent deployability and team autonomy. Neither camp has settled on a database scaling strategy.

You have been asked to lead the architecture decision.

What you are expected to address

1. Monolith vs. microservices for this specific system Compare the two approaches in the context of a high-throughput financial ledger. What are the concrete risks of adopting microservices when the system must maintain strong consistency at every step?

2. Database scaling strategy Should you scale writes through horizontal sharding, or scale reads through replication? Walk through the trade-offs of each in terms of the 50k TPS requirement and the expected data growth. Propose a concrete strategy.

3. Cross-shard atomicity If you adopt sharding, how do you handle a transfer where the sender's account lives on one shard and the receiver's account lives on another? Describe at least two approaches and explain when you would use each.

Your answer should demonstrate not just knowledge of the options, but sound judgment about which choices fit this specific context — and why.

Hints

Hint 1

Start by stress-testing the 50k TPS number. Is that peak or sustained? Back-of-envelope the actual write rate and check whether a single database primary can absorb it — that conclusion determines whether you even need sharding.

Hint 2

For the monolith vs. microservices question, resist the reflex to say 'microservices are better for scale.' Ask what property you lose the moment you split the ledger core across service boundaries, and whether there is a way to get deployment agility without giving that property up.

Hint 3

For cross-shard atomicity, think about what invariant must hold regardless of failure: money is neither created nor destroyed. There are at least three mechanical ways to enforce that invariant across shard boundaries — one avoids the problem entirely, one uses distributed locking, one uses compensating steps. Name the failure mode and mitigation for each.