Skip to content
StackDecode
System Design
8. Load Balancing and ScalabilityAnimated

Database Scaling

Growing database capacity.

The idea

Use indexes, caching, read replicas, partitioning and sharding.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

App serversPrimary (writes)Replica 1 (read…Replica 2 (read…
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Step one: add indexes and cache.

step:
1/4
at:
App servers
1/7

The green dot is a request moving through the system.

Step by step

  1. 1Optimise queries and indexes
  2. 2Add caching
  3. 3Add read replicas
  4. 4Shard when writes exceed one node

Where it is used

Growing data.

Watch out for

Each step adds complexity. Start with the simplest.

Related