I'm designing a containerized microservice and want to make it multi-tenant. Deployments are on Kubernetes. Each tenant/app has high memory usage due to several data structures that need to be initialized in-memory during an init call (e.g., POST service/v1/<app_id>/init
) and these app-, tenant-specific data structures will be exploited in subsequent REST calls (e.g., GET service/v1/<app_id>/resources/
). Assuming each tenant-specific in-memory data structure consumes about 500mb, I'm wondering what the best possible path to take in designing this system, especially taking into account issues such as auto-scaling the services. Currently, I'm evaluating the following approaches:
I wonder if any SO members have come across a similar problem and figured out a path forward. Ideally, I'd like to make a single container/pod be able to serve multiple tenants/apps, but really want to know how to make sure things don't fall apart during scaling. Looking for some input before I delve into one approach and go down a rabbit hole.
Thanks much for any input.