If you want failover to work well, use it often (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
I 80% agree that people should consider active-active; it's the ideal from an engineering reliability perspective, and for transactional apps, should even be doable at the database level for conventional databases. Probably the best balance of cost and reliability might be a monthly swapping of regions to work out bugs in your process and run books, and to also ensure new code or environment changes are not overlooked. In clouds you could potentially suspend or size-down resources in the fallback region. Weekly or blue-green deployment alternating would be somewhere in-between.
It *is* possible even to do active-active with two writers and bi-directional replication with datacenter in different geographic regions with different power grids. I did it with off the shelf Microsoft SQL Server once upon a time although one could potentially do it nowadays with Postgres v16+. Keeping bi-directional replication working wasn't easy but was possible. There were two key parts to this:
1) Webservers on one region by default routed to database servers on the same region. After some jittered exponential backoff failed, they would try the other region. All database access by our code was mediated by a single set of our own wrapper libraries to facilitate/ensure a common failover pattern (and common logging).
2) Primary key seeds for new rows were odd on one site and even when created on the other, both incrementing by two.
In hindsight, I'd estimate we had more failures of our services due to byproducts of failover handling of some aspect going wrong than actual underlying failures of the hardware and datacenter, so active-active isn't for everybody. We were supporting telecom-type services so management supported the engineering effort.
It's tricky nowadays to do active-active with modern analytical/columnar database stacks which tend not to expose their WALs or prioritize such reliability. That'll be more of a problem as agents start to rely more on them.
Monitoring and automated recovery of bi-directional replication glitches/failures wasn't easy back then but it might be more straightforward in this agentic age where the eval criteria is essentially to ensure eventual consistency modulo some measured acceptable variance.