@legitalgorithmswithpeter: 🔥 How would you handle 500,000 likes in just one minute? This is where the Hot Row Problem comes in. Updating the same database row for every like creates contention, delays, and timeouts. 🚀 The solution? * Use Redis for lightning-fast counting. * Batch updates every few seconds. * Reduce thousands of database writes. But what happens if Redis crashes before those likes reach the database? 🤔 💬 How would you prevent losing those likes? #SystemDesign #Redis #Database #BackendEngineering #TechExplained
Simply use a message broker like RabbitMq or Kafka
2026-11-14 22:36:02
75
Peter de Small :
How do you then track who liked what?
2026-11-14 19:13:42
19
user8121616439376 :
At that scale, the real time number is not that important. You derive a velocity and increment the counter at that speed (add some jitter +/- noise for fun). At a sustainable interval use a slower, more accurate source of truth to reset the baseline and recalculate the velocity.
2026-11-14 23:05:44
20
wolfin :
Redis cant crash because it’s an in memory cache
2026-11-15 09:25:09
6
angullllll__ :
What about dns
2026-11-14 23:47:23
4
Jorge Duran :
And an asynchronous queue like rabbitMQ or kafka?
2026-11-14 23:23:46
2
musjg7632 :
redid can't crash
2026-11-15 07:27:36
0
Dan :
idk at all so my noob opinion is you tune your batch sizes to minimize the impact of your redis' down time during restart. Possibly use a duplicate redis to cache the cache as a failsafe if you can afford the ram. Then fetch likes from viewers again. If there's a way to cache what redis is storing without increasing server expense or reducing speed then that's the way to do it
2026-11-14 23:41:08
0
罗曼 :
redis has sla for crushing
2026-11-15 05:06:26
0
dgilmour76 :
Redis paired with Redis Sentinel (redundancy)
2026-11-14 20:39:15
13
afiq meow :
i dont finish the video yet but my proposed solution would be to accumulate the likes count and write into the db every set timeframe. it will reduce the db write count but each write size in increases significantly. idk the ideal data size but heh
2026-11-15 01:21:23
0
LiveTrips :
And if kafka dies? Same as redis
2026-11-15 10:11:37
0
Bronderblazer :
Iso27001 policy prohibits redis db to crash.
2026-11-15 01:00:37
4
haha :
anything with eventually consistent and fast
2026-11-17 23:04:05
1
David :
Eventual consistency. Good at scale.
2026-11-16 19:14:24
1
Social :
Rabitmq?
2026-11-14 19:34:18
4
معز مكشخ 🇧🇪🇵🇸🇹🇳♒ :
This is came behind one of the reason why a book like design data intensive application was wrote
2026-11-15 15:48:53
3
anaab :
High availability cluster, never let a single node hold the transaction by itself.
2026-11-14 21:03:17
5
Azura210 :
if the cache layer breaks down for one database server, as long as you have multiple read replicas running in different servers in different regions, you can just promote one of those to master server and continue on
2026-11-14 22:07:37
3
Oba :
what will Nvidia CEO do?
2026-11-14 21:34:44
1
Zach M :
One could use an append only (inserts) table in place of Redis. The rest stays the same. Now what you were putting in Redis is durable. Clean up on this table would have to be smart to avoid locking the table and blocking inserts.
2026-11-16 11:20:05
1
Dollar Diary :
Fanout table
2026-11-15 00:50:24
1
Westlove | Software Engineer :
Kafka
2026-11-14 19:58:34
1
Waheed Desire :
Redis AOF
2026-11-14 19:11:43
0
To see more videos from user @legitalgorithmswithpeter, please go to the Tikwm
homepage.