> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> The S3 database engine exposes objects in Amazon S3 and compatible object storage as read-only tables.

# S3

The `S3` database engine exposes objects in Amazon S3 and S3-compatible object storage as read-only tables. A table name is resolved as an object URL through the [`s3`](/reference/functions/table-functions/s3) table function.

<h2 id="creating-a-database">
  Creating a database
</h2>

```sql theme={null}
CREATE DATABASE s3_data
ENGINE = S3([url[, NOSIGN | access_key_id, secret_access_key]]);
```

The engine can also take a named collection. Supported configuration keys are `url`, `access_key_id`, `secret_access_key`, `no_sign_request`, and `use_environment_credentials`.

<h2 id="usage">
  Usage
</h2>

With a base URL, table names are object paths relative to that URL:

```sql theme={null}
CREATE DATABASE s3_data
ENGINE = S3('https://bucket.s3.amazonaws.com/data/', 'NOSIGN');

SELECT * FROM s3_data.`events.parquet`;
```

Without a base URL, use the full object URL as the table name. The schema and format are inferred in the same way as for the `s3` table function. The database owns no table definitions and does not support table DDL or writes.

<h2 id="access-control">
  Access control
</h2>

S3 URLs are checked against the server's remote-host filter. Creating this database requires `READ` and `WRITE` source grants on `S3`, regardless of [`table_engines_require_grant`](/reference/settings/server-settings/settings/other#table_engines_require_grant), for example:

```sql theme={null}
GRANT READ, WRITE ON S3 TO user_name;
```

See the [`SOURCES` privileges](/reference/statements/grant#sources) for version and compatibility details.

<h2 id="see-also">
  See also
</h2>

* [`s3` table function](/reference/functions/table-functions/s3)
* [Using S3 with ClickHouse](/integrations/connectors/data-ingestion/AWS/integrating-s3-with-clickhouse)
* [Filesystem database engine](/reference/engines/database-engines/filesystem)
* [HDFS database engine](/reference/engines/database-engines/hdfs)
