# S3-compatible object storage Keep cetra's Parquet files and media in an S3-compatible bucket instead of the data directory. By default cetra keeps everything in its data directory. With an object store, the Parquet files and media (the bulk of the data) go to a bucket instead; the data directory keeps the WAL, `catalog.db`, `meta.db` and `secret.key`, which stay on a local disk (SSD or NVMe) for speed. | Setting | Environment | Example | |---|---|---| | `storage.object_store` | `CETRA_OBJECT_STORE` | `s3://cetra` or `s3://cetra/prod` (bucket and optional prefix) | | `storage.s3.region` | `AWS_REGION` | `eu-central-1` | | `storage.s3.endpoint` | `CETRA_STORAGE__S3__ENDPOINT` | unset for AWS; the provider's URL otherwise | | `storage.s3.force_path_style` | `CETRA_STORAGE__S3__FORCE_PATH_STYLE` | `true` when the provider has no virtual-host buckets | | `storage.s3.allow_http` | `CETRA_STORAGE__S3__ALLOW_HTTP` | `true` only for a plain-HTTP endpoint on a private network | | credentials | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` | keep them in a secret | The bucket must exist, and the key needs to list, read, write and delete objects in it (under the prefix). Use a bucket, or a prefix, per cetra instance. Examples: | Provider | `CETRA_OBJECT_STORE` | `AWS_REGION` | `CETRA_STORAGE__S3__ENDPOINT` | Path style | |---|---|---|---|---| | AWS S3 | `s3://my-bucket` | the bucket's region | unset | `false` | | Hetzner Object Storage | `s3://my-bucket` | `fsn1` (the location) | `https://fsn1.your-objectstorage.com` | `false` | | Cloudflare R2 | `s3://my-bucket` | `auto` | `https://.r2.cloudflarestorage.com` | `true` | | Garage | `s3://cetra` | the `s3_region` of `garage.toml` | `http://garage:3900` | `true` | ## Incomplete uploads Large files are uploaded in parts. When an upload fails, cetra aborts it, but an upload cut short by a crash, a killed process or a lost network answer can stay on the bucket. Its parts are invisible and billed until something removes them. Add a lifecycle rule that aborts incomplete uploads after a day: {"Rules": [{"ID": "abort-incomplete-uploads", "Status": "Enabled", "Filter": {"Prefix": ""}, "AbortIncompleteMultipartUpload": {"DaysAfterInitiation": 1}}]} Apply it with `aws s3api put-bucket-lifecycle-configuration --bucket --lifecycle-configuration file://lifecycle.json` (add `--endpoint-url` for a provider other than AWS). Check that your provider supports lifecycle rules that abort incomplete multipart uploads before you rely on this rule. If the bucket is shared with other data, put the cetra prefix in the filter instead of an empty prefix. Do not add an `Expiration` rule to the cetra prefix: cetra deletes its own files, and an expiring rule would delete data the catalog still needs. Moving an existing installation between local storage and a bucket is not supported: choose before the first start. For backups in S3 mode, see [Backup and restore](https://cetra.sh/docs/self-hosting/backup/#s3-mode). `/readyz` checks the bucket by reading the marker object `_probe/readyz` (written on the first check), so it needs no permission beyond the server's own.