tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.
https://tldraw.dev
Other
33.04k stars 1.98k forks source link

Move storing of snapshots to R2 #3693

Closed MitjaBezensek closed 1 week ago

MitjaBezensek commented 2 weeks ago

Instead of storing them in supabse we will store them in r2.

I have already created room-snapshots and room-snapshots-preview buckets on cloudflare.

We could also migrate all the data from supabase, but it seems we haven't done so for the rooms, so I also didn't look into doing it for snapshots.

One slight drawback of moving to R2 is that it's harder to query data by parent slug. So answering questions like which room is the parent to the most snapshots is a bit harder to answer. Instead of just a simple query we'd need to do some custom logic to go through the bucket. Not sure if have ever needed this info though.

Change Type

Test Plan

Existing snapshots:

  1. Load an existing snapshot. It should still load correctly. The best way to do that is probably to generate a few of them in advance.

New snapshots:

  1. Create a new room.
  2. Create a few snapshot links.
  3. They should work.

Release Notes

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview May 6, 2024 7:55am
1 Ignored Deployment | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **tldraw-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/tldraw/tldraw-docs/9eHd5pqKwmJqeRRr2JHXy3Rv5zzJ)) | [Visit Preview](https://tldraw-docs-git-mitja-snapshots-tldraw.vercel.app) | May 6, 2024 7:55am |
hossain666 commented 2 weeks ago

58b81270a1c0a0283997532b8cb076eecaeb8e7f