Data Accelerators
Data sourced by Data Connectors can be locally materialized and accelerated using a Data Accelerator.
A Data Accelerator queries/fetches data from a connected data source and stores/updates it locally in an embedded acceleration engine, such as Spice Cayenne, DuckDB, or SQLite. To set data refresh behavior, such as refreshing data on an interval, see Data Refresh.
Dataset acceleration is enabled by setting the acceleration configuration:
datasets:
- name: accelerated_dataset
acceleration:
enabled: true
For the complete reference specification, see datasets.
By default, datasets are locally materialized using in-memory Arrow records.
Supported Data Accelerators
| Name | Description | Status | Engine Modes |
|---|---|---|---|
cayenne | Spice Cayenne | Stable | memory, file, file_create, file_update |
arrow | In-Memory Arrow Records | Stable | memory |
duckdb | Embedded DuckDB | Stable | memory, file, file_create, file_update |
postgres | Attached PostgreSQL (Spice.ai Enterprise) | Release Candidate | N/A |
sqlite | Embedded SQLite | Release Candidate | memory, file, file_create, file_update |
turso | Embedded Turso | Beta | memory, file, file_create, file_update |
Choosing an Accelerator
Select the appropriate accelerator based on dataset size, query patterns, and resource constraints:
| Use Case | Recommended Accelerator | Rationale |
|---|---|---|
| Small datasets (under 1 GB), maximum speed | arrow | In-memory storage provides lowest latency |
| Small datasets (1-10 GB), complex SQL | duckdb | Mature SQL support with memory management |
| Datasets 10 GB and above (up to 1+ TB) | cayenne | Needs 1/3 to 1/2 the memory of duckdb; Vortex columnar format scales beyond single-file limits |
| Point lookups on large datasets | cayenne | Vortex provides 100x faster random access vs Parquet |
| Simple queries, low resource usage | sqlite | Lightweight, minimal overhead |
| Async operations, concurrent workloads | turso | Native async support, modern connection pooling |
| External database integration | postgres | Use existing PostgreSQL infrastructure |
Spice Cayenne vs DuckDB
Both Spice Cayenne and DuckDB support file-based acceleration, but differ in architecture and performance characteristics. Spice Cayenne is recommended for any dataset of 10 GB or larger, because of DuckDB's memory requirements: Cayenne typically needs one-third to one-half the memory of the DuckDB accelerator for the same dataset.
Choose Spice Cayenne when:
- Datasets are 10 GB or larger
- Memory headroom is constrained, or the deployment must run in a smaller container
- Multi-file data ingestion is required (e.g., partitioned S3 data)
- Workloads benefit from Vortex's 10-20x faster scans
- Point lookups and random access patterns are common (100x faster than Parquet)
Choose DuckDB when:
- Datasets are under 10 GB
- Complex SQL features are required (window functions, CTEs)
- Existing DuckDB tooling integration is beneficial
- Explicit index control is required
Data Types
Data Accelerators may not support all possible Apache Arrow data types. For complete compatibility, see specifications.
When accelerating a dataset using mode: memory (the default), some or all of the dataset is loaded into memory. Ensure sufficient memory is available, including overhead for queries and the runtime, especially with concurrent queries.
In-memory limitations can be mitigated by storing acceleration data on disk, which is supported by duckdb, sqlite, and turso accelerators by specifying mode: file.
Schema Handling
Data accelerators store the schema that Spice infers from the data source at startup. This schema is fixed for the lifetime of the runtime process and defines the column names, data types, and nullability of the accelerated table.
If the source schema changes while the runtime is running (for example, new columns are added or data types change), subsequent data refreshes into the accelerator will fail because the incoming data no longer matches the schema of the accelerated table. Restart the runtime to re-infer the schema and re-initialize the accelerated table.
For details on how schema inference works per connector and recommendations for managing schema drift, see Schema Inference.
Data Accelerator Docs
🗃️ Spice Cayenne Data Accelerator
2 items
🗃️ In-Memory Arrow Data Accelerator
1 item
🗃️ DuckDB Data Accelerator
1 item
🗃️ SQLite Data Accelerator
1 item
🗃️ PostgreSQL Data Accelerator
1 item
📄️ Turso Data Accelerator
Turso (libSQL) Data Accelerator Documentation
Related Documentation
- Performance Tuning - Comprehensive optimization guide
- Managing Memory Usage - Memory configuration reference
- Data Refresh - Refresh mode configuration
- Indexes - Index configuration for DuckDB, SQLite, and Turso
