User-Based Routing for Multi-Tenant SaaS
In a multi-tenant SaaS architecture, each client typically operates with their own dedicated database, schema, or cluster. When a user connects, it is necessary to dynamically route them to the correct database or cluster based on their assigned tenant. Heimdall Proxy addresses this challenge by replacing the default connection details with tenant-specific information, enabling seamless and secure routing to the appropriate destination.
Dynamic User-Based Routing with Heimdall Proxy
Heimdall Proxy enables dynamic user-based routing by determining the appropriate database or host for each user. This functionality can be implemented using one of the following authentication methods:
- SQL Driven: Retrieves routing information dynamically from an SQL database.
- Proxy Configured Users Using Secrets: Fetches routing details from a secret manager.
How It Works
- For each user, corresponding data (such as the desired hostname or database to connect to) is stored in an external source (either an SQL table or a secret manager).
- When a connection attempt is initiated, Heimdall automatically replaces the original host information with the destination details provided by the external source.
- Using this substituted connection information, Heimdall establishes the appropriate connection to the target database or server.
This approach ensures that each user is routed dynamically to their designated host or database seamlessly.
Additional Considerations
Setting up and configuring Heimdall Proxy for user-based routing involves complexities that may vary depending on your specific use case or client behavior. It is recommended to contact Heimdall support for assistance with the configuration process and to ensure the solution meets your unique requirements.