Tigris
With MotherDuck, you can access files in a private Tigris bucket. Tigris is a globally distributed S3-compatible object storage service that provides low latency anywhere in the world.
Tigris Requirements
To get started using Tigris with MotherDuck, you need to:
- Create a new bucket at storage.new if you don't have one
- Create an access keypair for that bucket at storage.new/accesskey
- Configure MotherDuck to use Tigris
- Query files in Tigris
When creating a bucket, you can select from different storage tiers:
- Standard (default) - Best for general use cases
- Infrequent Access - Cheaper than Standard, but charges per gigabyte of retrieval
- Instant Retrieval Archive - For long-term storage with urgent access needs
- Archive - For long-term storage where retrieval time is not critical
Configure Tigris credentials
Create a SECRET object
If you are using multiple secrets, the SCOPE
parameter will make sure MotherDuck knows which one to use. You can validate which secret to use with which_secret
.
As an example, see below:
FROM which_secret('s3://my-other-bucket/file.parquet', 's3');
- SQL
- Python
- UI
CREATE OR REPLACE PERSISTENT SECRET tigris (
TYPE s3,
PROVIDER config,
KEY_ID 'tid_access_key_id',
SECRET 'tsec_secret_access_key',
REGION 'auto',
ENDPOINT 't3.storage.dev',
URL_STYLE 'vhost',
SCOPE 's3://my_bucket'
);
-- test Tigris credentials
SELECT count(*) FROM 's3://<bucket>/<file>';
import duckdb
con = duckdb.connect('md:')
con.sql("""
CREATE OR REPLACE PERSISTENT SECRET tigris (
TYPE s3,
PROVIDER config,
KEY_ID 'tid_access_key_id',
SECRET 'tsec_secret_access_key',
REGION 'auto',
ENDPOINT 't3.storage.dev',
URL_STYLE 'vhost',
SCOPE 's3://my_bucket'
)
""")
# test Tigris
con.sql("SELECT count(*) FROM 's3://<bucket>/<file>'").show()
Adding Tigris secrets via the UI is not supported. Please add them using SQL statements.
Delete a SECRET object
- SQL
DROP SECRET tigris;
Tigris credentials as temporary secrets
You can also create temporary secrets that are not persisted across sessions:
CREATE OR REPLACE SECRET (
TYPE s3,
PROVIDER config,
KEY_ID 'tid_access_key_id',
SECRET 'tsec_secret_access_key',
REGION 'auto',
ENDPOINT 't3.storage.dev',
URL_STYLE 'vhost'
);
Local/In-memory secrets are not persisted across sessions.