diff --git a/content/references/advanced/createserver.md b/content/references/advanced/createserver.md index f7112bd..c873cd3 100644 --- a/content/references/advanced/createserver.md +++ b/content/references/advanced/createserver.md @@ -15,14 +15,24 @@ create server server_name foreign data wrapper s3 options (location 's3://bucket ## Foreign Data Wrapper -CedarDB currently supports S3 and requires the following options. +CedarDB currently supports S3 and S3-compatible object storage (e.g., MinIO, Ceph, or other self-hosted storage), and requires the following options. ## Options -* location: The bucket location of the data, in the form `s3://bucketname:region`. +* location: The bucket location of the data, in the form `s3://bucketname:region` for AWS S3, or `minio://host:port/bucketname:region` for S3-compatible storage. * id: This is the access key. * secret: This is the secret that belongs to the access key. +## S3-compatible storage + +To use a self-hosted, S3-compatible storage such as MinIO or Ceph, use the `minio://` prefix and add the endpoint (host and port) in front of the bucket. +The region has to match the region configured on your storage server. +CedarDB connects to such endpoints via plain HTTP. + +```sql +create server server_name foreign data wrapper s3 options (location 'minio://127.0.0.1:9000/bucketname:local', id '', secret ''); +``` + ## Creating access keys For setting up a S3 server CedarDB needs AWS IAM credentials. diff --git a/content/references/advanced/s3.md b/content/references/advanced/s3.md index 6348c52..5e2635e 100644 --- a/content/references/advanced/s3.md +++ b/content/references/advanced/s3.md @@ -29,6 +29,17 @@ CREATE TABLE salary (salary integer, tax numeric) WITH (SERVER = serverName); After setting up a table that uses S3 as backend storage, you can use it the same as a regular table stored on the local filesystem. +## Using S3-compatible storage + +Instead of AWS S3, you can also use a self-hosted, S3-compatible object storage such as MinIO or Ceph. +To do so, use the `minio://` prefix and specify the endpoint of your storage in the location, in the form `minio://host:port/bucketname:region`. + +```sql +-- Create a server for a local MinIO instance listening on port 9000 +CREATE SERVER serverName FOREIGN DATA WRAPPER s3 OPTIONS (location 'minio://127.0.0.1:9000/bucketname:local', id '', secret ''); +CREATE TABLE salary (salary integer, tax numeric) WITH (SERVER = serverName); +``` + ## AWS performance considerations To get the most out of S3-backed data, it is crucial to choose an instance with enough network bandwidth.