# Database

---

## Database

The JFrog platform requires a relational database to store and manage the state and metadata of its managed Artifacts.

JFrog recommends using PostgreSQL database for its Platform services. 

PostgreSQL offers high availability (active - passive with failover in supporting providers), scaling and reliability.

Configuration of Database connections is done in [system.yaml](https://docs.jfrog.com/installation/docs/artifactory-system-yaml).

### Tuning for High Load

See [Database tuning for high loads in Artifactory](https://docs.jfrog.com/installation/docs/database-tuning-for-heavy-loads-in-artifactory).


### Artifactory Database Sizing

Refer to [Artifactory Database Sizing](../sizing).

### Database High Availability Considerations

There are two options to use a high availability (HA) database. In the case of the JFrog Platform, the database HA is active - passive where in case of a failure, the passive instance is promoted to primary and the application moves to use the new primary replica.

#### Application Supported HA with Failover

Artifactory [set up to use the PostgreSQL database in HA](https://docs.jfrog.com/installation/docs/configure-artifactory-ha-to-use-postgresql-database-in-ha).

Xray [set up to use the PostgreSQL database in HA](https://docs.jfrog.com/installation/docs/postgresql-for-xray#set-up-an-xray-postgresql-database-in-high-availability).

#### Vendor Supported HA with Failover

In supported platforms and providers, it's possible to use a highly available DB deployment in an active - passive with failover configuration.

Such a setup has a separate, standby replica of the database. In case of a failure, an automatic promotion of the standby replica to primary is done, and the DNS or IP of the database is updated to point to the new primary replica.

See [AWS RDS multi zone HA with failover deployment](https://aws.amazon.com/rds/features/multi-az/), for example.
