TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Marmot: Multi-writer distributed SQLite based on NATS

120 点作者 summarity超过 1 年前

10 条评论

summarity超过 1 年前
If you&#x27;re interested in this, here are some related projects that all take slightly different approaches:<p>- LiteSync directly competes with Marmot and supports DDL sync, but is closed source commercial (similar to SQLite EE): <a href="https:&#x2F;&#x2F;litesync.io" rel="nofollow noreferrer">https:&#x2F;&#x2F;litesync.io</a><p>- dqlite is Canonical&#x27;s distributed SQLite that depends on c-raft and kernel-level async I&#x2F;O: <a href="https:&#x2F;&#x2F;dqlite.io" rel="nofollow noreferrer">https:&#x2F;&#x2F;dqlite.io</a><p>- cr-sqlite is a Rust-based loadable extension that adds CRDT changeset generation and reconciliation to SQLite: <a href="https:&#x2F;&#x2F;github.com&#x2F;vlcn-io&#x2F;cr-sqlite">https:&#x2F;&#x2F;github.com&#x2F;vlcn-io&#x2F;cr-sqlite</a><p>Slightly related but not really (no multi writer, no C-level SQLite API or other restrictions):<p>- comdb2 (Bloombergs multi-homed RDBMS using SQLite as the frontend)<p>- rqlite: RDBMS with HTTP API and SQLite as the storage engine, used for replication and strong consistency (does not scale writes)<p>- litestream&#x2F;LiteFS: disaster recovery replication<p>- liteserver: active read-only replication (predecessor of LiteSync)
评论 #38603680 未加载
评论 #38609253 未加载
评论 #38603385 未加载
评论 #38602840 未加载
评论 #38605175 未加载
maxpert超过 1 年前
Author of Marmot here. Marmot was born out of my own use-case (was building replicated SQLite based cache). While working on various problems I realized how well suited it might be for read heavy sites&#x2F;workloads. If I take a typical CMS site 90% of the time it&#x27;s just reading and SQLite is perfect for that, but then how I get independently deployed nodes to replicate data. The philosophy I am sticking to so far:<p>- Sidecar! I would avoid any kind of in process library at any cost. Call me biased but I don&#x27;t trust someone&#x27;s code in my process space causing it to crash.<p>- 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.<p>- 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&#x27;t understand how incremental primary keys are bad, and how to they can keep things conflict free.<p>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.
latchkey超过 1 年前
I can totally see some junior dev who doesn&#x27;t fully grok transactions (and not reading&#x2F;understanding the &quot;What happens when there is a race condition?&quot; 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!<p>This is a neat proof of concept and I encourage experimentation. But, if you&#x27;re developing something, please just use postgres, and don&#x27;t try to cobble things together with something like this.<p>Edit: already seeing the downvotes. Yes... classic HN... anything that goes against plain old sanity is punished.
评论 #38602235 未加载
评论 #38602084 未加载
评论 #38603370 未加载
评论 #38604667 未加载
评论 #38602291 未加载
评论 #38607454 未加载
liuliu超过 1 年前
&gt; In Marmot every row is uniquely mapped to a JetStream. This guarantees that for any node to publish changes for a row it has to go through same JetStream as everyone else.<p>and<p>&gt; This means there is NO serializability guarantee of a transaction spanning multiple tables. This is a design choice, in order to avoid any sort of global locking, and performance.<p>But since the serialization happens at per row level, does this also mean no serializability guarantee of a transaction within a table too, not only spanning multiple tables?
stocknear超过 1 年前
I&#x27;m using Marmot for my own website on production. Up to this date there were no problems.<p>If I had any technical issues (i.e. questions, optimizations etc) I always asked the developer maxpert and he gave me in-depth answers that helped me personally a lot.<p>In my case I have much love for Marmot and hopefully it grows and helps a bigger community
评论 #38607465 未加载
wtatum超过 1 年前
I see a lot of projects started in this space and all of them appear to have multi-writer as a goal. I&#x27;ve been interested for a long time (and have started and stopped) in a solution for single-write multi-read with eventual consistency. I chatted with @benbjohnson on a LiteStream ticket about the possibility of adding a mobile client to receive the replicas to mobile devices but I think that option isn&#x27;t really consistent with the new direction of that work for LiteFS at Fly.<p>To me the multi-writer &quot;collaborative&quot; 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.<p>Is anybody aware of an open-source project pursuing that goal that maybe I haven&#x27;t come across?
评论 #38605952 未加载
jensneuse超过 1 年前
This is really cool. We&#x27;ve just created a POC that bridges Federated GraphQL Subscriptions and NATS, so this could maybe work together? Here&#x27;s a small video of combining Federated Subscriptions and event driven architecture through NATS: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;TheWorstFounder&#x2F;status&#x2F;1734134926113378393" rel="nofollow noreferrer">https:&#x2F;&#x2F;twitter.com&#x2F;TheWorstFounder&#x2F;status&#x2F;17341349261133783...</a>?
评论 #38613848 未加载
simonw超过 1 年前
Something that wasn&#x27;t clear to me from the README: how does this handle duplicate IDs?<p>If I have a table with a string primary key and I insert a row in one node with ID &quot;hello&quot; and do the same thing (but with different column data) on another node, what happens?
评论 #38601705 未加载
评论 #38604737 未加载
评论 #38601953 未加载
Mortiffer超过 1 年前
I wonder if this kind of a setup would be useful for federated protocols. Mastodon and Farcaster both maintain websocket connections open from all servers to all servers.
sigmonsays超过 1 年前
i&#x27;m surprised by this.. No schema changes?<p>Nobody pushes an application out just once.
评论 #38608786 未加载