Multi-tenancy in 3 different layer

Database: MySQL with multi database (database per tenant)

Indexer: Elasticsearch

Queue and Database load helper: Redis


  1. We have chosen to work with database per tenant Architecture. However I Wonder How can I use this method in combination of Elasticsearch. Elasticsearch for Handling Data indexing for each tenant that might be used for some specific search functions cross tenants (Talking about millions of records for example 10000 tenant with 100-120 users in their table) but heavily used for each tenant search in its own data (Some of table in tenant database might reach to approximately 5 billion record for example tenant's user log history)


1.1 What is the best way (In our case) to handle multi-tenancy with multi-database design to use Elasticsearch as the search engine behind our application? 1.2 What are the best tools and practices in designing an indexer system(any kind) and to have searching capability in billions of records?


  1. How can I use Redis in application level to support MySQL for Read/Write(Mostly Write) situation to queuing insert functions and calculation of some real-time changes without pushing load on MySQL server?


2.1 How can I use Redis in combination of multi-database system (Partitioning, clustering, etc.) to reach the best out of the box performance in application level?

2.2 what are the best solutions to mix Redis with such a system I have mentioned above?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.