Compare

ThimbleDB and Cloudflare D1

Cloudflare D1 is a managed serverless SQL database with SQLite semantics, Worker bindings, Time Travel recovery, and optional read replication. ThimbleDB is an object-storage protocol with encrypted browser caching and an application-owned authority.

Neither option is a general replacement for the other.

Choose D1 when

  • The application needs SQL, indexes, joins, or relational constraints.
  • Multiple rows must change atomically.
  • Managed point-in-time recovery is important.
  • The data model changes through schema migrations.
  • Queries are more important than browser-held encrypted objects.
  • A Cloudflare-managed database service is acceptable.

D1 is designed to scale horizontally across many smaller databases. Each individual database processes queries one at a time.

Choose ThimbleDB when

  • Data is naturally stored as bounded JSON documents.
  • Records have simple user, tenant, role, or public ownership.
  • Reads are by ID, declared indexes, or bounded collection scan.
  • The active working set benefits from encrypted browser cache.
  • R2 or another object store should remain the durable source of truth.
  • The application accepts connected writes through its authority.

Capability comparison

CapabilityThimbleDBCloudflare D1
Durable modelEncrypted objects in object storageManaged SQLite-compatible database
Query modelID reads, declared indexes, and bounded scansSQL with indexes and supported SQLite features
TransactionsConditional collection-head updatesSQL transactions and batched statements
Browser cacheBuilt-in encrypted memory and IndexedDB tiersApplication-defined
Offline readsPreviously cached objectsApplication-defined client caching
Offline writesNot supportedApplication-defined; D1 writes require Worker access
RecoveryRetained deletion and provider backup strategyTime Travel and database restore
IdentityExternal OIDC through the application authorityApplication-defined
Provider portabilityR2, S3, Azure Blob, local filesCloudflare D1
Best fitBounded read-heavy document workloadsRelational and query-driven Worker applications

They can be used together

An application can use D1 for relational operational data and ThimbleDB for encrypted, cacheable, user-scoped reference collections. This adds operational complexity, so use both only when the data models are clearly different.

Sources

This page is built from the repository source.

View or improve this page on GitHub