We have an application that does lot of data heavy work on the server for a multi-tenant workspace.
Here are the things that it do :
- It loads data from files from different file format.
- Execute idempotence rules based on the logic defined.
- Execute processing logic like adding discount based on country for users / calculating tax amount etc.. These are specific to each tenant.
- Generate refreshed data for bulk edit.
Now after these processing is done, the Tenant will go the the Interface, do some bulk edit overrides to users, and finally download them as some format.
We have tried a lot of solutions before like :
- Doing it in one SQL database where each tenant is separated with tenant id
- Doing it in Azure blobs.
- Loading it from file system files.
But none has given performance. So what is presently designed is :
- We have a Central database which keeps track of all the databases of Customers.
- We have a number of Database Elastic Pools in Azure.
- When a new tenant comes in, we create a Database, Do all the processing for the users and notify the user to do manual job.
- When they have downloaded all the data we keep the Database for future.
Now, as you know, Elastic Pools has a limit of number of databases, which led us to create multiple Elastic pools, and eventually keeping on increasing the Azure Cost immensely, while 90% of the databases are not in use at a given point of time. We already have more than 10 elastic pools each consisting of 500 databases.
Proposed Changes:
As gradually we are incurring more and more cost to our Azure account, we are thinking how to reduce this.
What I was proposing is :
- We create one Elastic Pool, which has 500 database limit with enough DTU.
- In this pool, we will create blank databases.
- When a customer comes in, the data is loaded on any of the blank databases.
- It does all the calculations, and notify the tenant for manual job.
- When manual job is done, we keep the database for next 7 days.
- After 7 days, we backup the database in Azure Blob, and do the cleanup job on the database.
- Finally, if the same customer comes in again, we restore the backup on a blank database and continue. (This step might take 15 - 20 mins to setup, but it is fine for us.. but if we can reduce it would be even better)
What do you think best suited for this kind of problem ?
Our objective is how to reduce Azure cost, and also providing best solution to our customers. Please help on any architecture that you think would be best suited in this scenario.
Each customer can have millions of Record ... we see customers having 50 -100 GB of databases even... and also with different workloads for each tenant.
Pick a provider, and host the workloads. Under demand: provide fan-out among the cloud providers when needed.
This solution requires minimal transfer.