Compose API Documentation

Compose's API gives developers and users programmatic control over the database deployment capabilities of the database-as-a-service platform. Here you'll find the information you need to take the controls.


Deployment /scalings now includes memory and storage

Scaling units are now described more fully in the scalings API. You can see how much memory and storage are associated with each unit, allowing you to easily calculate each deployment's resource allocation, usage, and minimums in terms of both disk and RAM.

For example, the following /scalings API request:

curl -X GET -H "Authorization: Bearer $COMPOSE_API_TOKEN" -H "Content-Type: application/json" '$DEPLOYMENT_ID/scalings'
  "allocated_units": 10,
  "used_units": 7,
  "minimum_units": 2,
  "memory_per_unit_in_mb": 100,
  "storage_per_unit_in_mb": 1024,

indicates that this deployment is allocated:

  • 10 units x 100MB memory/unit = 1GB RAM, and
  • 10 units x 1GB storage/unit = 10GB disk.

Similarly, we can see that the deployment has a minimum size of 200MB RAM / 2GB disk and that it's using roughly 700MB RAM / 7GB disk (more detailed usage metrics can be found on the deployment's "metrics" tab on the UI).