{"name":"Marmot: Distributed SQLite Replication with NATS","description":"Marmot is a distributed SQLite replicator that provides leaderless, eventually consistent replication built on NATS JetStream. It enables scaling read-heavy SQLite applications by allowing multiple nodes to read and write to their local databases. This innovative approach offers fault tolerance and simplifies scaling without requiring a single primary node.","github":"https://github.com/maxpert/marmot","url":"https://osrepos.com/repo/maxpert-marmot","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/maxpert-marmot","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/maxpert-marmot.md","json":"https://osrepos.com/repo/maxpert-marmot.json","topics":["Go","Database","Distributed Systems","SQLite","Replication","NATS","Open Source"],"keywords":["Go","Database","Distributed Systems","SQLite","Replication","NATS","Open Source"],"stars":null,"summary":"Marmot is a distributed SQLite replicator that provides leaderless, eventually consistent replication built on NATS JetStream. It enables scaling read-heavy SQLite applications by allowing multiple nodes to read and write to their local databases. This innovative approach offers fault tolerance and simplifies scaling without requiring a single primary node.","content":"## Introduction\nMarmot is an open-source, distributed SQLite replicator written in Go, designed to bring robust, leaderless, and eventually consistent replication to your SQLite databases. Built on top of the fault-tolerant NATS JetStream, Marmot allows you to easily scale out read-heavy applications that rely on SQLite, making this ubiquitous database even more powerful for server-side use cases. It acts as a side-car to your existing processes, capturing changes via triggers and streaming them across your cluster.\n\n## Installation\nGetting started with Marmot is straightforward. You can download the latest release directly from the GitHub repository.\n\nFirst, download and extract the package:\nbash\ntar vxzf marmot-v*.tar.gz\n\n\n## Examples\nTo see Marmot in action, navigate to the extracted directory and run the provided example cluster script:\nbash\n./examples/run-cluster.sh\n\nYou can then make changes to one database, for instance `/tmp/marmot-1.db`:\nbash\nsqlite3 /tmp/marmot-1.db\nINSERT INTO Books (title, author, publication_year) VALUES ('Pride and Prejudice', 'Jane Austen', 1813);\n\nObserve these changes propagating to another database, like `/tmp/marmot-2.db`:\nbash\nsqlite3 /tmp/marmot-2.db\nSELECT * FROM Books;\n\nMarmot supports bidirectional replication, allowing you to make changes interchangeably and see them propagate across nodes. For more advanced use cases and demos, explore the \"Out in wild\" section on the official documentation, including examples like [2-node HA for edge Kubernetes](https://www.youtube.com/watch?v=HycGtLjlikI){:target=\"_blank\"} and [Scaling PocketBase with Marmot on Fly.io](https://www.youtube.com/watch?v=QqZl61bJ9BA){:target=\"_blank\"}.\n\n## Why use Marmot?\nMarmot differentiates itself from other SQLite replication solutions like rqlite, dqlite, and LiteFS through its unique design philosophy:\n\n*   **Leaderless Replication:** Unlike solutions requiring a single primary node for all writes, Marmot operates without a primary. Any node can make changes to its local database, and Marmot captures these changes using triggers, streaming them to NATS.\n*   **Eventually Consistent:** Marmot prioritizes availability and performance by being eventually consistent. This means no global locking or blocking of nodes, allowing for high throughput. While transactions spanning multiple tables might not have serializability guarantees, the \"last writer wins\" principle applies to individual row changes.\n*   **Seamless Integration:** It requires no changes to your existing SQLite application logic for reading or writing. You interact with your SQLite database as you normally would.\n*   **Fault-Tolerant:** Built on NATS JetStream, Marmot leverages NATS's inherent fault tolerance for reliable message streaming and replication.\n*   **Comprehensive Snapshot & Recovery:** Marmot offers robust snapshot and recovery capabilities with support for various storage options, including NATS Blob Storage, WebDAV, SFTP, and S3-compatible services like AWS S3, Minio, and Blackblaze.\n\nWhile Marmot offers significant advantages, it's important to note some current limitations: schema changes are not automatically propagated, selective table watching is not supported, and WAL mode is required for reliable multi-process changes.\n\n## Links\n*   **GitHub Repository:** [https://github.com/maxpert/marmot](https://github.com/maxpert/marmot){:target=\"_blank\"}\n*   **Official Documentation:** [https://maxpert.github.io/marmot/](https://maxpert.github.io/marmot/){:target=\"_blank\"}\n*   **Discord Community:** [https://discord.gg/AWUwY66XsE](https://discord.gg/AWUwY66XsE){:target=\"_blank\"}\n*   **Latest Releases:** [https://github.com/maxpert/marmot/releases/latest](https://github.com/maxpert/marmot/releases/latest){:target=\"_blank\"}","metrics":{"detailViews":5,"githubClicks":5},"dates":{"published":null,"modified":"2025-10-20T15:01:01.000Z"}}