3 ms·
I find (2) curious, as our pains come from trying to build a single-tenant (as in 1 process per client, not 1 machine per client) hosted SaaS offering. Everywhe
by icebraining 11y ago
I find (2) curious, as our pains come from trying to build a single-tenant (as in 1 process per client, not 1 machine per client) hosted SaaS offering. Everywhere I look, there's plenty of tooling written for multi-tenant, distributed webapps, but barely anything if you want to automate the creation and management of isolated "instances" (subdomain + process + database).
We've built some manual deployment scripts for creating new instances, but having to build everything ourselves has been time-prohibitive. I really wish I could find some ready-made tools for our use case.
- old-gregg 11y agoHmm... interesting. I wonder how you define a "tenant" and how tenant affinity is applied to a connection (routing). I doubt you're talking about process-per-web-request, in that case a good ole CGI would do. Shoot me an email to ev@kontsevoy.com, will be glad to chat more about this.
- icebraining 11y agoNot process-per-web-request, but a process-per-account. We route using DNS, by giving each accounts its own subdomain. Essentially, think something like WPEngine, except for a different software.
- old-gregg 11y ago1st idea that comes to mind: 1. Package your per-tenant application into a Kubernetes pod (think of it as a lightweight VM, a collection of Docker containers running on a same host). 2. Write a request router: someone needs to look up tenants based on the virtual hostname in a request. 3. Use k8s API to find a pod with label == tenant. If doesn't exist -> create one. 4. Forward the request there. I'd imagine you'll have to "garbage collect" and gracefully shutdown pods when they sit idle for a while. I'd probably pack that logic into a pod itself.
- icebraining 11y agoI have to thank you; I had seen the Pods concept, but didn't look deeply, since it sounded like they only managed the application itself, while I also need to manage data (primarily client databases) within the pods. But now I see that Pods support some really interesting data volume management systems that could support moving it around if we need to migrate Pods between hosts. Thanks!