Databases worden vaak een bottleneck naarmate systemen groeien. Schaaling ervan omvat technieken zoals replicatie (kopieën voor lees-schaaling en beschikbaarheid), sharding (gegevens splitsen over servers), caching, en het kiezen van passende databasetypes.
Replicatie — kopieën van de gegevens
REPLICATION → maintain COPIES of the database across servers:
→ PRIMARY (writes) + REPLICAS (copies):
- READ SCALING → direct reads to replicas (offload the primary) → handle more reads
- AVAILABILITY → a replica can take over if the primary fails (failover)
⚠️ replication lag → replicas may be slightly behind (eventual consistency for reads)
→ great for READ-heavy workloads and availability (most apps are read-heavy)
