Very happy to see Workers for Platforms will be available to everyone! I want to build a multi-tena
Very happy to see Workers for Platforms will be available to everyone!
I want to build a multi-tenant service with Workers for Platforms, but I don't know what I should do with the database.
I have two options: One D1 database for all customers and One D1 database for each customer.
For the first option, I think there will be challenges for data security and I think the size will grow over 10GB quickly (since what I want to do is heavy on data).
For the second option, there are two problems. First, each account can only have 5000 D1 databases, and I think I will go over this limit since I will offer a free tier service. I also found it's not easy to dynamically create D1 database and attach it to my worker script. Second, If one day I need to do a database migration, I will have to do the migration for all databases, and it'll definitely not be easy.
Do you have any suggestions for what I should do?
I want to build a multi-tenant service with Workers for Platforms, but I don't know what I should do with the database.
I have two options: One D1 database for all customers and One D1 database for each customer.
For the first option, I think there will be challenges for data security and I think the size will grow over 10GB quickly (since what I want to do is heavy on data).
For the second option, there are two problems. First, each account can only have 5000 D1 databases, and I think I will go over this limit since I will offer a free tier service. I also found it's not easy to dynamically create D1 database and attach it to my worker script. Second, If one day I need to do a database migration, I will have to do the migration for all databases, and it'll definitely not be easy.
Do you have any suggestions for what I should do?



