Database Reference
In-Depth Information
Conflict resolution
Earlier, we saw that eventual consistency in data replication leads to conflicts, so it's very
important to handle the conflict resolution in a neat and clean manner. For conflict resolu-
tion, we need to answer two things:
• When to resolve the conflict?
• Who would be resolving the conflict?
Conflicts can be resolved at read time or write time. Most data store systems resolve con-
flicts on write operations and keep the read operation fast and lightweight. But DynamoDB
does not do that; it uses an always writable strategy, allowing writes all the time. This is a
crucial strategy from Amazon's business point of view, as they don't want people to wait
for some write to happen until the conflict is resolved. This means they want the user to be
able to add items to the cart at all times. If it does not happen, then it would give a bad user
experience and would lead to a serious impact on Amazon's business.
It is also equally important to decide who would resolve the conflict, that is, the application
or the database. When it comes to the database resolving conflicts, it prefers to use the last
write wins strategy. In the case of Amazon, you are given the choice to choose your own
conflict resolution by providing features such as conditional writes, which we saw in
Chapter 2 , Data Models .
Search WWH ::




Custom Search