Hacker News new | ask | show | jobs
by _m8fo 1028 days ago
An interesting idea, but if I’m understanding the problem trying to be solved - might be better suited by durable execution (two examples being Azure’s durable functions, and Temporal.io).

In practice transactions between arbitrary data stores would result in potentially boundless and unpredictable latency, no?

Also, is Postgres strongly consistent and linearizable)? One alternative would be using a database with stronger consistency guarantees (Spanner is but not open source, FoundationDB is but has limitations on transactions unless you implement mvcc yourself, which to be fair you are).

4 comments

Durable execution is good for atomicity, but this approach also gives you isolation. If you're doing updates on both Postgres and Mongo and you want to guarantee both updates happen, Temporal can do that. But if you want isolation, for example the guarantee that any operation that can see the Postgres update can also see the MongoDB update, then you need distributed transactions like in Epoxy.
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.

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).
Durable execution is an equivalent alternative.

Replication speed could be bad, I don't see a reason to expect that.

PostgreSQL can have serializable transactions though that is not the default isolation level.

What about Mongodb?