pagedb Live How it works Vector search Numbers Demos Deep dive GitHub
pagedb · one Cloudflare Durable Object

Hundred-gigabyte databases in R2, served live by one Durable Object.

The data sits in R2 as immutable 64 KB pages. One object serves it, holding only the pages queries touch. Every view on screen is a live query: when anyone writes, the object works out which rows of which open views changed and pushes just those. And every Hacker News story is now searchable by meaning, from the same pages.

45.8 GB
every HN story and comment, live
4.85M
story vectors, searched in ~140 ms
100 GB
issue tracker, 27M issues
160M
r/place pixels
146M
taxi trips in one spreadsheet

Live, right now

This page is a pagedb client. The search box below embeds your query and searches all 4.85M stories in the Hacker News object; the feed beside it is a live query on the same object, pushed as stories and comments arrive from HN.

Search Hacker News by meaning 4,848,803+ stories · one object

    Arriving on the HN object connecting…

      New stories are embedded as they're written, so they're searchable on the very next search.

      How it works

      A database whose base is immutable files in R2, and one object that serves it. Click a step, or let it play.

      1. A page asks for a named queryThe Worker checks the arguments and signs the query
      2. The socket subscribesOne Durable Object holds every live view
      3. RAM, then the object's SQLiteSynchronous, microseconds
      4. Misses become one fault roundEvery missing page, fetched together
      5. A write lands in the overlayDurable in SQLite when acknowledged
      6. Only changed rows are pushedTo every tab whose view they touch
      7. The overlay folds into R2Writes leave the object's memory
      8. Vector search: same pagesCentroids pinned, two stages, one round each
      Browser tabs /hn · semantic/tracker · board/place · canvas Someone writesa story, a pixel, an edit Workersigns leases (HMAC)embeds queries (AI) One Durable ObjectRust engine in WebAssembly RAM40 MiB · <1 µs SQLite≤10 GB · ~0.3 ms Overlayrecent writes Live viewsone per open query Vector index14,276 centroids · 1-bit, then 8-bit City cache1 MiB chunks, same colo10–80 ms R2base: 4 MiB parts of64 KB B+tree pages immutable base layers of folded writes lease: signed for 60 s all missing pages, one round no network durable on acknowledge only the rows that changed at 4 MB: a new layer 256 pages, then ~50 more

      The long version, with every mechanism and measurement: how pagedb works.

      Four demos, one engine

      The schema is data, so the same engine and the same Durable Object code serve all four. Open one in two windows and edit in one.

      Vector search, in the same pages

      turbopuffer's architecture rebuilt on Durable Objects + R2: an IVF index made of ordinary B+tree pages, next to the rest of the database. Same 1,024-d Qwen3 vectors, benchmarked against turbopuffer and Cloudflare Vectorize.

      One search, step by step. 183 of 14,276 clusters, 255 pages in one round trip, ~80k stories scored at 1 bit per dimension, the best 100 reranked with 8 bits.
      Real windows. Three searches at 43–52 ms (query embeddings already cached; a brand-new query adds ~0.5–1.5 s for Workers AI to embed it), and a story posted in one window found by meaning in the other 0.9 s later.
      Same 4.85M vectors, 100 queriespagedbturbopufferVectorize
      recall@10 vs exact0.9710.9900.786
      p50 in the service, new query138 ms13 ms465 ms
      same query again38 ms (RAM)13 ms25 ms (cached)
      filtered (before 2011)140 ms · 0.8913 ms · 0.9110.2 s · 0.72
      a write searchablenext searchnext search14 s p50
      live result updatesyesnono
      a month at 1M searches~$5$16~$67
      turbopuffer is really good: better recall, about 10× faster, real filters, billions of vectors, and someone else runs it. One Durable Object wins on price, live results, and having the vectors sit next to the rest of your data.

      Two stages. The probe tier keeps 1 bit per dimension of each vector's rotated residual (RaBitQ-style, 128 bytes a story), scored with popcounts. The best 100 are rescored with 8-bit codes. Going from 4-bit codes to this took recall from 0.895 to 0.971 at the same page budget.

      One round per stage. The 14,276 centroids are pinned in the object; a search picks the clusters within 256 pages, fetches every missing page at once, then fetches the candidates' 8-bit entries.

      Writes are vectors too. The HN tail embeds each new story (Workers AI, Qwen3) in the same write as its row, so it's searchable on the next search and pushed into open results.

      Where it tops out. The fast tier is the object's 10 GB of SQLite; this index is 7 GB. A small collection (under ~500k vectors) can skip the clusters entirely: all 1-bit codes in memory, brute force, a few ms.

      What semantic search over all of HN costs a month: one Durable Object ~$5, turbopuffer $16, Weaviate $45, Vectorize $67, Pinecone $343

      The numbers

      What a live sync engine costs at 100 GB and 1,000 concurrent users, and how pagedb compares with r2db, the demo that started this.

      What a live sync engine costs a month: one Durable Object $9 vs $190 to $33,550 elsewhere
      $9 a month for 100 GB, 1,000 users online and 5 writes a second pushed to everyone: a 30 s load test scaled to a month. Others are list-price estimates for the same workload.
      1,000 tabs, 5 writes a second: all 150,000 updates delivered, median 174 ms write → every tab. Outgoing WebSocket messages aren't billed, so the fan-out is free.
      Measured (same laptop)pagedbr2db demo
      Issues on screen after opening the page (100 GB bases, median of 8 loads)0.25 s1.09 s
      Every list, board column and count query from cold1 fault roundrounds = dependency depth
      Count of a project's issues3.6 µs engine time3 ms (published)
      Your own edit visibleinstant (optimistic)after the server round trip
      Write → other tabs, 1,000 sockets, 5 writes/sp50 174 ms—

      What it can't do