Databases
Clever Cloud runs your databases as add-ons, next to your applications. Each one gives the applications you link to it its credentials in environment variables, so that your code holds no password.
PostgreSQL, MySQL, MongoDB, Redis, and Elastic Stack run on instances you size, with backups and monitoring, and you choose when to migrate one to a new version, plan, or region. Materia databases are serverless, and replicate each write across three data centers.
Relational databases
Store structured data with SQL, transactions, and joins.
Key-value stores and caches
Keep sessions, caches, and counters: in memory with Redis, or in Materia KV, a serverless store compatible with Redis.
Documents, search, and time series
Store JSON documents, index text for search and logs, or record metrics over time.
Create a database
In the Console, select Create at the top of the sidebar, then Add-on, and pick a database. Choose its plan, its region, its name, and the applications to link it to. With Clever Tools, from a folder linked to your application, create the add-on and link it with the alias of the application:
clever addon create postgresql-addon my-database --plan dev --link my-appLinking a database gives the application its credentials in environment variables, such as POSTGRESQL_ADDON_URI: restart the application to read them. To link an existing database, use the Service dependencies menu of the application, as Service dependencies explains.
Free plans, such as dev, are for tests, not for production: they run on shared resources, with variable performance, and may not run the same version as dedicated plans. Consumption explains how Clever Cloud bills the other plans.
Delete a database
Select Delete the add-on in the danger zone of the Dashboard of the add-on, or Remove add-on in its Information menu. With Clever Tools:
clever addon delete my-database