←back to thread

131 points pgedge_postgres | 3 comments | | HN request time: 0.887s | source
Show context
OsrsNeedsf2P ◴[] No.45534696[source]
If both nodes approve an update on the same primary key, what happens? I don't see this crucial detail described in the README
replies(3): >>45534976 #>>45535107 #>>45540386 #
1. pgedge_postgres ◴[] No.45534976[source]
Thanks for pointing out the lack of info on conflict resolution in the README! It's been reported and we'll look at getting that updated ASAP.

In the meantime, you can find a lot of information in the official FAQ on how conflict resolution is handled (https://www.pgedge.com/resources/faq), but at-a-glance, "pgEdge offers eventual consistency between nodes using a configurable policy (e.g. last-writer-wins) for conflict resolution, along with conflict-free delta apply columns (i.e. CRDTs) for running sum fields. This allows for independent, concurrent and eventually consistent updates across multiple nodes."

replies(1): >>45535743 #
2. n_u ◴[] No.45535743[source]
Cool project!

How do you generate the timestamps for last writer wins? What happens if there is a tie?

Just my 2c: if I see a distributed database, the first question I ask is how it handles distributed transactions. Perhaps this topic should be higher on your FAQ, currently it is the 21st question.

replies(1): >>45541114 #
3. bonesmoses ◴[] No.45541114[source]
There's an option in the Postgres configuration named "track_commit_timestamp" that does this automatically. It's required to be enabled when using LWW as the conflict resolution model. If there's a tie, the node with the highest node number wins.