Conflict Management
===================

EDB Postgres Distributed is an active/active or multi-master DBMS. If
used asynchronously, writes to the same or related rows from multiple
different nodes can result in data :ref:`Monitoring conflicts <Monitoring conflicts>`  when using standard
data types.

Conflicts aren’t errors. In most cases, they’re events that PGD can
detect and resolve as they occur. Resolution depends on the nature of
the application and the meaning of the data, so it’s important that PGD
provides the application a range of choices as to how to resolve them.

By default, conflicts are resolved at the row level. When changes from
two nodes conflict, either the local or remote tuple is picked and the
other is discarded. For example, the commit timestamps might be compared
for the two conflicting changes and the newer one kept. This approach
ensures that all nodes converge to the same result and establishes
commit-order-like semantics on the whole cluster.

Column-level conflict detection and resolution is available with PGD,
described in :ref:`CLCD <Conflicts>`  .

If you want to avoid conflicts, you can use `Group Commit <https://www.enterprisedb.com/docs/pgd/latest/commit-scopes/group-commit/>`_  with
 `Eager conflict resolution <https://www.enterprisedb.com/docs/pgd/latest/commit-scopes/group-commit/#eager-conflict-resolution>`_  or conflict-free data types (CRDTs), described in
:ref:`Handling column-level conflicts using CRDT data types <Handling column-level conflicts using CRDT data types>`  . You can also use PGD Proxy and route all writes to one
write-leader, eliminating the chance for inter-nodal conflicts.

.. toctree::
  :maxdepth: 3

  PGD_Features--conflict-management--conflicts--index
  PGD_Features--conflict-management--column-level-conflicts--index
  PGD_Features--conflict-management--crdt--index
