Skip to main content

Services

Beta Feature

Services are currently in beta and may be subject to change. We welcome your feedback. You can enable Beta features in your account settings.

A Divio application can include various independent services, such as a database, media storage, a message queue, and so on, in addition to its application code. These can be added, removed, and configured in the Services view of any application.

Services

The available services depend on the application's cloud space. For example, S3 media storage is provided on AWS cloud spaces, and MS Blob storage is provided on Azure cloud spaces. See Available services for an outline of services currently offered.

Multiple instances of a service — for example, two Postgres databases — may be used simultaneously.

Environment variables

Each service provisioned for each environment will create an environment variable that can be used to configure the applications that need to be used.

You can view the available environment variables in the details modal for each service. Click on the "..." button followed by Details to view the assigned prefix and variables. The variables names will also be shown in the Env variables section of your application.

For more information about environment variables, including retrieving their values, see How to manage your application's environment variables.

Service management

Adding and attaching

Making a service available to an application is a two-stage process:

  • First, the service must be added to each environment that requires it. A unique prefix must be provided in case other instances of the same service have already been applied.
  • Next, the environment must be deployed. Deployment provisions the service and attaches it to the application.

If required, the option exists to provision a service independently of attachment. In this state, the application has yet to be deployed with the environment variables it needs to use the service, but the service itself is functional and usable. In the case of a media storage or database service, this allows you to populate it before the application's next deployment.

Detaching and removing

A service may be detached if the application no longer needs it. Like attachment, this requires a deployment to take effect.

If a service is no longer required, it can be removed. However, an attached service must first be detached before it can be removed.

  • Removing a service is a destructive operation. It will permanently delete any data used by that service instance.
  • Detaching a service is non-destructive. However, if the application depends on the service, detaching it may cause a deployment or runtime error.

In the case of a deployment error following a detachment command, the service will not be detached, and the application will continue running in its previous configuration. This process safeguards a running application.

States

Services will exist in several states across their lifetime:

new / provisioningpending attachmentattached / pending detachmentdetachedremoved
not functionalfunctionalusable by the applicationfunctionalnot functional

Configuring services

We provide PostgreSQL and MySQL databases by default; MS SQL Server is available on certain EU regions; other database systems can be provided on request. Databases can use public (shared) or private clusters in the same cloudspace as the web application.

Each database will provide dedicated environment variables that can be used within your application. Please consult the documentation of your technology stack to configure the database connection. Some of our quickstart templates, such as Django or Laravel, already include the necessary configuration. They use DATABASE_URL as the environment variable to connect to the database, which will looks something like:

  • DATABASE_URL=postgres://postgres@database_default:5432/db for PostgreSQL.
  • DATABASE_URL=mysql://root@database_default:3306/db for MySQL.

To setup a database connection on your local computer, adapt the docker-compose.yml file in your project and add the following service:

Available services

Here is an overview of the available services depending on the region:

North AmericaEuropean Union
✅ PostgreSQL 15✅ PostgreSQL 15
✅ MySQL 5.7✅ MySQL 5.7
❌ MS SQL Server✅ MS SQL Server 16
✅ Object Storage✅ Object Storage

Additional regions based on your subscription:

AWS United StatesAWS United KingdomAWS GermanyExoscale Switzerland
✅ PostgreSQL 15✅ PostgreSQL 15✅ PostgreSQL 15✅ PostgreSQL 15
✅ MySQL 5.7✅ MySQL 5.7✅ MySQL 5.7✅ MySQL 8
❌ MS SQL Server❌ MS SQL Server✅ MS SQL Server 16❌ MS SQL Server
✅ Object Storage✅ Object Storage✅ Object Storage✅ Object Storage

If the service is not available in your desired region please contact our support team.