Skip to main content
OnDB uses an append-only storage model. Data is never overwritten or physically removed — every change is recorded as a new entry. Optional immutability via a Data Availability layer is available for use cases requiring on-chain verification.

How It Works

Traditional DB vs OnDB

Benefits

  • Complete audit trail — All historical versions are preserved and can be queried
  • Tamper-proof history — Past states cannot be altered or deleted
  • Cryptographic verifiability — When on-chain mode is enabled, every change is recorded with a block height and transaction hash
  • Conflict-free — No race conditions on writes since each version is a distinct record

Implications

  • Storage grows with each update (each version is a new record)
  • Historical versions can be queried by timestamp if needed
  • Data is never physically removed from the blockchain
  • “Deletes” are logical — they mark records as deleted but prior versions persist

Data Retention

While the underlying storage is immutable, OnDB supports configurable retention policies per collection to manage storage costs.
The first 30 days of retention are free for all collections. Costs only apply for retention periods beyond 30 days.

Configuring Retention

From the Dashboard:
  1. Navigate to your application
  2. Select the Retention tab
  3. Expand a collection to view/edit its settings
  4. Enter the retention period in days (leave empty for permanent)
  5. Click Save to apply changes
Once data is cleaned up by the retention policy, it cannot be recovered. Ensure you have appropriate backups for critical data before setting retention limits.

Next Steps

CRUD Operations

See how append-only storage affects CRUD operations

Data Storage

Store data with payment handling