Is it possible to dynamically use D1 databases

The documentation on D1 limits [1] says "Each D1 database can store up to 10 GB of data, and you can create up to thousands of separate D1 databases. This allows you to split a single monolithic database into multiple, smaller databases, thereby isolating application data by user, customer, or tenant." Is it possible to dynamically create and connect to D1 databases from a worker. E.g. A customer signs up, I create a database for them, I then read/write to/from that database. A post on the Cloudflare forums [2] around a year ago said "The team is working on dynamic binding, but not available yet.". Is it possible now? [1] https://developers.cloudflare.com/d1/platform/limits/ [2] https://community.cloudflare.com/t/using-d1-instances-dynamically/661841
4 Replies
Chaika
Chaika3mo ago
Still not possible now, sadly. They did, since then, launch Durable Objects w/ SQlite support, same tech as D1 https://blog.cloudflare.com/sqlite-in-durable-objects/ It's still in beta and has some more limits, but you can create Durable Objects freely and dynamically, although not quite the same as D1 is more managed with its built in query metrics ui, etc
dan—1106
dan—1106OP3mo ago
thanks @Chaika -- do you know if it's still coming in the future?
Chaika
Chaika3mo ago
I do believe it's still part of the road map yea, D1's team just been slow/pretty quiet
Super Morris
Super Morris2mo ago
pleaaase!!!

Did you find this page helpful?