Context & Constraints
The client was running a legacy JAVA monolith that couldn't handle Black Friday traffic spikes. Transactions were timing out, and database locks were common. The goal was to extract the core ledger service into a high-performance microservice without downtime.
Technical Decisions
1. Go for Concurrency
We chose Go for its superior handling of concurrent connections perfect for the high-volume transaction processing required.
2. Event-Sourcing Pattern
To ensure auditability (critical for fintech), we implemented an event-sourcing pattern using Kafka, allowing us to replay transactions if needed.
3. Optimistic Locking
Moved from pessimistic locking (database level) to optimistic locking at the application level to reduce contention.
Architecture Overview
Outcome
The system now handles 50,000 transactions per second with < 50ms latency. Infrastructure costs were reduced by 40% due to efficient resource usage.