Written by: on Thu May 14

MeridianDB: Local-First Sync Engine

Real-time data synchronization on your own PostgreSQL. Works offline, syncs instantly, resolves conflicts automatically. 2-3x faster than alternatives.

Go to project
MeridianDB Sync Engine

About the Project

Today, one of the standard expectations of modern web and mobile applications is “real-time” and “offline-first” capabilities. When using applications like Notion, Figma, or Linear, you can continue working smoothly even when your internet connection drops. Once the connection is restored, the changes you made are instantly and losslessly synchronized with all other users.

When developers want to build this kind of infrastructure, they usually face a tough dilemma: Either hand over control of their data (data sovereignty) by using a managed cloud (SaaS) service like Firebase, Supabase, or Convex; or build complex layers like WebSockets, offline transaction queues, reconnection strategies, and—the hardest of all—conflict resolution from scratch.

MeridianDB is an open-source Sync Engine that combines the best of both worlds. It runs on top of your own PostgreSQL database. It gives you the flawless developer experience (DX) of Firebase while ensuring 100% of your data stays on your own servers and under your control.

Core Features and Algorithm

  • Flawless Instant Synchronization: The moment you change a form field in your app, that data is automatically sent to the server in the background and reflected to all other users viewing that document within milliseconds via WebSockets/WebRTC. Developers do not need to manually handle data fetching (refetch) or WebSocket listening.
  • Uninterrupted Offline Experience (Offline-First): Your app doesn’t freeze when the internet connection drops. All read and write operations continue seamlessly in the device’s local memory (IndexedDB / SQLite). Once the connection is re-established, the accumulated packets of changes on the device are transmitted to the server sequentially and in bulk.
  • Field-Level Conflict Resolution (Field-Level CRDT): At the heart of MeridianDB lies an advanced Conflict-Free Replicated Data Type (CRDT) engine. If two different users update the exact same database row simultaneously while completely offline (e.g., one changes the “title” field and the other changes the “content”), there is no data override when they reconnect. Meridian mathematically merges the changes at the field level, definitively preventing data loss.
  • End-to-End Encryption (E2EE): Sensitive data transferred between clients and stored in the database is encrypted on the device (in the browser) using AES-256-GCM. The server only facilitates the transfer and storage of encrypted packets (blobs) and can never read the content.
  • Platform-Agnostic Client SDKs: It offers optimized, type-safe SDKs for modern web frameworks like React, Vue, and Svelte, as well as mobile platforms like React Native and Flutter.

How Does It Differ from Competitors?

Other synchronization solutions on the market (such as Yjs, Automerge) typically focus on document-based data structures and transport large JSON objects, which eventually leads to performance bottlenecks. MeridianDB, however, embraces the Relational Model.

It is optimized to run 2 to 3 times faster than its competitors. MeridianDB’s core CRDT engine and mathematical vector clocks are written entirely in Rust and compiled to WebAssembly (WASM) to run in the browser. This minimizes CPU load on the client side, achieving native speeds. Furthermore, thanks to its Transport-Agnostic architecture, it can communicate over MQTT, TCP, or Redis Pub/Sub in addition to the default WebSocket communication.

Who Should Use It?

  • Collaborative Application Developers: Teams building tools (similar to Google Docs, Figma, Trello) where users work simultaneously on the same document, project, or board.
  • Offline App Developers: Mobile applications developed for field tasks with poor network coverage, inventory counting, or underground operations.
  • Entities with Data Security and Regulatory Constraints: Companies producing software for the healthcare (HIPAA), finance, or government sectors where legally they cannot store user data in third-party SaaS databases.
  • Developers Seeking Modern DX: Full-Stack developers who want to migrate away from Firebase or Supabase Realtime infrastructure without giving up the convenience they offer.

Technological Infrastructure and Licensing

The project is entirely shaped using TypeScript, but all speed-critical algorithms are supercharged with Rust and WebAssembly. Its architecture consists of 12 different monorepo npm packages and is tested with over 70 end-to-end (E2E) tests. On the PostgreSQL side, it ensures data integrity by utilizing the JSONB column structure. It is published under the MIT Open Source license.

GitHub Repository: github.com/vahapogut/MeridianDB

Live Demo and Documentation: meridiandb-demo.vercel.app

Subscribe to our newsletter!