Replicating to Scaleway Object Storage

This guide will show you how to use Scaleway Object Storage as a database replica path for Litestream. You will need a Scaleway account to complete this guide.

Setup

Create a bucket

In the Scaleway Console, click on the green “Create” button in the top navigation and choose “Object Storage Bucket”.

On the “Create a bucket” screen, you’ll need to choose a region and name your space a globally unique name. Then click the “Create a bucket” button at the bottom of the screen.

Screenshot of Scaleway create bucket UI

After your bucket is created, you’ll see the hostname of your bucket in the format <bucket-name>.s3.<region>.scw.cloud. You will need the bucket name, the region and the regional endpoint (s3.<region>.scw.cloud) for use later when configuring Litestream.

Screenshot of Scaleway bucket settings UI

Create a key

You’ll need to create a key to authenticate Litestream to your account so it can access the bucket. In the console, click “Project Dashboard in the sidebar”. Then click on the “Credentials” tab.

Scroll down to the API keys section and click the “Generate new API Key” button. You’ll need to provide a name for key and then hit Enter. You’ll be presented with the access key id and secret access key. You will need to copy those for use later.

Screenshot of Scaleway key creation

Usage

Configuration file usage

Here is an example litestream.yml configuration file. Make sure to specifi the region and endpoint values.

dbs:
  - path: /path/to/local/db
    replicas:
      - type: s3
        bucket: <bucket-name>
        path: db
        endpoint: s3.<region>.scw.cloud # e.g. s3.fr-par.scw.cloud
        region: <region> # e.g. fr-par
        access-key-id: SCWXXXXXXXXXXXXXXXXX
        secret-access-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx