Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Database Configuration Overview

Artifactory comes with a built-in embedded Derby database. Artifactory supports several databases that you can use depending on your requirements.

Accessing a Remote Database

When using an external database, you need a reliable, stable and low-latency network connection to ensure proper functioning of your system.

When using a full-DB configuration, we strongly recommend a high-bandwidth to accommodate the transfer of large BLOBs over the network.

Setup Flow

To set up your new database, you will need to perform the following steps:

  1. Create a database instance.
  2. Create an Artifactory user for the database.
  3. Install the appropriate JDBC driver.
  4. Set the database parameters in your system.yaml configuration file.
  5. Start Artifactory.

To migrate your existing database:

  • Import the metadata using Full Import and Export (optional for migration, not required for a new installation). Changing the database does not automatically transfer your data to the new database.

* For a complete step-by-step guide, follow the details in the specific page for each of the supported databases listed below.

Database Connection Settings

Add or change the below parameters for database connections settings under the system.yaml configuration file.

The maximum number of pooled database connections (default: 100).

The maximum number of pooled idle database connections (default: 10).

Tomcat Only

This parameter is applicable on Tomcat.

Default Home Directory

The default product home directory is defined according to the installation type. For additional details see the Product Directory Structure page.

Note: This guide uses  $JFROG_HOME  to represent the product home directory.

How is connection pool for database locking done in Artifactory?

From version 6.0.0, the new database locking mechanism adds its own connection pool (defaults to the value of the value).

However, you may need to adjust your database connection limit to accept more connections. For example, if your database is set to accept up to 100 connections from each node, you may consider increasing the limit to 200 concurrent connections per-node, to accommodate the full utilization of the locking connection pool. Your database should accept the number of configured connections per-node multiplied by the number of the nodes in the cluster.  

Choosing the Right Database

Artifactory uses Derby as the default database, which requires no additional configuration. Derby provides good performance for small to medium size loads. However, if you expect intensive usage or high load, high availability setup, and better tooling, we recommend that you use PostgreSQL(PostgreSQL v10.x to v13.x). Since other JFrog products support only PostgreSQL, choosing PostgreSQL for Artifactory will allow you to use the same database for the entire JFrog Platform.

Additionally, Artifactory supports the following pluggable database implementations:

For each of the supported databases you can find the corresponding example values in the system.yaml configuration file.

Checksum-Based Storage

Artifactory uniquely stores artifacts using checksum-based storage. For details, please refer to Checksum-Based Storage.

Modes of Operation

Artifactory supports two modes of operation:

  • Metadata in the database and binaries stored on the file system (This is the default and recommended configuration).
  • Metadata and binaries stored as BLOBs in the database

Database Tuning for Heavy Loads in Artifactory

You  can alter the maximum connections an Artifactory node can open to the database by modifying the maxOpenConnections parameter in the Artifactory System YAML. The default value of the maxOpenConnections parameter is 100. You must set the value of the parameter in the artifactory, access, and metadata sections of the system YAML file. Once you set the value, the Artifactory node will open up that many database connections. Therefore, ensure that the database can accommodate the total number of connections all Artifactory nodes can open.

Use the following formula to determine the value of the parameter.

Total number of connections = (number of nodes) * ((artifactory.database.maxOpenConnections * 2) + access.database.maxOpenConnections + metadata.database.maxOpenConnections) + 50

The additional 50 are to provide extra breathing room in situations where all database connection pools are exhausted.

The following sample shows an example.

    maxOpenConnections: 300
    maxOpenConnections: 300
    maxOpenConnections: 300

In the example, the total number of open database connections is 1200.

Copyright © 2022 JFrog Ltd.