HeadlinesBriefing favicon HeadlinesBriefing.com

syncular/syncular: Offline-first SQL sync

Hacker News •
×

syncular/syncular is a server‑authoritative, offline‑first SQL synchronization library. Clients maintain a local SQLite database—OPFS in the browser or native SQLite elsewhere—while writes travel through an optimistic outbox to an ordered commit log that remains the single source of truth on the server.

The design follows a spec‑first approach: SPEC.md is normative and golden fixtures in spec/vectors enforce consistency, and any divergence forces code changes. Two implementations—TypeScript and Rust—are kept in lockstep by an implementation‑agnostic conformance suite. Integration tests use an in‑memory loopback transport, fault injection at the transport layer, and explicit readiness signals, banning sleeps.

The repository is organized into packages covering protocol codecs, server handlers, client libraries, crypto primitives, CRDT mergers, and a testing kit that runs both cores through a scenario runner. A single good path lets the browser persist via OPFS and sync over WebSockets, while the CLI provides install, run, and check commands for type‑checking, linting, and testing.

Contributing follows strict doctrine—no fallbacks, no timers in tests, cross‑core parity for humans and machines—and AI assistance is welcomed for tests, benchmarks, and documentation, provided every line is reviewed. Low‑effort automated PRs are closed without comment, and the full policy lives at syncular.dev/llms.