Declarative databases are currently an alpha feature. While the feature should be stable, it may be changed without prior notice.

Databases represent a common building block in cloud architecture, and Architect makes it easier than ever for developers to create applications that require databases. Simply declare them as part of your component and they’ll be automatically deployed alongside your applications.

architect.yml
databases:
  main:
    description: Main storage for my application
    type: postgres:13

Integration

Like services, databases represent persistent runtimes that can be connected to by other applications and services. You can refer to many of the same fields supported by service interfaces for databases as well.

databases:
  main:
    type: postgres:13

services:
  api:
    interfaces:
      main:
        port: 8080
    environment:
      DB_DSN: ${{ databases.main.url }}
keydescription
urlFully resolvable URL of the database (alias: connection_string)
hostHostname of the database
portPort the database is exposed on
protocolProtocol the database responds to
usernameUsername used to authenticate with the database
passwordPassword used to authenticate with the database
databaseThe database (e.g. namespace) on the instance to be connected to

How databases get deployed

Today, Architect deploys databases by transforming the database definitions into single-interface services. That means they’ll be deployed as containerized applications. This is great for feature-environments, but not ideal for production.

When going to production, Architect recommends creating your database separately using your favorite cloud provider. Once your database exists, you can provide the connection string to the environment to create a virtual service - allowing applications to connect securely to the existing instance.

Supported database types

TypeVersion
postgres10, 11, 12, 13, 14, 15
mysql5, 8
mariadb10