I can totally see some junior dev who doesn't fully grok transactions (and not reading/understanding the "What happens when there is a race condition?" section), trying to deploy something like this and scratching their head why it falls over completely in production. The site worked fine when it was just me testing it! This is a neat proof of concept and I encourage experimentation. But, if you're developing somethi…
Marmot: Multi-writer distributed SQLite based on NATS
21–30 of 50 posts
Re: Marmot: Multi-writer distributed SQLite based on NATS
#22If you're interested in this, here are some related projects that all take slightly different approaches: - LiteSync directly competes with Marmot and supports DDL sync, but is closed source commercial (similar to SQLite EE): https://litesync.io - dqlite is Canonical's distributed SQLite that depends on c-raft and kernel-level async I/O: https://dqlite.io - cr-sqlite is a Rust-based loadable extension that adds CRDT…
https://medium.com/chiselstrike/introducing-embedded-replica...
Re: Marmot: Multi-writer distributed SQLite based on NATS
#23I can totally see some junior dev who doesn't fully grok transactions (and not reading/understanding the "What happens when there is a race condition?" section), trying to deploy something like this and scratching their head why it falls over completely in production. The site worked fine when it was just me testing it! This is a neat proof of concept and I encourage experimentation. But, if you're developing somethi…
If you let juniors design and deploy a DB layer to prod it's your fault not the DBs. Transaction isolation is generally complicated topic that a lot of senior devs have a pretty tenuous grasp on ime and distributed Postgres solutions don't solve this particularly well either last I checked
Some companies only have juniors. 28 years ago, I was the junior at my company, and the first/only engineer.
Let's also be real here, most applications don't need distributed Postgres either and those that do, will have senior engineers on staff.
Re: Marmot: Multi-writer distributed SQLite based on NATS
#24If you're interested in this, here are some related projects that all take slightly different approaches: - LiteSync directly competes with Marmot and supports DDL sync, but is closed source commercial (similar to SQLite EE): https://litesync.io - dqlite is Canonical's distributed SQLite that depends on c-raft and kernel-level async I/O: https://dqlite.io - cr-sqlite is a Rust-based loadable extension that adds CRDT…
https://use.expensify.com/blog/scaling-sqlite-to-4m-qps-on-a...
Re: Marmot: Multi-writer distributed SQLite based on NATS
#25- Sidecar! I would avoid any kind of in process library at any cost. Call me biased but I don't trust someone's code in my process space causing it to crash.
- No master - each node should be able to make progress on its own, if these processes go down your own process will keep functioning. They will converge once everything is back.
- Easy to start, yet hard to master - You can get up and running pretty quickly, but make no mistake this tool is not for rookie who doesn't understand how incremental primary keys are bad, and how to they can keep things conflict free.
I am far from getting everything I need in there, and again my philosophy might evolve over time as well. Talking to people on Discord has helped me think through use-cases a lot, so keep the good feedback coming. Would love to answer any questions people might have here.
Re: Marmot: Multi-writer distributed SQLite based on NATS
#26I can totally see some junior dev who doesn't fully grok transactions (and not reading/understanding the "What happens when there is a race condition?" section), trying to deploy something like this and scratching their head why it falls over completely in production. The site worked fine when it was just me testing it! This is a neat proof of concept and I encourage experimentation. But, if you're developing somethi…
Re: Marmot: Multi-writer distributed SQLite based on NATS
#27Something that wasn't clear to me from the README: how does this handle duplicate IDs? If I have a table with a string primary key and I insert a row in one node with ID "hello" and do the same thing (but with different column data) on another node, what happens?
Re: Marmot: Multi-writer distributed SQLite based on NATS
#28Re: Marmot: Multi-writer distributed SQLite based on NATS
#29To me the multi-writer "collaborative" use case is super powerful but also has a lot of challenges. I personally would see a lot of value in a solution for eventually consistent read-replicas that are available for end-client (WASM or mobile native) replication but still funnel updates through traditional APIs with store-and-forward for the offline case.
Is anybody aware of an open-source project pursuing that goal that maybe I haven't come across?
Re: Marmot: Multi-writer distributed SQLite based on NATS
#30Earlier quoted context omitted.
In what context would you use a single string as the ID that would be subject to collisions (instead of including a user id as part of the ID)?
People do all sorts of weird things with databases, and if you want to run existing software against a database (as opposed to greenfield development deliberately targeting Marmot) you need to understand what will happen in different cases.
A great point, but from the readme in the Marmot repo:
> It does not require any changes to your existing SQLite application logic for reading/writing.
I suspect you’re probably still right, but that’s not what the author claims.