The leader died right after confirming your payment. Is it gone?
transcript
You buy Premium. The screen says payment confirmed. One moment later, the database leader dies. Is your payment gone?
StreamFlix has one leader taking every write, and followers copying it. After a failover, your continue-watching spot is slightly behind? Annoying. A lost subscription purchase? Lost revenue. An angry customer.
Asynchronous: the leader says success right away. It copies later. Leader dies in that gap? The follower never got it. Gone. Synchronous: send it to a follower first. Confirm only after it says got it. Leader dies now? The follower already has it. Zero data loss.
So make everything synchronous? Here's the catch. Every write waits. And one slow follower can block all writes.
So StreamFlix doesn't pick one. Every write asks: is this critical? Payments and subscriptions? Synchronous. Wait for the copy. Viewing history? Asynchronous. Reply now. Speed matters more. Sign-in sits in between. Semi-synchronous.
One last trap. After the crash, which follower becomes leader? The synchronous one. Promote any other, and your payment can still vanish.
Not one rule for everything. Replicate by what the data is worth.
Full breakdown in the lecture.