Rebasely Beta: data may be purged

exampleslive-notes Public

Save a snapshot of each note to R2 every 100 versions #2

Changed files

21 files changed470 additions41 deletionssince main at d21dfdd

Reading a note's history

Added by this pull request.

  • Added
  • Rerouted, relabelled or moved
  • Removed

Someone wants to see what the groceries note said before today's edits. The Worker reads the snapshots from R2 under the room's object id, which it computes with idFromName, so the room is never woken.

Reading a note's history: 6 steps between 3 participants Step 1: reader to api, GET /notes/groceries/snapshots (added)GET /notes/groceries/snapshotsStep 2: api to snapshots, list snapshots/<idFromName(groceries)>/, 100 keys at a time (added)list snapshots/<idFromName(gr…Step 3: api to reader, versions 100, 200 and 300, when each was saved and its size (added)versions 100, 200 and 300, wh…Step 4: reader to api, GET /notes/groceries/snapshots/200 (added)GET /notes/groceries/snapshot…Step 5: api to snapshots, get snapshots/<id>/000000000200.txt (added)get snapshots/<id>/0000000002…Step 6: api to reader, the text at version 200, as text/plain, cacheable for a year (added)the text at version 200, as t…reader (added in this flow)readerActor · addedapi (added in this flow)apiWorker · addedsnapshots (added in this flow)snapshotsR2 bucket · added

The flow reading-history at the head of this pull request, numbered in its order, with the steps it adds, reroutes, relabels, moves and removes. A removed step has no number.

Steps

  1. Step 1, added: reader → api GET /notes/groceries/snapshots Added
  2. Step 2, added: api → snapshots list snapshots/<idFromName(groceries)>/, 100 keys at a time Added
  3. Step 3, added: api → reader versions 100, 200 and 300, when each was saved and its size Added
  4. Step 4, added: reader → api GET /notes/groceries/snapshots/200 Added
  5. Step 5, added: api → snapshots get snapshots/<id>/000000000200.txt Added
  6. Step 6, added: api → reader the text at version 200, as text/plain, cacheable for a year Added

Knowledge base

Back to the conversation