Azure SQL Database - best approach for multi-tenant SaaS ERP application based on microservices

Bartlomiej Calko 26 Reputation points
2022-06-22T12:33:54.337+00:00

While microservices are created each with its own database, making all together one application - on the other hand we have multi-tenancy which has few approaches: Single DB, Sharded DB and/or Multi-tenant DB.

How to combine this all together? What are compromises from each side?

If we build f.eks Product.Microservice, Order.Microservice, Payment.Microservice, Customer.Microservice..., etc.

- the **NewTenant** will get  Product.Microservice + DBTenant1 + DBTenant2 + ... + **NewTenantDB**? Elastic pool per tenant?  

Very well explained microservices build in container: NET-Microservices-Architecture-for-Containerized-NET-Applications, but still- how, in addition, will it work with multi-tenant SaaS application?

If you can share some concepts and/or additional resources which can help get better decision.

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2022-06-22T15:00:55.373+00:00

    For multi-tenant SSAS solutions, see design patterns here.

    Here you will find elastic jobs as a way to implement schema changes and run jobs across multi-tenant databases.

    Scale up and down service tiers and compute power is done in minutes on Azure SQL database, and with elastic pools this is done even quicker. Although even the Basic tier has enough throughput for simple schema databases commonly found on microsservices, this Basic tier can be used on -pre-poduction environments.

    Consider setting geo-replication on databases not only replicate data to other regions, but also to use replicas for read-only workloads.

    Automatic tuning will help you creating missing indexes, dropping unneeded indexes and forcing query plans. You can set Automatic Tuning to apply recomendations automaticly and it would rollback them if it sees a regression.

    A microservice architecture can mean a lot of separate data stores, databases need to be cheap but extremely performant and reliable. Azure SQL DB -- with its $5/month starting price, active geo-replication, point-in-time restore, elastic scaling, tools to support sharding (elastic database client library, query routing, elastic transactions, and elastic database tools, etc) is an excelent choice for microsservices.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.