You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is Corrosion a solution to replicate SQLite across multiple application servers with eventual consistency?
I notice LiteFS is marketed a way to have an application-level SQLite with single-writer with multiple read-replicas.
I am wondering if Corrosion could fit a similar role, however, with multiple write-replicas that converge on eventual consistency. Similar to this sqlite marmot project.
Or... whether I am misunderstanding Corrosion, assuming that it shouldn't be used for application data, and maybe meant more as a consul-alternative only.
EDIT: I suppose the one piece that Corrosion is missing to meet this use-case is the ability to communicate with a SQLite driver through a VFS or similar, like LiteFS does.
The text was updated successfully, but these errors were encountered:
Corrosion exposes a replicated, multi-writer, SQLite.
That said, it only works if your data fits. There are significant constraints:
No unique indexes allowed (except for the default primary key unique index that does not need to be created)
The primary key must be non nullable
Non-nullable columns require a default value
Every write needs to go through Corrosion, but reads can SQLite, from disk, normally. Corrosion is most suitable for read-heavy workloads where read performance matters a lot.
I haven't used Marmot, but looking at its internals doc, I see these differences / similarities:
Marmot adds TRIGGERs to capture changes to tables. Corrosion as well (via cr-sqlite)
Marmot watches for changes (either periodically or by some other mechanism looking at the WAL?). Corrosion intercepts changes at write time and propagates them immediately
Marmot uses NATS JetStream which has strong delivery guarantees via Raft. Corrosion uses various heuristics to fanout changes semi-randomly between nodes and periodically, constantly, synchronize between random nodes to make sure changes are not missed
Corrosion uses CRDTs to ensure strong, eventual, consistency. Marmot relies on JetStream's Raft and deterministic ordering to resolve race conditions and conflicts.
I don't think either is at an advantage or disadvantage, but does it seem easier to not have to write to Corrosion and simpler write to SQLite like you would normally do.
Is Corrosion a solution to replicate SQLite across multiple application servers with eventual consistency?
I notice LiteFS is marketed a way to have an application-level SQLite with single-writer with multiple read-replicas.
I am wondering if Corrosion could fit a similar role, however, with multiple write-replicas that converge on eventual consistency. Similar to this sqlite marmot project.
Or... whether I am misunderstanding Corrosion, assuming that it shouldn't be used for application data, and maybe meant more as a consul-alternative only.
EDIT: I suppose the one piece that Corrosion is missing to meet this use-case is the ability to communicate with a SQLite driver through a VFS or similar, like LiteFS does.
The text was updated successfully, but these errors were encountered: