const db = await createThimbleClient();
const notes = db.collection(noteDefinition);One factory configures authority URLs, scope keys, memory cache, encrypted IndexedDB, and layout checks.
Cloudflare-first. Open source. Application-owned.
ThimbleDB keeps encrypted application data in object storage and a fast browser cache. It gives focused web apps a durable data layer without operating a separate database engine.
npx thimbledb@latest create my-app
For experienced developers
The protocol, threat model, deletion semantics, benchmarks, and provider contracts are documented with their limitations.
Review the architecture →For AI-assisted builders
Use the workload checklist, guided examples, and implementation prompts before asking a coding tool to wire the database.
Run the fit guide →ThimbleDB Studio
Browse declared collections, run bounded queries, inspect plans and indexes, and use guarded maintenance tools through the same OIDC session and explicit scope grants as the application.

Small integration surface
The authority owns credentials, identity, keys, and conditional writes. Application code works with documents and collections.
const db = await createThimbleClient();
const notes = db.collection(noteDefinition);One factory configures authority URLs, scope keys, memory cache, encrypted IndexedDB, and layout checks.
const result = await notes
.where((note) => note.title.eq("First note"))
.orderBy((note) => note.lastModified.desc())
.take(25)
.select(["title", "lastModified"], noteCardSchema)
.get();Declared indexes narrow candidates. Explicit covering fields can satisfy a typed projection without loading complete documents.
Know the fit
ThimbleDB serves a deliberate workload. The limits are part of the product, not fine print.
How it works
The browser gets speed. The authority keeps control. Object storage provides durable encrypted bytes.
Memory and encrypted IndexedDB keep the active working set close to the user.
External identity, scope checks, key grants, validation, writes, deletion, and administration stay server-side.
Canonical JSON becomes compressed AES-GCM envelopes stored in R2, S3, Azure Blob, or local files.
Two deployment styles
The browser API and stored data stay the same. The choice controls secret isolation, release ownership, failure containment, and which traffic can scale independently.
Lowest operating overhead. Application and authority share secrets, releases, failures, logs, limits, and scaling.
Separate secrets, releases, limits, logs, failures, regions, and scaling. Adds routing and another service to operate.
Start from evidence
Install ThimbleDB, choose an authority, connect external identity, and create the browser client.
Start hereScaffold a local app, use the safe development identity, and move to production OIDC.
Start hereReview authority options, environment variables, provider settings, defaults, and deployment-template coverage.
Start hereCheck whether a small web application fits ThimbleDB before choosing a storage model.
Start hereUse an exact fit check to decide whether a vibe-coded or AI-assisted small app matches ThimbleDB.
Start hereReview verified behaviour, open questions, introduced costs, and workloads that need another database.
Start hereUse maintained Node and Cloudflare repository templates or run the checked-in package examples.
CompareCompare ThimbleDB with D1, SQLite, Firestore, lowdb, and direct object storage by workload.
Published cloud evidence
Across 3,808measured operations in 7 regions, snapshots had the lowest pooled cold point-read p95 at every tested size. Covering indexes stayed bounded, while broad trie scans and simultaneous global writes exposed clear limits.
Cold reads and large writes remain too slow for latency-sensitive request paths. Production fit depends on warm browser cache hits dominating. Tables, graphs, failures, JSON, and CSV are published.
Read the benchmark and limitations →Direct answers
ThimbleDB is an encrypted, browser first database for small web applications. Object storage is the durable source of truth. An application owned authority handles identity, access checks, key grants, writes, deletion, and administration. Browsers keep a fast encrypted cache in memory and IndexedDB.
The strongest fits have bounded JSON data, clear user or tenant ownership, more reads than writes, direct reads by ID, and occasional collection scans. Examples include personal workspaces, small internal tools, field guides, catalogues, journals, and bounded context for AI assisted applications.
Use another system when the application needs multi record ACID transactions, joins, high frequency shared writes, real time collaboration, full text search, vector search, large analytical queries, or unrestricted reporting across tenants.
No. ThimbleDB serves a narrower workload. It avoids a continuously running database engine by storing encrypted immutable objects and small mutable location records in object storage. Relational databases remain the better choice when relationships, transactions, and flexible queries are central to the application.
No. Cloudflare Workers and R2 are the reference deployment. The package also includes a Node authority with local filesystem, Azure Blob Storage, Amazon S3, and S3 compatible adapters. The stored protocol remains the same across providers.
Both are supported. The authority can run in app inside the application deployment or as a separate Worker, container, function, or Node service. A separate process should normally remain behind the same public browser origin through path based routing so Strict cookies, CSRF, Studio, browser caches, and logout coordination retain the documented behaviour. Use an in app authority for the smallest operational surface. Use a separate authority when storage secret isolation, independent release control, failure isolation, regional placement, or independent scaling justifies another service. Separation creates a scaling boundary; it does not remove collection write contention. See In app and separate authority deployment.
Evaluate it against your workload
Run the sample application, review the tradeoffs, and compare the result with a managed database before choosing a production data layer.