Configuring FusionAuth with Primary-Secondary Database Replication
-
Since master-master replication has proven unstable in our setup, we are exploring a primary-secondary replication approach, where:
- Write requests are directed to a single primary node.
- Read requests are distributed across multiple secondary nodes.
From my understanding, this type of load balancing requires the client application to set a read-only flag for read-only requests.
Questions:
- Does FusionAuth support the read-only flag for directing read operations to secondary nodes?
- If not, does FusionAuth offer any similar approach that could facilitate read/load distribution across a database cluster?
-
FusionAuth does not support configuring a read-only database, as most database interactions involve writes, particularly from login events.
For additional context on high-availability database configurations with FusionAuth, refer to this forum discussion:
If read replication is critical for your setup, you may need to handle database routing at the infrastructure level (e.g., using a proxy like Pgpool-II for PostgreSQL or ProxySQL for MySQL) rather than within FusionAuth itself.
FusionAuth Cloud supports active/passive DR which is further outlined here. This may be helpful to you as you build out your high availability FusionAuth system.
-