flutter_realm_sync 0.0.1
flutter_realm_sync: ^0.0.1 copied to clipboard
A Flutter plugin that provides real-time bidirectional sync between Realm database and MongoDB Atlas using Socket.IO. Features automatic conflict resolution, batch operations, change tracking, and com [...]
0.0.1 #
๐ Initial Release - The Official Atlas Device Sync Replacement
โจ Core Features #
- Real-time Bidirectional Sync: Seamless synchronization between Realm database and MongoDB Atlas
- Socket.IO Integration: Reliable WebSocket-based communication for instant updates
- Offline-First Architecture: Full CRUD operations work offline with automatic sync when online
- Conflict Resolution: Automatic last-write-wins strategy with millisecond-precision timestamps
- Batch Operations: Intelligent batching and debouncing for optimal network usage
- Production-Ready Server: Complete Node.js + TypeScript server included
๐ง Technical Capabilities #
- Multi-Device Support: Real-time updates across iOS, Android, macOS, and web
- Historic Sync: Catch up on missed changes after being offline
- Persistent Sync State: Remembers sync progress across app restarts using
SyncMetadata - Smart Outbox: Persistent outbox with retry logic and exponential backoff
- Change Tracking: Detailed audit logs with
SyncDBCachefor all operations - Custom Serialization: Support for custom
toSyncMapandfromServerMapfunctions - Nested Objects: Automatic serialization of embedded objects and relationships
๐จ Developer Experience #
- Automatic Timestamp Management:
writeWithSync()andwriteWithSyncMultiple()helpers - Pre-Processors:
emitPreProcessorcallback for custom data transformation before sync - Type-Safe: Full generic support with
SyncCollectionConfig<T> - Comprehensive Validation:
SyncValidatorcatches configuration issues early - Event Streams:
changesstream for monitoring all sync events - Manual Sync Triggers:
syncObject()andsyncObjects()for explicit sync control
๐ฆ Included Models #
SyncMetadata: Tracks last remote timestamps per collectionSyncDBCache: Caches diffs for offline conflict resolutionSyncOutboxPatch: Persistent outbox for reliable sync operations
๐งช Battle-Tested #
- Comprehensive integration tests covering:
- CRUD operations (Create, Read, Update, Delete)
- Batch operations (bulk inserts, updates)
- Concurrent modifications and conflict resolution
- Multi-device synchronization
- Network interruption handling
- Historic change synchronization
- Special characters and edge cases
- MongoDB replication verification
๐ Documentation #
- Complete README with quick start guide
- Architecture diagrams and data flow visualization
- Full-featured chat example app
- Production benchmark data
- Troubleshooting guide
๐ Related Projects #
- Server: realm-sync-server
- Built with: realm_flutter_vector_db
๐ Acknowledgments #
Built as an open-source replacement for the deprecated MongoDB Atlas Device Sync. Designed for the Flutter community by developers who refused to accept vendor lock-in.