> do I understand that all database traffic gets routed to the leader? Do you serve read-only queries from the local replica?
No, and yes. The replica have a very large ping between them, serving everything from the leader would be extremely slow.
> The described setup looks like something that cockroachdb would be able to handle nicely, which perhaps is a little more battle-tested than what you wrote.
Thanks for the suggestion, I wasn't aware of Cockroachdb, I'll try to see how I can switch to that.
Also, "what I wrote" is just a small script to extend my previous setup (which used PostgreSQL) to replicae. I first read about Patroni, supposedly used by large companies, and went with that, before discovering that it requires a lot of monitoring, and can't work for a one-person team.
> Also, "what I wrote" is just a small script to extend my previous setup (which used PostgreSQL) to replicae.
I wouldn't discount your work, etcd is very stable, so it probably works very well for your use case.
As for using Cockroachdb, I guess it depends on your use cases: with what you have now, it seems like local reads are able to read stale data (someone updates x at the leader, while you read locally), but it might not be a problem for Nest. Cockroach will always try to read the latest version of the data, so unless you need serializability, the cost of switching might not be worth it.
> I wouldn't discount your work, etcd is very stable, so it probably works very well for your use case.
I had understood that, but code I don't write is code I don't have to maintain, so I'm obviously always totally open to suggestions (getting comments and suggestions is part of the reason I wrote that blog post to begin with).
No, and yes. The replica have a very large ping between them, serving everything from the leader would be extremely slow.
> The described setup looks like something that cockroachdb would be able to handle nicely, which perhaps is a little more battle-tested than what you wrote.
Thanks for the suggestion, I wasn't aware of Cockroachdb, I'll try to see how I can switch to that.
Also, "what I wrote" is just a small script to extend my previous setup (which used PostgreSQL) to replicae. I first read about Patroni, supposedly used by large companies, and went with that, before discovering that it requires a lot of monitoring, and can't work for a one-person team.