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 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 CLCD .
- If you want to avoid conflicts, you can use Group commit with
Eager conflict resolution or conflict-free data types (CRDTs), described in bdr.crdt_handlers .
- Conflicts
- How conflicts happen
- Types of conflict
- PRIMARY KEY or UNIQUE conflicts
- INSERT/INSERT conflicts
- INSERT operations that violate multiple UNIQUE constraints
- UPDATE/UPDATE conflicts
- UPDATE conflicts on the PRIMARY KEY
- UPDATE operations that violate multiple UNIQUE constraints
- UPDATE/DELETE conflicts
- INSERT/UPDATE conflicts
- INSERT/DELETE conflicts
- DELETE/DELETE conflicts
- Conflicts with three or more nodes
- Foreign key constraint conflicts
- TRUNCATE conflicts
- Exclusion constraint conflicts
- Data conflicts for roles and tablespace differences
- Lock conflicts and deadlock aborts
- Divergent conflicts
- TOAST support details
- Avoiding or tolerating conflicts
- Conflict detection
- Conflict resolution
- Conflict logging
- Data verification with LiveCompare
- Column-level conflict detection
- Conflict-free replicated data types
- Eager conflict resolution