Day 9: Your Data Is Yours

backup restore durability local-first

Local-first doesn't mean much if you can lose everything when your browser clears its storage. Today we built workspace backup and restoreβ€”the safety net that makes "your data is yours" a real promise, not just a slogan.

Why Durability Matters

IndexedDB is powerful, but it's not permanent. Browsers can clear storage. Users switch devices. Computers crash. If we can't give users a way to protect their data, we haven't actually given them ownershipβ€”we've given them an illusion.

Durability is the foundation everything else builds on:

  • Before sync β€” You can't sync what you can't back up
  • Before imports β€” External data needs a safe place to land
  • Before collaboration β€” Shared workspaces need recovery paths
  • Before everything β€” Trust requires a safety net

What We Built

Full workspace export and import with these properties:

Complete Backup

Every primitive is included: workspace, accounts, transactions, categories, views, rules, audit logs, rule suggestions, and shared view definitions. Nothing left behind.

Human-Readable Format

Plain JSON that you can read, inspect, and understand. No binary blobs. No proprietary formats. Your data in a format that will outlive our software.

Versioned Schema

Every backup includes an exportVersion number. Future versions of the app will know how to read old backups and migrate them.

Fully Local

Export and import happen entirely on your device. No cloud storage. No accounts. No network requests. The file goes where you put it.

Backup vs. Share Links

Yesterday we built share links. Today we built backups. They solve different problems:

Share Links

  • Scoped, filtered data
  • Read-only view for others
  • Anonymization options
  • Revocable and time-limited

Backups

  • Complete workspace data
  • Full restore capability
  • No anonymization
  • Permanent file you control

Share links are for collaboration. Backups are for preservation. Both are essential, but they serve different masters.

What's In The Backup

A complete workspace backup includes:

{
  exportVersion: 1,
  exportedAt: 1703462400000,
  generator: "Accelerate Finance v1.0",

  workspace: { ... },       // Name, currency, metadata
  accounts: [ ... ],        // All accounts
  transactions: [ ... ],    // All transactions
  categories: [ ... ],      // All categories
  views: [ ... ],           // All views
  rules: [ ... ],           // All rules
  ruleAuditLog: [ ... ],    // Complete audit history
  ruleSuggestions: [ ... ], // Pending rule suggestions
  sharedViews: [ ... ],     // Share definitions (NOT payloads)

  stats: {              // Preview information
    accountCount: 5,
    transactionCount: 1247,
    ...
  }
}

What's NOT In The Backup

Some things are deliberately excluded:

  • Share payloads β€” These are derived artifacts, not source data
  • Cached balances β€” Account balances are derived from transactions
  • Runtime state β€” UI state, temporary data, caches

The backup contains source of truth data only. Everything else can be recomputed.

Restore Creates New

When you restore a backup, it creates a new workspace. Your existing data is never modified or overwritten. This is intentional:

  • Safe experimentation β€” Restore doesn't destroy what you have
  • Side-by-side comparison β€” Compare old and current data
  • No accidental loss β€” Restoring can't make things worse

Version Compatibility

Every backup includes version information. On import, we check:

βœ“ Version supported β†’ Proceed with import

! Old version β†’ Migrate and import

βœ— Future version β†’ Reject with clear message

We will never silently fail on incompatible versions. Either the import works correctly, or it fails clearly.

The User Experience

Backup and restore are explicit user actions, not background magic:

// Export flow:
1. Go to Settings
2. Click "Export Backup"
3. File downloads: workspace-name-2024-12-25.json
4. Store it wherever you want

// Import flow:
1. Go to "Restore from Backup"
2. Select your backup file
3. Preview what will be restored (counts, date range)
4. Confirm restore
5. New workspace created with all data

Why This Matters Long-Term

This feature is about more than convenience. It's about trust:

  • Portability β€” Move your data anywhere. We don't trap you.
  • Independence β€” If we disappear, your data doesn't.
  • Control β€” You decide when, where, and how to protect your data.
  • Peace of mind β€” Knowing you can always recover.

What's Next

With durability in place, we can build more confidently:

  • Transaction imports from banks and other sources
  • Cross-device sync (when users want it)
  • Collaborative workspaces
  • More complex financial modeling

All of these features can be built on top of a system where users can always get their data out.

"Your data is yours" is a promise that's easy to make and hard to keep. Backup and restore is how we keep it. When you can export everything at any time, ownership is real.

This isn't a feature we're adding because someone asked for it. It's a feature we're adding because it's right.

β€” The Accelerate Finance Team