Storage and transaction in mvSQLite, the distributed SQLite on FoundationDB
univalence.me
univalence.me
One of the many things that SQLite brings is the ability to treat arbitrary storage as a relational database that can be queried (and mutated) with SQL.
Both of these things are generally rare in open source databases. There are very few multi-master distributed databases that have ACID transactions, and even fewer of them have SQL support. So marrying these two technologies is extremely compelling; you get the power of SQLite's relational data layer with the power of FoundationDB's distributed transactions. This is really high tech stuff for free!
A different implementation of similar semantics is rqlite. rqlite uses the Raft consensus protocol to replicate the text of your database writes to each node, which commits it to a local on-disk sqlite database. I haven't actually looked at mvSQLite enough to know how different the approach is, but both should be on everyone's list to take a look at and poke at. (For most "work" you'll be doing, it's probably completely fine to not create a distributed system like these; run in one datacenter, run a monolithic RDBMS, and tell users you're down when a tornado flattens the server racks. Do keep some offsite backups either way, though. Your application code will always have bugs, and these databases will happily replicate an accidental delete to 5 data centers at the speed of light.)
In this case, the write contention performance would not be much better than using SQLite over SMB.
After reading more about the design it seem to use FDB to store Pages and using FDB transaction to make those update have have Strict serializable isolation.
This would work correctly but it seem that mvSQLite also try to do its own MVCC logic instead of simply using FDB transactions.
It is well known that implementing Serializable transaction on top of MVCC is not trivial. There was a bug in Postgresql from version 9.1 to version 12.3 making it not truly Serializable.
And SQLite has a unique advantage when implemented on top of decoupled storage and compute. Decoupled MySQL and PostgreSQL can't really linearly scale from zero in a serverless use case: you need to spin up a compute instance when you want to do queries. This isn't necessary with mvSQLite, because the embedded SQLite library can just connect directly to the multi-tenant storage engine (mvstore).
This is also something missing from self hosted, open source, SQL rdbms.
As far as I'm aware, this is the closest thing to Aurora and AlloyDB that I can run myself.
Also, by leveraging FoundationDBs ability to have multi-writer deployments, it gives us the potential to scale writes far beyond what Aurora and AlloyDB can handle. I'd love to see an extreme benchmark comparing a single 24xlarge Aurora writer vs a few dozen nodes in FoundationDB. The Aurora writer is likely more efficient per CPU but ultimately can't scale past 96 cpus.
Three data hall is R.F == 3
Three datacenter is R.F == 6
You can configure it higher manually as well, we have a few test clusters we configured to 9 and it seemed to work fine.
All known correctness bugs are fixed (except experimental features) - this is just a reminder that you need more than one layers of defense for something that stores your critical data.
Otherwise it is a pretty meaningless thing to say. Not even formally verified software is definitely bug free.
It is another distributed SQLite database solution, with emphasis on making an offline-first focus.