Day 02 / 30

Why Bank Servers Crash on Salary Day

· 2 min read

Peak load and capacity planning

Why it happens

Salary day, the 1st of the month, festival sales and tax deadlines bring many times the normal traffic, all at once. Systems sized for an average day plus a buffer fail when the peak beats the buffer.

The bottleneck

Servers scale out easily; the database is the single point everyone hits Five app server boxes in a row, all with arrows converging on one core banking database below that holds every account balance. App server App server App server App server App server Core banking database (every account balance)
Servers scale out easily; the database is the single point everyone hits

App servers scale out quickly, but the core banking system holds every balance in a central ledger that must stay strictly consistent. You cannot simply add copies of it the way you add web servers.

What makes it worse

End-of-day and month-end batch jobs (interest, statements, settlements) compete with live traffic for the same database. Users who see a slow app refresh and retry, adding load to a system that is already struggling (see Day 01).

How engineers plan for it

  1. Forecast the peak from past data, not the average.
  2. Load-test above the expected peak before it arrives.
  3. Autoscale stateless tiers (web and app servers) and pre-scale before known peaks.
  4. Move heavy batch jobs away from peak hours.
  5. Protect the database: caching, read replicas for read-only queries, rate limiting and queues.
  6. Degrade gracefully: show a cached balance or a "try again in a minute" page instead of crashing.

Key terms

Term Meaning
Peak load The highest traffic a system must handle, not the average
Capacity planning Sizing systems ahead of time for expected peak demand
Headroom Spare capacity kept above the expected peak
Load testing Simulating heavy traffic to find the breaking point before users do
Autoscaling Adding or removing servers automatically as load changes
Core banking system The central system that holds accounts, balances and the ledger
Batch job Heavy scheduled work run in bulk, such as interest calculation
Read replica A copy of a database that serves read-only queries
Graceful degradation Serving a reduced experience instead of failing completely

Interview questions to practise

  1. How would you estimate the capacity a payment app needs for salary day?
  2. Why is a database harder to scale than an app server?
  3. Your nightly batch job now overlaps with morning peak traffic. What are your options?
  4. Which parts of a banking app can show slightly stale data, and which never can?