How Sync Works
The problem
When you edit the same note on two devices while offline, both devices have divergent versions. Traditional sync systems either pick one version (“last write wins”, losing the other edits) or ask you to manually resolve the conflict.
NoteCove avoids both problems.
CRDTs: conflict-free merging
NoteCove uses CRDTs (Conflict-free Replicated Data Types), specifically the Yjs library, to represent note content. A CRDT is a data structure with a mathematical property: any two copies can be merged together, in any order, and the result is always the same.
This means:
- All edits are preserved: if you type “hello” on one device and “world” on another, you get both
- No conflict dialogs: there is never a “which version do you want?” prompt
- Order does not matter: devices can sync in any sequence and converge to the same state
- Offline is safe: edits made while disconnected merge cleanly when you reconnect
File-based sync
NoteCove does not use a custom sync server. Instead, it writes CRDT update files to a folder on disk:
- You edit a note on Device A
- NoteCove writes a CRDT update file to the storage directory
- Your cloud provider (Dropbox, Google Drive, iCloud) syncs the file to its servers
- Device B’s cloud app downloads the file
- NoteCove on Device B detects the new file and merges the updates into its local database
This approach means:
- No proprietary server: you use cloud storage you already own
- No internet requirement for NoteCove itself: the app only needs the sync folder to be accessible
- Standard file operations: backup, move, or inspect sync data with normal file tools
What gets synced
Each item (note, task, folder, project) has its own CRDT document stored as update files in the storage directory:
{SD_ROOT}/
├── SD_ID # Identifier for this storage directory
├── SD_VERSION # Format version
├── profiles/
│ └── {profileId}.json # Profile presence announcement
├── notes/
│ └── {first}/{second}/{noteId}/ # Two-level sharding by first two chars of ID
│ ├── logs/
│ │ └── {profileId}.{instanceId}.{timestamp}.crdtlog
│ ├── snapshots/
│ │ └── {profileId}.{instanceId}.{timestamp}.snapshot.zst
│ └── attachments/
│ ├── {attachmentId}.meta.json
│ └── {attachmentId}.{ext}
├── tasks/
│ └── {first}/{second}/{taskId}/ # Same sharding as notes
│ ├── logs/
│ ├── snapshots/
│ └── attachments/
├── folders/ # Singleton CRDT doc per SD
│ ├── logs/
│ └── snapshots/
├── projects/ # Singleton CRDT doc per SD
│ ├── logs/
│ └── snapshots/
├── activity/
│ └── {profileId}.{instanceId}.{timestamp}.log
└── deleted/
└── {profileId}.{instanceId}.{timestamp}.log
Each .crdtlog file contains CRDT update records — compact binary encodings of changes to that item. Snapshots (.snapshot.zst) are compressed checkpoints that reduce replay time.
Multi-device sync
Adding a second device is straightforward: install NoteCove, install the same cloud storage app, and point NoteCove at the same sync folder. NoteCove detects the existing sync data and imports everything.
Changes propagate through the cloud folder. The speed depends on your cloud provider — local network sync can be near-instant, while internet sync depends on upload/download times.
Comments and reactions
Comments and reactions are CRDT documents too. They sync the same way as note content — multiple people can comment on the same note simultaneously and everything merges cleanly.
When things go wrong
Because CRDTs guarantee convergence, true conflicts are impossible. But the sync mechanism can still have issues:
- Cloud folder offline: changes queue locally and sync when the folder is available
- File eviction: cloud providers may remove local copies of files to save space — see Keep data available offline
- Corrupted update files: NoteCove can rebuild a note from its CRDT logs (Tools → Advanced → Reload Note From CRDT Logs)