Consistency
===========

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:`Conflicts <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 <Column-level conflict detection>`  .

If you want to avoid conflicts, you can use :ref:`Group commit <Group commit>`  with
 :ref:`Eager conflict resolution <Eager conflict resolution>`  or conflict-free data types (CRDTs), described in
 :ref:`bdr.crdt_handlers <bdr.crdt_handlers>`  .

.. toctree::
  :maxdepth: 3

  Using--consistency--conflicts
  Using--consistency--column-level-conflicts
  Using--consistency--crdt
  Using--consistency--eager
