Docs

Documentation versions (currently viewingVaadin 24)

Database

Provision a database for your Vaadin application and manage migrations and backups.

Control Center provides a simple way to provision a database for a Vaadin application. It also allows you to manage database migrations and backups. These features allow easy setup and maintenance of a database for an application, ensuring that data is always safe and up to date.

PostgreSQL

Control Center uses PostgreSQL as the database for deployed applications. This requires including the PostgreSQL JDBC driver to be included in the project dependencies. For Maven projects, add the following dependency to your pom.xml file:

Source code
pom.xml
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <scope>runtime</scope>
</dependency>

Provisioning a Database

The Database feature can be enabled either during the deployment of an application or for an application that is already deployed. When enabled, Control Center automatically provisions a dedicated PostgreSQL database exclusively for that application. If the application is configured to use a Spring datasource, the necessary connection details are set up automatically.

Database Migrations

A database migration is a process that manages incremental, reversible changes to a database schema over time. Migrations allow the evolution of a database structure safely and predictably, ensuring that an application and its data remain consistent as requirements change.

Control Center integrates with Flyway for managing database migrations. For more information about how to setup Flyway in an application, see the Add Flyway page. For more information about how to use Flyway migrations with Control Center, see the Flyway Migrations page.