Skip to content

JSR

@mikehall314/cushion on JSR: A CouchDB-style document database for Deno.

JSR screenshot

About JSR

A CouchDB-style document database for Deno. Cushion gives you documents with optimistic concurrency, map-reduce views, and a query builder - powered by PouchDB and backed by Deno KV.

Cushion implements the PouchDB adapter interface directly against Deno KV. It gets you a real PouchDB: rev trees, conflict resolution, map/reduce views, and replication, backed by Deno's built-in database.

Revisions are tracked automatically, giving you optimistic concurrency for free: if two writers update the same document concurrently, the loser gets a 409 and should re-read and retry.

Two helpers to make the map-reduce API a little more ergonomic to work with.

Deno KV imposes a 64 KiB limit per value, so a single document revision (or attachment) larger than that will fail to write. Deno KV atomic operations are also capped at 1000 mutations and roughly 800 KiB total; cushion chunks large bulkDocs batches across multiple atomic commits, which means a very large batch is not atomic as a whole. Batches under ~100 document writes commit in one atomic operation.

Writes within a process are serialised, and cross-process writers are handled with an optimistic versionstamp check and retry (3 attempts). Under sustained contention from many processes a write can fail with a 409 after retries are exhausted.

Discussion

Sign in to join the discussion.

Loading comments…

Tagged

Alternatives to JSR

Tools in the same space, ranked by how they are performing in the directory.

Compare all
  • Tailcat

    like netcat, but over Tailscale's data plane, without Tailscale's control plane - tailscale/tailcat

    Open source/Design
  • Birthday Video AI

    Birthday-first AI video maker for wishes and invitations.

    /Design
  • ProWritingAid

    Plan, write, edit, and publish with the complete toolkit for storytellers.

    /Design
  • OpenTIE

    Contribute to elyosh/OpenTIE development by creating an account on GitHub.

    Open source/Design
  • AppScreenshots

    Create beautiful app screenshots for App Store and Google Play in minutes.

    Freemium/Design
  • Pinpoint

    One platform. Three life-safety solutions: wearable staff duress, patient nurse call, and safety checks.

    /Design