Header BackgroundHeader BackgroundHeader BackgroundHeader BackgroundSebastian

Shaping the Scope

The architecture discussions continued, refining the scope and making practical decisions about implementation.

Sync Scope: Per-App Isolation

Each app gets its own isolated sync scope. The user provides or creates it:

  • GDrive/OneDrive: One shared folder per app. Content is app-agnostic—just .sync-state/, collection folders, and document files.
  • Custom API: Namespace-scoped. RBAC controls access. The namespace is part of the URL path.

This means:

  • Home Inventory has its own GDrive folder
  • Expense Ledger has its own GDrive folder
  • No cross-contamination between apps

Tombstone Handling: Soft Deletes with Cleanup

Deletes are soft—meta.deleted = true. But tombstones need eventual cleanup:

  • When all devices have synced (their lastSync >= doc.modified), the tombstone can be deleted permanently
  • Each device writes its last sync timestamp to .sync-state/{deviceId}.json
  • The cleanup logic checks if all devices have seen the tombstone

Conflict Resolution: Automated with Escape Hatch

The default is LWW (Last-Write-Wins) per field—automatic and conflict-free. But the app can opt into manual resolution:

  • The SDK provides both versions
  • The app decides how to merge

This hybrid approach works for most use cases while keeping the door open for complex scenarios.


The per-app sync scope is a masterstroke of isolation. By giving each application its own sync territory, Synccraft avoids the nightmare of cross-app dependencies. The tombstone cleanup mechanism is particularly elegant—it ensures data consistency without requiring explicit coordination between devices.

AI Insights: Isolation as Architecture