News for hackers. Stuff that matters.
Re:LiteFS Cloud: Distributed SQLite with Managed Backups by Kalanos on Wednesday July 05, 2023 @01:40PM (#36603977)
my sqlite pain point is not being able to access sqlite over NFS or remotely on a separate server. i want the best of both worlds: behave like a file locally + act like a server
Re:LiteFS Cloud: Distributed SQLite with Managed Backups by pkhuong on Wednesday July 05, 2023 @01:55PM (#36604276)
There's https://github.com/libsql/sqld , but sqlite's concurrency model doesn't always work well with long-lived transactions (and just the network hop can be slower than a local transaction), especially if you want to write.
Re:LiteFS Cloud: Distributed SQLite with Managed Backups by benbjohnson on Wednesday July 05, 2023 @02:00PM (#36604370)
LiteFS author here. LiteFS works sorta like that. It provides read replicas on all your application servers so you can use it just like vanilla SQLite for queries.

Write transactions have to occur on the primary node but that's mostly because of latency. SQLite operates in serializable isolation so it only allows one transaction at a time. If you wanted to have all nodes write then you'd need to acquire a lock on one node and then update it and then release the lock. We actually allow this on LiteFS using something called "write forwarding" but it's pretty slow so I wouldn't suggest it for regular use.

We're adding an optional a query API over HTTP [1] soon as well. It's inspired by Turso's approach. That'll let you issue one or more queries in a batch over HTTP and they'll be run in a single transaction.

[1]: https://github.com/superfly/litefs/issues/326

Re:LiteFS Cloud: Distributed SQLite with Managed Backups by efdb on Wednesday July 05, 2023 @02:20PM (#36604749)
Did you have a look at https://rqlite.io/ ?
Re:LiteFS Cloud: Distributed SQLite with Managed Backups by glommer on Wednesday July 05, 2023 @03:19PM (#36605677)
you can use https://turso.tech for that, which makes SQLite replicated, and available over HTTP. It's designed to work on environments where LiteFS won't (since it needs a volume).