Serialize a read-modify-write across instances.
Name it
Say what this problem really is, professionally — the concept + when it bites. practice the framing →
Explain it out loud
Say it in your own words — but hit these: select for update · row lock · atomic · read-modify-write · waits · unique
checking microphone…
Code it (7-step rhythm, narrate)
Clarify → approach → data model → narrate → edge → test → tradeoff. AI off. Lab: row-level lock (ID generator) →
Edge cases — say + handle each
Say the trade-off
“Strong guarantee, but it serializes writers and pins a connection — use it only for genuinely hot contention.”
checking microphone…
Answer the follow-up
How do you avoid deadlocks?