6 ms·
Thanks! What's your recommendation how to solve the problem described in the article? Would you compare LSNs of replicas in application logic at all?
by MartinMond 9y ago
Thanks!
What's your recommendation how to solve the problem described in the article? Would you compare LSNs of replicas in application logic at all?
- anarazel 9y agoI've only skimmed it so far, so I might be missing parts. I think it depends a lot on what you're trying to achieve. In a lot of cases all the guarantee you need is read-your-own-write, and small delays for an individual connection aren't that bad. In that case it can be a reasonable approach to inquire the LSN of the commit you just made, and just have your reads, to whichever replica they go, wait for that LSN to be applied. For a system that's very latency sensitive that'd not work, and you'd fall back to querying the master pretty much immediately. Or you'd use something like described in the article, although I'd probably implement it somewhat differently.