Scaling Databases: Replicas, Sharding, Caching, Consistency | Database Course Ep 23
Joshua Moses | Cybertrace Foundation
0:00 / 0:00
Scaling Databases: Replicas, Sharding, Caching, Consistency | Database Course Ep 23
4 просмотра · 2 нед. назад
Joshua Moses | Cybertrace Foundation
194 подписчика
4 просмотра · 2 нед. назад
What happens when you hit 1,000,000 users? At some point a single database server stops keeping up. This episode explains the main ways to scale a database and the tradeoffs each one brings.
We start with the breaking point, when queues build and requests time out. Then we compare scaling up (a bigger server) with scaling out (more servers). You'll learn how read replicas use a single-leader model where the primary handles writes and forwards copies to followers, and what happens when replicas fall out of sync. We cover sharding, which splits a dataset across servers by key ranges, and the danger of database hotspots. Then we add a caching layer with tools like Redis or Memcached and LRU eviction, and finish with the final tradeoff: you cannot guarantee perfect availability and perfect consistency at the same time.
What you'll learn:
Signs your database has hit its limits
Vertical vs horizontal scaling
Read replicas and replication lag
Sharding strategies and hotspots
Caching with Redis or Memcached
The consistency vs availability tradeoff
Chapters:
0:00 Introduction
0:27 What Happens When You Hit 1,000,000 Users?
0:48 Episode Overview
1:06 The Breaking Point: Hitting the Limits
1:44 Scaling Up vs Scaling Out
2:27 Read Replicas: Synchronizing Servers
3:50 Sharding: Splitting the Data
5:28 Caching Layer: High-Speed Memory
6:12 Consistency: The Final Tradeoff
7:32 Final Question: Did You Add Scaling Complexity Too Early?
Cybersecurity Masterclass by Joshua Moses | CyberTrace Foundation. #Course Lab Guide:
https://github.com/joshuanmoses/Cyber...