DuckDB (opens in a new tab) is an in-process SQL OLAP database management system, and has support for querying data in CSV, JSON and Parquet formats from an AWS S3-compatible blob storage. This means you can query data stored in AWS S3, Google Cloud Storage, or CloudFlare R2 (opens in a new tab).
Cube can also connect to MotherDuck (opens in a new tab), a cloud-based serverless analytics platform built on DuckDB. When connected to MotherDuck, DuckDB uses hybrid execution (opens in a new tab) and routes queries to S3 through MotherDuck for better performance.
- A set of IAM credentials which allow access to the S3-compatible data source. Credentials are only required for private S3 buckets.
- The region of the bucket
- The name of a bucket to query data from
Add the following to a
.env file in your Cube project:
In Cube Cloud, select DuckDB when creating a new deployment and fill in the required fields:
If you are not using MotherDuck, leave the MotherDuck Token field blank.
|Environment Variable||Description||Possible Values||Required||Supports multiple data sources?|
|The maximum memory limit for DuckDB. Equivalent to ||A valid memory limit||❌||✅|
|The service token to use for connections to MotherDuck||A valid MotherDuck service token (opens in a new tab)||❌||✅|
|The Access Key ID to use for database connections||A valid Access Key ID||❌||✅|
|The Secret Access Key to use for database connections||A valid Secret Access Key||❌||✅|
|The S3 endpoint||A valid S3 endpoint (opens in a new tab)||✅||✅|
|The region of the bucket (opens in a new tab)||A valid AWS region||✅||✅|
|The number of concurrent connections each queue has to the database. Default is ||A valid number||❌||❌|
Measures of type
be used in pre-aggregations when using DuckDB as a source database. To learn
more about DuckDB's support for approximate aggregate functions, click
here (opens in a new tab).
To learn more about pre-aggregation build strategies, head here.
|Feature||Works with read-only mode?||Is default?|
By default, DuckDB uses a batching strategy to build pre-aggregations.
No extra configuration is required to configure batching for DuckDB.
DuckDB does not support export buckets.
Cube does not require any additional configuration to enable SSL as DuckDB connections are made over HTTPS.