3 ms·
I've written something similar for PostgreSQL using Paxos: https://github.com/citusdata/pg_paxos https://github.com/citusdata/pg_paxos . It can replicate tables
by mslot 11y ago
I've written something similar for PostgreSQL using Paxos: https://github.com/citusdata/pg_paxos https://github.com/citusdata/pg_paxos . It can replicate tables across a set of PostgreSQL servers.
pg_paxos is an extension that uses PostgreSQL's query execution hooks so it doesn't require any external components. An advantage of pg_paxos is that you can do reads and writes on any node. Would love to know what people think and whether it's something you would use (if rigorously tested). Small warning: it replicates SQL queries and doesn't stop you from using volatile functions like now() yet, which would give inconsistent results.
A possible application is a reliable cron service. Each cron node tries to add an entry to a replicated locks table with the same primary key on any of the PostgreSQL nodes. Only one will succeed and then runs the cron job.
Some more details in these slides: http://www.p2d2.cz/files/pg_paxos.pdf http://www.p2d2.cz/files/pg_paxos.pdf
- paulryanrogers 11y agoPgpool replication can work that way too
- CodeWriter23 11y agoWhat was your motivation to DIY instead of using Bucardo?
- mslot 11y agoBucardo provides asynchronous (eventually consistent) replication. If you need strong consistency with fault-tolerance, you need something like pg_paxos, but it comes at a significant performance penalty so it's not really an alternative for existing replication solutions.
- CodeWriter23 11y agoThanks. I've been looking at PG replication solutions to get rid of the hand-coded synchronization built into a couple of my apps that date back to the dial-up days.