I have a need for a SaaS/multi tenant system where I’d like a single app (Silverstripe framework) layer and seperate database-per-tenant.
Not one database with keys to check the tenant - entirely different databases.
Laravel example: https://tenancyforlaravel.com
Haven’t really found anything on here, web, GitHub etc
Can you move the logic into the environment? eg. set the relevant environment variables based on some factor such as the URL. You can then specify DB connection, and even set other configs in yml based on the environment
Yeah I don’t see why not. All other projects are in a docker container with traefik routes, db connection and some other SS env vars like SS_ENVIRONMENT_TYPE.
I suppose I could cobble together something to make it work in a “devop-sy” way. Was hoping for a more “Silvertripe-y” way.
There’s currently no way I’m aware of to handle multiple database connections in a single Silverstripe application. It’s possible you could achieve this by swapping out connectors, but it’s definitely not supported.
Probably this is better to handle at the webserver level, e.g. using apache virtualhosts.