Multiple DBs and region selection

Hello! I have 2 quick questions. Are there any plans to support multiple databases under the same project? Is it possible to select the region where the project is hosted & data stored (ex: Europe)?
7 Replies
Michal Srb
Michal Srb7mo ago
Hey! We don't have region selection yet, but I'm sure we'll get to build it soon (no fixed ETA yet). For multiple databases under the same project, it depends on what exactly you need. Can you say more?
vaggelis-diatsigkos
First of all thanks for the quick feedback. Good to hear that region selection is in your plans! Sure I can share an example regarding multiple dbs. The first that comes to my mind is for multitenancy (with data segregation). One common db (for users, permissions, tenants) and one database foreach tenant. There are cases where the orgs, or groups have under their structure multiple companies. Each company sometimes needs their data segregated (and scalable). -- I hope the example was clear.
Michal Srb
Michal Srb7mo ago
Sure! I'd say often you can handle the multi-tenant scenario inside one DB. The Convex DB is scalable. Multiple instances won't necessarily provide any stronger guarantees around scalability or security. (at the end of the day some code will have access to all tenants' data and will have to do the routing) But this might matter on the type of client or some regulatory restrictions.
vaggelis-diatsigkos
Yes exactly. I was referring specifically for these edge cases where the clients require to have their data split.
siingers
siingers7mo ago
Would like to chime in here - portions of my target market will very likely require a dedicated database under their tenant.
james
james7mo ago
In the meantime if there is a strict requirement for complete isolation between databases that can't be achieved via just having an indexed per-customer field then we have some folks using separate projects for each one. This isn't the most convenient from an administrative perspective, since you need to push code to each project separately etc (can be scriptable) but it does provide true isolation
vaggelis-diatsigkos
A good alternative would be to introduce a gateway project. It would be like a normal project (database, functions, storage, e.t.c.) with the only difference the ability to downstream queries/mutations/actions/http based on some rules (ideally codefirst). If there is a way to somehow auto-sync code functions across tenants (different projects) then I think every aspect is covered. By the way this would also help to differentiate the costs per tenant.

Did you find this page helpful?