Services
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.
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 / provisioning | pending attachment | attached / pending detachment | detached | removed |
---|---|---|---|---|
not functional | functional | usable by the application | functional | not functional |
Configuring services
- Database
- Object Storage
- ElasticSearch
- RabbitMQ
- Redis
We provide PostgreSQL and MySQL databases by default; 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:
- For PostgreSQL have a look at this example.
- For MySQL have a look at this example.
Dedicated storage and hosting providers handle default file storage in Divio applications. Depending on the application's cloudspace, these can be S3 providers such as Amazon Web Services's S3 service or a generic S3 hosting service via another provider, or MS Azure Blob storage.
Media files can be served through a Content Delivery Network such as Cloudflare in order to provide better performance. Contact our support team to get more information.
Independent of the cloudspace region, your object storage will provide dedicated environment variables that can be used within your application. Please consult the documentation of your technology stack to configure media files. Some of our quickstart templates, such as Django or Laravel, already include the necessary configuration.
We do not recommend to connect to your media storage for local development, instead your file system or a temporary storage should be used instead. Consult your technology stack documentation on how to configure this. Have a look at our Django quickstart template for inspiration.
ElasticSearch is a highly scalable, open-source search and analytics engine that allows for the rapid retrieval, storage, and analysis of large volumes of structured and unstructured data, making it ideal for use cases like full-text search, log and event data analysis, and real-time application monitoring by leveraging its distributed nature, RESTful APIs, and powerful querying capabilities.
Divio provides ElasticSearch on request. It can be run on public (shared) or private clusters in the same cloudspace as the web application. We support multiple versions of Elasticsearch, giving you the flexibility you need. Contact our support team to request your ElasticSearch service.
RabbitMQ is a robust, open-source message broker that facilitates communication between distributed systems by allowing applications to send and receive messages asynchronously through various protocols, supporting reliable message delivery, message queuing, and complex routing with features like clustering, high availability, and flexible routing options, making it ideal for building scalable and fault-tolerant systems.
Divio provides RabbitMQ on request. Contact our support team to request your RabbitMQ service.
Redis is an open-source, in-memory data structure store that functions as a high-performance key-value database, cache, and message broker, offering support for a variety of data structures like strings, hashes, lists, and sets, with features such as persistence, replication, and Lua scripting, making it ideal for use cases requiring low-latency data access, real-time analytics, and distributed caching.
Divio provides Redis on request. Contact our support team to request your Redis service.
Available services
Here is an overview of the available services depending on the region:
North America | European Union |
---|---|
✅ PostgreSQL 15 | ✅ PostgreSQL 15 |
✅ MySQL 8 | ✅ MySQL 8 |
✅ Object Storage | ✅ Object Storage |
Additional regions based on your subscription:
AWS United States | AWS United Kingdom | AWS Germany | Exoscale Switzerland |
---|---|---|---|
✅ PostgreSQL 15 | ✅ PostgreSQL 15 | ✅ PostgreSQL 15 | ✅ PostgreSQL 15 |
✅ MySQL 8 | ✅ MySQL 8 | ✅ MySQL 8 | ✅ MySQL 8 |
✅ Object Storage | ✅ Object Storage | ✅ Object Storage | ✅ Object Storage |
If the service is not available in your desired region please contact our support team.