@kodekloud: When to Shard Database vs Replicate? Database Scaling Explained Most database scaling mistakes come from treating replication and sharding as interchangeable. They solve different problems. I've seen teams throw sharding at a simple read-heavy bottleneck and buy themselves months of operational pain, resharding, cross-shard queries, and hot partitions when two read replicas would have fixed it. And I've seen the opposite: teams stacking replicas onto a write-heavy system and wondering why the primary is still on fire. Every replica has to apply every write, so replication does nothing for write volume. The rule is simple. Don't shard until you've exhausted caching and replication. Replication, one primary pushing copies out to read replicas, is the answer for read-heavy workloads like social feeds, and it gives you a standby when the primary dies. Sharding is for when writes or raw data size physically outgrow one machine. You split the data across independent servers, each owning its own slice. And in mature production systems, it's not either or. You shard first, then replicate each shard. Writes scale across the shards, and every shard survives a machine failure. Match the fix to the actual bottleneck. Most of the time the bottleneck is reads, and most of the time replicas are enough. #SystemDesign #Databases #DevOps #BackendDevelopment #SoftwareArchitecture
KodeKloud
Region: SG
Sunday 23 August 2026 13:30:15 GMT
Music
Download
Comments
ququwuwueuueueue :
Im sharding while i watch this
2026-08-23 18:49:51
173
Pitterpatter :
Usually sharting is not a good thing….
2026-08-23 19:29:10
68
01001011 :
Cassandra solves both scenarios using tokens in a closed ring topology. Yes I know it's not an RDBMS
2026-08-23 18:44:32
2
just.peachy67 :
Understand the usage and create warehousing views.
2026-08-25 03:37:19
0
SurprisedAmerican :
isn't sharding a fancy way of saying partitioning your database? 🤨
2026-08-24 14:52:22
7
Paige :
I don’t get to play with these anymore 😩
2026-08-25 03:30:18
0
sleiman k :
sharding is to scale write model, while replica is used to scale read model. both are needed.
2026-08-23 21:45:52
17
thesnail.brian :
both wrong. stripe data across disks and put CPU s beside disks to process relevant rows
2026-08-24 14:05:10
0
Bloody Kheeng :
is that possible with mysql
2026-08-23 17:12:25
3
DennisTheMenace :
Replicas vs sharding for strongly consistent reads?
2026-08-24 05:15:18
0
davidlikestotok :
Great video. Replicas have issues too like sync timing to consider
2026-08-24 19:30:32
1
Logixand :
I literally just sharded less than an hour ago.
2026-08-24 00:23:52
4
kc_kode :
So Insightful 👍
2026-08-24 19:26:02
0
Ok :
Start by optimizing the queries…then read replicas, then vertical …. And continue
2026-08-23 17:56:43
2
Ben :
but replication has issues
2026-08-23 21:45:54
0
greygoreeroy :
Indices, connection pooling and caching. Then shard and route. Then revisit whether relational is even the right choice
2026-08-24 05:10:14
2
SMELink Mauritius :
i've worked for multiple software companies and never once faced an issue where database was under load. IF you pay your developers well and invest in good hardware, this issue would never arise. ITs all about finding the shortest route to avoid the issue.
2026-08-23 14:41:13
5
Geoffrey Bj :
Migrate and use AWS 😂
2026-08-23 16:42:54
0
Bloody Kheeng :
how about u just reduce pagination per page to 2 😅 or 1
2026-08-23 17:13:26
0
aligo :
But how joins queries works in sharding
2026-08-23 21:17:14
2
Orangeeena :
Ok sharding will need a base of replication. Your user problem should be handled at the server level with a load balancer then you have a properly designed databased with compiled procedures and proper indexing
2026-08-23 21:05:32
1
MomentosRandom :
May be possible to have one vid about caching ?
2026-08-23 16:07:14
1
Akhona :
Don’t teleport to major solutions. Understand your queries first so you can optimise them. Then Vertically scale if needed. Then check your reads vs your writes read:write ratio. Try different strategies to optimise here depending on your performance levers. For example if you are Facebook and posting is a heavy transaction due to multiple steps then maybe look into other posting strategies that may maybe move the multiple steps to read instead of write and then maybe add cache 🤷♂️each business application is different. Basically let your performance state and performance requirements lead you and don’t jump 10 steps ahead that’s how you end up with silky smooth system that chows the 6 months budget in 3 months. Balance is key. Partition before sharding. Same way you scale up before out.
2026-08-23 19:39:32
1
Foobar :
it's like striping of storage
2026-08-24 01:08:25
0
Patterson 💻 💯✅ :
Replicants falls several times
2026-08-24 08:50:30
0
To see more videos from user @kodekloud, please go to the Tikwm
homepage.