_Docs/
Get StartedModulesPlatformDeployCookbookChangelogReference
_Deploy
  • Deployment Overview
    • Overview
    • Requirements
    • Demo
      • All-in-one Demo Chart
    • Installation
      • Operator Setup
      • Control Plane SetupEE
    • Infrastructure Services
      • PostgreSQL
      • Message Broker
      • Temporal
    • Module Configuration
      • Stack Configuration
      • Gateway Module
      • Ledger Module
      • Payments Module
      • Auth ModuleEE
      • Orchestration ModuleEE
      • Reconciliation ModuleEE
      • Wallets ModuleEE
      • Webhooks ModuleEE
    • Configuration Reference
      • Operator settings reference
      • API Reference
    • Backups management
    • Troubleshooting
    • Configure OpenTelemetry
    • Traces
    • Metrics
    • Upgrade from the operator
    • Database update
  1. Manage
  2. Upgrade
  3. Database update
Deploy

Database update

This page requires self-hosted edition.
Deployment

This page describes how the operator updates the database schema when deploying a new version of a module.

Database updates management#

The database migrations are handled automatically by the Formance Kubernetes Operator. This applies for all the services that are deployed by the operator.

The services come with the guarantee that the database schema will be updated in a backward-compatible way. This means that the database schema will be updated in a way that the old version of the service will still be able to work with the new schema.

Database update process#

The process starts when the operator detects that a new version of a module is set to be deployed.

First, the operator starts a Kubernetes Job that runs the database migration. The job is responsible for updating the database schema to the new version. Most of the time, the database migration is done using the migrate command embeded in the service.

If the database migration fails, the operator will stop the deployment of the new version of the module and will keep the old version running. The database migration is applied as a transaction, so if it fails, the database is not updated and the old version of the module is still able to work with the old schema.

When the database migration is complete, the operator will start the deployment of the new version of the module. It ensures that the new version is running properly before sending traffic to it.

Once the new version is running, the operator will eventually stop the old version of the module and clean up the resources that are not needed anymore.

Upgrade from the operator
On This Page
  • Database updates management
  • Database update process