NavigationContentFooter

Serverless SQL Databases API

Introduction

Scaleway's Serverless SQL DB is a fully-managed and flexible service offering SQL Databases. It provides elastic scaling and a pay-per-use model, ensuring you pay only for the queries you run and storage you consume.

Designed to free you from administrative and configuration tasks, it lets you focus solely on your data and application development. We handle high availability, regular backups, and configuration.

Your database only runs when in use, hosted in our energy-efficient datacenters in Europe, reducing your carbon footprint. Data is kept securely within our regions in Paris, Amsterdam, and Warsaw. Serverless SQL DB by Scaleway is a smart choice for efficient and sustainable database management.

Concepts

Refer to our to find definitions of the different terms referring to Serverless SQL DB.

Quickstart

  1. Configure your environment variables.

    Note

    This is an optional step that seeks to simplify your usage of the APIs.

    export SCW_ACCESS_KEY="<API access key>"
    export SCW_SECRET_KEY="<API secret key>"
    export SCW_REGION="<Scaleway region>"
  2. Edit the POST request payload you will use to create your Serverless SQL DB Database. Replace the parameters in the following example:

    {
    "organization_id": "895693aa-3915-4896-8761-c2923b008be7",
    "project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826",
    "name": "myDB",
    "cpu_min": 0,
    "cpu_max": 5
    }
    ParameterDescription
    organization_idYour Organization ID. It must be in UUID format. To find your Organization ID, you can consult the .
    project_idThe ID of the Project you want to create your Serverless SQL DB Database in. To find your Project ID you can or consult the .
    nameName of the Serverless SQL DB Database
    cpu_minThe minimum number of CPUs units your Serverless SQL DB Database can scale down to.
    cpu_maxThe maximum number of CPUs units your Serverless SQL DB Database can scale up to.
  3. Create a Database by running the following command. Make sure you include the payload you edited in the previous step.

    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    "Content-Type: application/json" \
    https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databases \
    -d '{
    "organization_id": "895693aa-3915-4896-8761-c2923b008be7",
    "project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826",
    "name": "myDB",
    "cpu_min": 0,
    "cpu_max": 5
    }'
  4. List your Databases.

    curl -X GET \
    -H "Content-Type: application/json" \
    -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databases

    You should get a response like the following:

    Note

    This is a response example, the UUIDs and IP address displayed are not real.

    {
    "id": "f5122f66-fb50-4cef-aa02-487ef4fc1af0",
    "name": "myDB",
    "organization_id": "895693aa-3915-4896-8761-c2923b008be7",
    "project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826",
    "status": "ready",
    "endpoint": "postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB",
    "created_at": "2019-04-19T16:24:52.591417Z",
    "region": "fr-par"
    }
  5. Retrieve your Serverless SQL DB endpoint from the response.

    Note

    In the example above, the Endpoint is postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB.

  6. Connect to your Database with the psql database client using the endpoint and one of your IAM principals:

    psql postgres://<iam-principal>:<iam-api-key>@f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB

Technical Information

Regions

Scaleway's infrastructure is spread across different .

Serverless SQL DB is available in the Paris region, which is represented by the following path parameters:

  • fr-par

PostgreSQL specifications

Versions

Scaleway Serverless SQL DB supports PostgreSQL version 14.

Technical Limitations

User Management

  • users do NOT have SUPERUSER nor REPLICATION privileges.

Going Further

For more information about Serverless SQL DB , you can check out the following pages:

  • join the #database channel
  • .

Serverless SQL Databases

GET
/serverless-sqldb/v1alpha1/regions/{region}/databases
POST
/serverless-sqldb/v1alpha1/regions/{region}/databases
GET
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
PATCH
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
DELETE
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
POST
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}/restore

Serverless SQL Databases Backups

GET
/serverless-sqldb/v1alpha1/regions/{region}/backups
GET
/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}
POST
/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}/export
Cloud Products & Resources
Dedicated Products & Resources
Scaleway
Follow us
© 1999-2024 – Scaleway SAS