Hacker News new | ask | show | jobs
by gregwebs 1375 days ago
Okay, I read the fly.io documentation. What is being done now to globally distribute PG results is asynchronous replication and thus stale reads and presumably the potential for data loss during failover. So I can see why it would make sense to use SQLite to achieve a similar setup.

Still, I would expect the windows of read staleness and data loss to be much wider with an approach of just shipping logs rather than re-engineering things like RQLite, etc. Trying to ship a copy of SQLite to every app will mostly achieve lower latency at the cost of staler reads, although I can see how ideally it could cut the latency in half by streaming data ahead of time. But of course it increases storage costs dramatically as things scale out.

1 comments

Sure, that seems very likely to be true! The flip side of the coin though is that rqlite really is a different database than SQLite. I'm not making a case against things like rqlite and Cockroach; I think they're great, and also my bread is buttered on the same side as theirs. I'm saying that if you're not going to use rqlite --- and most people aren't --- you can get SQLite to the same multi-reader single-writer cluster setup that most people do with Postgres.

And there's a distinct advantage to doing this with SQLite: if you can viably deploy SQLite (because your tooling is asymptotically approaching the state of the art for Postgres), your reads are ultra fast, because you're not hitting the network for an extra round trip every time you query your database.