-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
We’re using Amazon Aurora MySQL with two distinct read workloads that need isolation and uniform load balancing connections / queries across reader instances in these respective reader groups -
Reporting queries: Long-running, analytical. Dedicated reader group (custom endpoint: reporting-readers).
Transactional reads: Low-latency, user-facing. Separate reader group (transactional-readers).
Our goal is to:
- Uniformly load balance within each reader group (no DNS round-robin).
- Route queries to the correct reader group without application code changes (e.g., no setReadOnly).
Attempted Solutions
- AWS JDBC Driver: Failed to load balance across custom endpoints.
- RDS Proxy: Doesn’t improve Aurora’s DNS-based rotation. The initial connections established in the application pool get assigned to any 1 of reader instance. Even load of concurrent requests to the app that causes new connections to be established again gets assigned to any 1 of the readers.
ProxySQL Approach we want to try
We plan to deploy ProxySQL to:
Define two hostgroups:
hostgroup 10 → Reporting readers (IPs: reporting-reader-1:3306, etc.).
hostgroup 20 → Transactional readers (transactional-reader-1:3306, etc.).
Route queries using:
SQL comments (e.g., /* REPORTING */) or
Schema/username rules.
Questions
- Is this the right architecture for our use case? Can ProxySQL load balance say in a round-robin fashion when we establish the initial connection pool for reporting across the readers available in the reporting host-group ?
- How to configure query rules to ensure:
Reporting queries only use hostgroup 10.
Transactional queries only use hostgroup 20. - How to handle reader failover (e.g., Aurora auto-scaling readers)?
Performance impact: Any tuning tips for high concurrency (1K+ connections)?