Syncular是一个开源的离线优先SQL同步系统,在客户端和服务器之间提供数据同步能力[1]。该项目在客户端维护真实的本地SQLite数据库,浏览器环境使用OPFS存储,其他环境则使用原生SQLite[1]。系统采用乐观写入模式,由服务器端的有序提交日志作为真实数据来源,以此保证数据一致性[1]。
该项目采用规范优先的开发理念,同时维护TypeScript和Rust两个核心实现[1]。项目通过实现无关的一致性测试确保两个版本的同步,当规范文档SPEC.md与代码不一致时,代码需要进行更正[1]。在测试方面,项目使用环回内存传输进行集成测试,在传输接口层进行故障注入,禁止使用延时睡眠,仅进行少量隔离的真实套接字测试[1]。项目提供bun create syncular-app和bun install等快速启动命令,便于用户快速开始使用[1]。
Syncular is an open-source system designed for offline-first SQL synchronization, maintaining true local SQLite databases on clients across different environments [1]. In browsers, the system utilizes OPFS (Origin Private File System), while other environments employ native SQLite implementations [1]. The platform ensures data consistency through an optimistic write model paired with a server-side ordered commit log that serves as the authoritative data source [1].
The project adheres to a specification-first development philosophy, with dual core implementations maintained in both TypeScript and Rust [1]. These implementations are kept in sync through implementation-agnostic consistency tests, ensuring parity across language versions [1]. The specification document (SPEC.md) takes precedence in cases of discrepancy with code implementations [1]. The testing framework follows specific principles: loopback in-memory transport is used for integration testing, failure injection occurs at the transport interface layer, sleep-based delays are prohibited, and real socket tests remain minimal and isolated [1]. Quick-start commands such as bun create syncular-app and bun install are available to users for rapid deployment [1].