--- title: "Retrieving Data From a Replica Database" slug: "using-a-replica-database" updated: 2025-10-07T19:25:47Z published: 2025-10-07T19:25:47Z canonical: "help.hyperscience.ai/using-a-replica-database" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.hyperscience.ai/llms.txt > Use this file to discover all available pages before exploring further. # Retrieving Data From a Replica Database > [!NOTE] > This feature is available in v42 and later. In v42 and later, you can set up a replica database to read reporting and audit-log data in on-premise instances. Doing so prevents system latency and timeouts when attempting to retrieve these kinds of data, particularly in instances processing a high volume of submissions. This feature is built on a “leader/follower” (a.k.a. “main/replica,” “read/write”) architecture and reduces the load on the main database, allowing you to retrieve read-only data as frequently as needed without slowing the processing of incoming submissions. ## Setting up a replica database To set up a replica database for reading reporting and audit-log data: 1. Provision an additional database in your instance. - We **strongly recommend** that the replica database be of the same type and version as the main database. For information on supported database types and versions, see [Infrastructure Requirements](/deployment/docs/infrastructure-requirements#database). 2. Add the following values to your “.env” file (Docker-based deployments), or append it to `dotenv` in `values.yaml` (Kubernetes-based deployments): ```bash USE_RO_REPLICA_DB=true FORMS_RO_REPLICA_DB_NAME= FORMS_RO_REPLICA_DB_HOST= FORMS_RO_REPLICA_DB_PORT= FORMS_RO_REPLICA_DB_USER= FORMS_RO_REPLICA_DB_PASS= ``` When editing the “.env” file, follow the instructions in [Editing the “.env” file and running the application](/deployment/docs/editing-the-env-file-and-running-the-application). > [!WARNING] > The application does not keep the replica database synchronized with the main database; your system administrator needs to configure this synchronization outside of Hyperscience.