3 ms·
> we have a very small cluster comprised of a main PostgreSQL instance and four replicas As you said, it depends on what you want: - If you are okay with losi
by binwiederhier 3y ago
> we have a very small cluster comprised of a main PostgreSQL instance and four replicas
As you said, it depends on what you want:
- If you are okay with losing data in the event of a failover, then a simple setup is fine.
- If you want lossless failovers (i.e. not a single transaction is lost), then that's hard.
- If you want entirely automatic failovers, that's also very hard.
- ...
My experience stems from MySQL, and not PostgreSQL, so this may or may not apply to pg. I wrote about my experience in this blog post: https://blog.heckel.io/2021/10/19/lossless-mysql-semi-sync-replication-and-automated-failover/ https://blog.heckel.io/2021/10/19/lossless-mysql-semi-sync-r... --- TLDR: Not losing data with MySQL is really really hard.
- fodkodrasz 3y agoPG fully consistent automatic failovers are also pretty hard, at least they were 3-4 years ago when we did such a setup (initially it seemed easy, but tests showed its limits, and getting it reliable was pretty hard). Now I heard that there are Kubernetes based solution which are said to automate it pretty well, but have not tried those yet.