Hacker News new | ask | show | jobs
by jeremyjh 1028 days ago
Consistency is a property of distributed databases. Stock Postgres is not distributed, and thus gets strong consistency for free.

There is still a concept of (transaction) isolation levels, and the ANSI SQL standard defines a transaction mode READ UNCOMMITTED that could give you inconsistent results, but Postgres ignores that and treats it as READ COMMITTED.

2 comments

in terms of ACID "Consistency ensures that a transaction can only bring the database from one consistent state to another, preserving database invariants: any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This prevents database corruption by an illegal transaction. Referential integrity guarantees the primary key–foreign key relationship." So no it's not free
That is an entirely different meaning of consistency. GP was talking about CAP theory, as they acknowledged in a follow-up comment.
Yeah you are right - I thought the primary in this case was distributed since most of the shims were (CouchDB, Mongo, etc).