Configuring the Read-only Replica Database
To set up the read-only replica database, configure the necessary settings in either the environment variables file or the configuration.properties file.
Update the environment variables
Add the following connection URL property to the environment variables:
CB_database_JDBC_Read_Only_ConnectionURL=<url>
Database pool configuration can be set via environment variable, to do this you need to use the _ro_ qualifier in the environment name.
For Tomcat:
CB_tomcat_pool_ro_initialSize=<value>
Default value of the property is 10.
CB_tomcat_pool_ro_minIdle=<value)
Default value of the property is 10.
CB_tomcat_pool_ro_maxIdle=<vaue>
Default value of the property is 15.
CB_tomcat_pool_ro_maxActive=<value>
Default value of the property is 35.
For HikariCP:
CB_hikaricp pool_ro_minimumIdle=<value>
Default value of the property is 10.
CB_hikaricp pool_ro_maximumPoolSize=<value>
Default value of the property is 35.
Update the configuration.properties file.
Add the following connection URL property to the configuration.properties file:
database.readOnlyConnectionURL=<url>
Database pool configuration for Tomcat:
database.applicationReadOnlyPoolProperties.InitialSize=<value>
Default value of the property is 10
database.applicationReadOnlyPoolProperties.minIdle=<value>
Default value of the property is 10
database.applicationReadOnlyPoolProperties.maxIdle=<value>
Default value of the property is 10
* 
The database configuration can only be modified through environment variables or by updating the configuration.properties file. Configuring the data source using JNDI is not supported.
Considerations When Configuring the Read-Only Replica Database
Consider the following when setting up the read-only replica database:
For cloud environments, the read-only replica database should be in the same geolocation as the server.
For on-premises environments, the read-only replica database should be in the same geolocation as the main database.
Checking the Read-only Replica Database Health and Performance
To monitor the health and performance of your read-only replica database:
1. Go to the System Admin tab and click Server Status Dashboard. The Server Status Dashboard page opens.
2. On the Server Status Dashboard page, the Application Database Connections Count and the Background Job Database Connections Count charts contain the metrics for the main and read-only replica databases. The databases can be identified based on the legends.
Following is an example chart for the replica database Application Database Connections Count available on the Server Status Dashboard page:
You can export the charts using the Export monitoring charts option. For more information on reading and exporting charts, see Performance Monitoring.
Was this helpful?