DEV Community

Danyson
Danyson

Posted on

Last Write Wins - A Conflict resolution strategy

Imagine, a file or database is written concurrently by 3 processes.

Eventhough from the user point of view where all the file write processeses happen at the same time, but that doesn't mean all three can co exist in the same file or database field right?

It will break consistency.

So, we need to make sure only the last written data as the final data for the file, in a given time.

How do we consider which data is the last data?

Timestamp of course!

Timestamp is used for each write operation to identify which write is the final write.

MongoDB and Cassandra are examples of having Last Write Wins Strategy.

More importantly in Cassandra if we are quering an update, each column has its own timestamp value.

Hope you guys find usefull

Support us by Buying us some Cookies

Visit our site Doge Algo

Top comments (0)