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 →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)
.get();Declared indexes narrow candidates. The client checks the complete predicate and falls back to a bounded scan when needed.
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.
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 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.
UnderstandUnderstand the browser cache, authority boundary, object storage source of truth, and scope model.
Published R2 evidence
In the regional browser run, final warm p95 reads ranged from 1.6 to 8.3 ms. Cold product reads ranged from 1.25 to 3.44 seconds after the snapshot change. External session creation remained slower.
These measurements describe one tested workload. They do not claim database-wide latency superiority.
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.
No. Applications use Microsoft Entra or another OpenID Connect provider. ThimbleDB stores stable external identity mappings and revocable sessions, but passwords, passkeys, MFA factors, recovery, and verification remain with the identity provider.
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.