Conflict Resolution
ELI5 — The Vibe Check
Conflict resolution is what happens when two database servers both change the same thing at the same time and then try to sync up. 'I changed the user's name to Alice.' 'Well I changed it to Bob.' Someone has to win. Common strategies: last write wins, merge the changes, or let the application figure it out.
Real Talk
Conflict resolution handles concurrent modifications to the same data in replicated or distributed systems. Strategies include Last-Writer-Wins (LWW) using timestamps or version vectors, application-level resolution through conflict handlers, and Conflict-free Replicated Data Types (CRDTs) that mathematically guarantee convergence. The choice impacts data correctness and system complexity.
When You'll Hear This
"Last-writer-wins is the simplest conflict resolution but can silently lose data." / "CRDTs resolve conflicts automatically without coordination."
Related Terms
Eventual Consistency
Eventual consistency means 'give it a moment and everything will match up.' You write data to one server, and the other servers will get the update...
Multi-Primary Replication
Multi-primary replication lets multiple database servers accept writes simultaneously, like having multiple cashiers at a store.
Two-Phase Commit
Two-phase commit (2PC) is like a wedding ceremony for distributed transactions. Phase 1: 'Do you all agree to commit?' Every node says yes or no.
Vector Clock
A vector clock is a way for distributed servers to figure out the order of events without a synchronized wall clock.