data/sync-schema-design

sync schema design Shipped

What this lens looks for

The worker evaluates whether the database schema supports offline-first sync by using UUID primary keys for offline creation, implementing soft deletes or tombstone patterns, tracking dirty records, versioning synced tables for optimistic concurrency, and maintaining sync metadata tables.

What its verifier checks

  • UUID PKs on all synced tables (not auto-incremented server IDs)
  • Soft delete strategy chosen and documented (flag column vs tombstone table)
  • Dirty tracking mechanism specified (dirty flag, change log, or operation queue)
  • Version column present on all synced tables for optimistic concurrency
  • Sync metadata tables defined (last_synced_at per table, change cursors, device state)