Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Database Federation

Splitting databases by function.

The idea

Users, orders and products live in separate databases, reducing load on each.

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. 1Group tables by domain
  2. 2Give each group its own database
  3. 3Route queries by domain
  4. 4Join in the application

Where it is used

Growing applications before sharding.

Watch out for

Cross-database joins are no longer possible in SQL.

Related