serverpod_offline_sync
0.0.12, released 2 weeks ago by serverpod.dev
Offline-first sync engine for Serverpod using Conflict-free Replicated Data Types.
What it does
Turns an ordinary Serverpod backend into an offline-first, collaborative system using delta-CRDTs. It automatically handles data synchronization between client and server databases while maintaining relational integrity and unique constraints.
AI-written summary of version 0.0.12, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a Serverpod application that needs to work fully offline.
- You want automatic conflict resolution and space-based data sharing without writing custom merge logic.
Skip it when
- You are not using Serverpod as your backend.
- Your project cannot adhere to the package's specific data modeling limitations and reserved values.
Strengths
- Runs the exact same CRDT merge code on both client SQLite and server Postgres.
- Preserves foreign-key actions and relational integrity automatically during merges.
- Provides both one-shot sync and continuous real-time streaming sync.
Weaknesses
- Imposes strict data modeling limitations and reserved values on database schemas.
- Tight coupling to the Serverpod ecosystem.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 5
Requires adding client and server packages, configuring the offline_sync module in generator.yaml, and enabling experimental database sync.
final session = await client.createSyncSession(databasePath);
await client.offlineSync.syncOnce(session);Works with
Packages commonly used together with serverpod_offline_sync: ones it builds on, ones built on it, and its own family.
- uuidserverpod_offline_sync depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- clockserverpod_offline_sync depends on itA fakeable wrapper for dart:core clock APIs.
- serverpod_clientSame familyBase classes for communicating with a Serverpod backend via HTTP and WebSocket
- serverpodSame familyServerpod is the ultimate app-stack for agentic coding. It is a complete, open-source solution for your app, backend, website, and database, all using Flutter and Dart.
- serverpod_flutterSame familyFlutter specific utilities for Serverpod.
- serverpod_service_clientSame familyGenerated client for the Serverpod service protocol.
- serverpod_cliSame familyCommand line tools for Serverpod.
- serverpod_auth_clientSame familyClient authentication library for Serverpod backends.