Skip to content

Use SQLite storage in the durable object#256

Closed
acoreyj wants to merge 7 commits intotinyplex:mainfrom
acoreyj:feature/persister-durable-object-sql-storage
Closed

Use SQLite storage in the durable object#256
acoreyj wants to merge 7 commits intotinyplex:mainfrom
acoreyj:feature/persister-durable-object-sql-storage

Conversation

@acoreyj
Copy link
Contributor

@acoreyj acoreyj commented May 28, 2025

Summary

SQLite is now the preferred storage method for Durable Objects

See https://developers.cloudflare.com/durable-objects/api/storage-api/ and https://developers.cloudflare.com/durable-objects/best-practices/access-durable-objects-storage/

Using SQLite is much cheaper, see https://developers.cloudflare.com/durable-objects/platform/pricing/

SQLite also has a much higher limit on the row/value of 2mb meaning we can do way less writes.

That being said 2mb may be too small for some people so I implemented a fragmented mode if people are worried about the 2mb limit. This uses a lot more writes, but writes in SQLite storage are still much cheaper (well you get more built into your plan)

How did you test this change?

I used 2 different applications and made sure stores could be merged into new clients from the server with both modes.

I wasn't able to get the local tests running though.

@jamesgpearce
Copy link
Contributor

Mind blown!

Not able to check this over today. Give me a few days to take a look. In theory this is very exciting!

@jamesgpearce
Copy link
Contributor

10/10 no notes. I'll check over the tests/lint for the next release - probably valid for a 6.3 before we maybe break things in v7.0.

I'll handle any merge issues etc.

Thank you so much!

@jamesgpearce
Copy link
Contributor

Cherry picked onto main. Let's go!

@acoreyj
Copy link
Contributor Author

acoreyj commented Jun 6, 2025

Awesome! Thanks for making TinyBase!

@jamesgpearce
Copy link
Contributor

Rolled in v6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants