I have a requirement to route the incoming query to respective DB instances. I'm new to managing Databases.
eg: I have 4 Postgres RDS. say rds_master, rds1, rds2 and rds3
rds_master contains schema table which has mapping of which subdomain points to which schema
- rds1 contains schema 1 to 10 (host - rds1.abc.com)
- rds2 contains schema 11 to 20 (host - rds2.abc.com)
- rds3 contains schema 21 to 30 (host - rds3.abc.com)
I'm planning to have a middleman from application server to rds (some db proxy). So when the request comes from application server (host - rds.abc.com), db proxy should identify the schema information and send the request to respective rds instance.
eg: 10.abc.com running some query, then proxy should route the incoming query to rds2.abc.com
How can I achieve this routing algorithm? is there any db proxy that can do this? Help is much needed for this. Thanks in advance.