# Data Store

Administrators using Nexus Repository see a _Data Store_ option in the user interface at _Settings → Repository → Data Store_. This screen contains information about your H2 or PostgreSQL database connection.

Nexus Repository users that have migrated away from the legacy OrientDB database can determine their current database by checking the _JDBC URL_ displayed on the _Data Store_ configuration screen:

- If the _JDBC URL_ references H2, then you are using an H2 database.
- If the _JDBC URL_ does not reference H2, then you are using a PostgreSQL database.

## Configuring Database Connection

Review [PostgreSQL Configuration Options and Priority Order](https://help.sonatype.com/en/data-store.html#postgresql-configuration-options-and-priority-order "PostgreSQL Configuration Options and Priority Order") before making any changes via the UI when using a PostgreSQL database

The _Data Store_ screen contains the following information:

- **JDBC URL** (read-only) - URL for connecting to your database.
- **Username** (read-only) - This will be populated for PostgreSQL only.
- **Schema** (read-only) - This will be populated for PostgreSQL only.
- **Maximum Connection Pool Size** (optional) - The maximum number of connections that can be created to meet client requests. For H2, this defaults to 10; for PostgreSQL, this defaults to 100.

**Note**

Note that, for high availability deployments, you must increase the number of connections that PostgreSQL allows so that your Maximum Connection Pool size does not exceed your the maximum number of allowed connections. See [Adjust the PostgreSQL Max Connections](https://help.sonatype.com/en/postgresql-max-connections.html "Adjust the PostgreSQL Max Connections").

- Large deployments with a lot of traffic may need to increase their Maximum Connection Pool Size.
- **Advanced Settings** (optional) - This field is used for troubleshooting and accepts JDBC parameters (e.g.,`maxLifetime=840000`). Leave this section blank unless provided specific instruction by the Sonatype Product Support Team.

To set multiple advanced settings in the UI, separate each value onto a separate line:

```
maxLifetime=840000
maximumPoolSize=200
```

These values will be written to the nexus-store.properties file as advanced settings. A single value will look similar to the following:

```
advanced=maxLifetime\=840000
```

Multiple values will be delimited by "\\n" as shown in the following example:

```
advanced=maximumPoolSize\=200\nmaxLifetime\=840000
```

Because Sonatype Nexus Repository honors the `maximumPoolSize` value before considering the `advanced=maximumPoolSize` value, if you've configured `maximumPoolSize` in some other way, this value will be used instead of what you've configured under the advanced setting.

## PostgreSQL Configuration Options and Priority Order

### Database Connection Configuration

**Note**

As of release 3.53.0, you must provide database connection details through one mechanism. Changes made through environment variables and system properties are not written to the nexus-store.properties file

You can configure PostgreSQL database connection details (JDBC URL, username, password) through environment variables, system properties, or the nexus-store.properties file.

See [Installing Nexus Repository with PostgreSQL](https://help.sonatype.com/en/install-nexus-repository-with-a-postgresql-database.html "Install Nexus Repository with a PostgreSQL Database") for details.

Changes made through the _Data Store_ UI are persisted to the nexus-store.properties file; Sonatype Nexus Repository will only use the values defined in the nexus-store.properties file if you've not used environment variables or system properties.

Nexus Repository uses the first of the following mechanisms that it encounters and will ignore the others:

1. Environment variables
2. System Properties (through JVM arguments or in the nexus.properties file)
3. sonatype-work/nexus3/etc/fabric/nexus-store.properties

This is evaluated each time you start Nexus Repository.

### Connection Pool Size

You can only configure connection pool size through the sonatype-work/nexus3/etc/fabric/nexus-store.properties file.

This is done via two settings in the following priority order:

1. `maximumPoolSize=N`
2. `advanced=maximumPoolSize=N`

If you set `maximumPoolSize`, it will take precedence over the advanced setting.
