How to Resolve Conflicts with Custom Conflict Resolution?

In some scenarios, the most suitable way to resolve a conflict resolution may be dependent on the type of application being built.

👉 Most multi-leader replication tools allow you write custom conflict resolution logic using application code.

  • This could be on executed on a write or a read ✍️ 📖
    • On write ✍️
      • As soon as the database detects a conflict in the log of replicated changes it will call a conflict handler
      • For example, Bucardo allows you to write snippets of Perl for this purpose
        • This handler typically cannot prompt a user
        • It runs as a background process and it must execute quickly
    • On read 📖
      • When a conflict is detected all the conflicting writes are stored
      • The next time data is read, these multiple versions of the data are returned to the application
      • The application may prompt the user or automatically resolve the conflict and write the result back to the database
      • For example: CouchDB works this way!

✋ To note, that conflict resolution is only applied on the individual row or document not for an entire transaction…

🤔 Meaning, if you have a transaction that makes several different writes, each write will need to be handled separately for the purpose of conflict resolution.

To be continued

The final post will be covering the powerful capability of automatic conflict resolution and reasons why you may consider this approach, as writing custom conflict handlers can be error prone!

For more reading on conflict resolution:

📚 Further Reading & Related Topics

If you’re exploring custom conflict resolution in distributed data-intensive systems, these related articles will provide deeper insights:

• Distributed Data-Intensive Systems: What Is a Conflict? – Learn about the various types of conflicts in distributed systems and how custom conflict resolution strategies are essential in ensuring data consistency.

• Distributed Data-Intensive Systems: Limitations of Quorum Consistency – Explore how quorum-based consistency impacts conflict resolution and how custom strategies can be designed to address specific use cases in distributed systems.

4 responses to “How to Resolve Conflicts with Custom Conflict Resolution?”

  1. Distributed Data Intensive Systems: Resolving Conflicts – Automatic Conflict Resolution – Scalable Human Avatar

    […] resolution rules can become complicated and custom code can be prone to […]

    Like

  2. Distributed Data Intensive Systems: What is a conflict? – Scalable Human Avatar

    […] Resolving Conflicts – Custom Conflict Resolution […]

    Like

  3. What is Replication? – Scalable Human Avatar

    […] How to Resolve Conflicts with Custom Conflict Resolution? […]

    Like

  4. What is Replication and Why is it Important? – Scalable Human Avatar

    […] How to Resolve Conflicts with Custom Conflict Resolution? […]

    Like

Leave a reply to What is Replication? – Scalable Human Cancel reply

I’m Sean

Welcome to the Scalable Human blog. Just a software engineer writing about algo trading, AI, and books. I learn in public, use AI tools extensively, and share what works. Educational purposes only – not financial advice.

Let’s connect