3 ms·
You can, of course, scale to >1 with the Fly Machines API. I don't know enough about how they're managing the SQLite part of this to say more about how this sca
by tptacek 4y ago
You can, of course, scale to >1 with the Fly Machines API. I don't know enough about how they're managing the SQLite part of this to say more about how this scales, except that I think scaling out SQLite is about to get a lot more interesting.
But I mostly agree that we need a better term than "serverless" for this kind of stuff. The big things people seem to want from "serverless" solutions are "not managing long-running server instances" and "true usage-metered billing".
Whether or not there are servers, like, at all has not all that much to do with things.
- gregwebs 4y agoThis is SQLite, so how would you scale itr to > 1? Certainly you can put an app tier in front of this DB tier and scale the app tier to infinity.
- tptacek 4y agoBy replicating the SQLite transactions to other SQLite databases.
- soamv 4y agoHey, I like SQLite and I also like fly.io, but "distributed DB built with sqlite as storage" is really a very different beast from just "sqlite".
- tptacek 4y agoI'm mostly interested in the SQLite part of this, and we don't have an SQLite offering, only Postgres, just to be clear. So you can't hurt my feelings here. When does SQLite become "a distributed DB built with sqlite as storage"? Did Postgres stop being Postgres when someone plugged log shipping into it? That's basically what we're talking about here --- not stuff like rqlite, which I'm also pretty interested in, but which really is a new database built on SQLite.
- gregwebs 4y agoUsers generally don't plug ad-hoc log shipping solutions into Postgres. They generally use the built-in battle-tested Postgres replication features, and they can setup synchronous replication to avoid data loss. Shipping a log is trivial but synchronous replication and failover are quite difficult to get right (see jepsen.io), and setting up failover for Postgres is still quite difficult. Newer DBs have been built from the groundup (CRDB, TIDB, etc) in part because of the difficulty of attempting to operate traditional DBs as reliable distributed systems.
- tptacek 4y agoThey do now, but that wasn't always the case, and people didn't say that you weren't running Postgres when you did that. Cockroach is not the same thing we're talking about here; it's a much more ambitious design, just like rqlite is much more ambitious than shipping SQLite transactions. What we're talking here is the tooling needed to generate a single-writer multi-reader cluster the way you would for Postgres, but for SQLite instead. I don't know if single-writer multi-reader clusters for Postgres qualify as "easy", but they're not science projects. If it's not obvious: we love Cockroach. Our commercial bias is that we built a platform that is especially useful for distributed services and clusters, and Cockroach is very much that.
- gregwebs 4y agoOkay, 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.
- shabbatt 4y agoFor many fly.io is not a viable alternative especially those that are already on the AWS train. I think that AWS already offers Aurora Serverless v2 which pretty much accomplishes what a lot of these me-too-serverless services that won't integrate as well as something that is offered out of AWS. Even if you were insistent on cloud-agnostic mandate (which is really not logical since there is at best 3 public clouds to choose from that are also vulnerable to targeted cyberattacks and faultlines), it would be hard to convince a large organization to switch to using Sqlite on Fly.io
- tptacek 4y agoForget the Fly.io part; SQLite is what's interesting here. I agree in advance that it's unlikely anyone's going to convert a large app from Postgres to SQLite; if full-stack SQLite succeeds as a trend, it'll be with new apps that grow up using it.
- shabbatt 4y agointerested to know what you see in sqlite here? why is there so much interest in this all of a sudden lately? am I missing something?
- tptacek 4y agoIt's a database that in full-stack culture has been relegated to "unit test database mock" for about 15 years that is (1) surprisingly capable as a SQL engine, (2) the simplest SQL database to get your head around and manage, and (3) can embed directly in literally every application stack, which is especially interesting in latency-sensitive and globally-distributed applications. Reason (3) is clearly our ulterior motive here, so we're not disinterested: our model user deploys a full-stack app (Rails, Elixir, Express, whatever) in a bunch of regions around the world, hoping for sub-100ms responses for users in most places around the world. Even within a single data center, repeated queries to SQL servers can blow that budget. Running an in-process SQL server neatly addresses it. Conveniently, most applications are read-heavy, and most performance-sensitive app requests are reads.