What is DuckDB?
DuckDB is an open-source, in-process analytical database management system designed for fast OLAP queries. Often described as "SQLite for analytics," DuckDB runs embedded within a host application with zero external dependencies, which makes it a strong fit for single-node analytical workloads.
DuckDB runs inside the app's process, so a query needs no server or network hop. Writes are ACID transactions with a write-ahead log, and queries scan columnar tables and read Parquet and CSV files in place.
Analytical workloads (dashboards, data pipelines, federated queries, and AI applications) require fast reads over large datasets. Traditional database architectures force a choice: use a heavyweight server-based database like PostgreSQL for full SQL support, or use a lightweight embedded database like SQLite that lacks analytical performance. DuckDB fills the gap between these two options.
DuckDB is an open-source, in-process SQL OLAP database management system. It runs inside the host process with no external server, no dependencies, and no configuration. Despite this simplicity, it delivers analytical query performance that rivals dedicated data warehouse engines, thanks to a columnar storage engine and vectorized query execution.
The same design also sets DuckDB's limits. It runs on one machine, and one process at a time writes each database file. Teams that outgrow those limits move to distributed engines or to engines that spread data across many files.
How DuckDB Works
DuckDB is designed from the ground up for analytical (OLAP) workloads. Its architecture reflects this focus at every level, from storage format to query execution.
Columnar Storage
Unlike row-oriented databases (PostgreSQL, SQLite, MySQL), DuckDB stores data in a columnar format. Each column is stored independently and contiguously in memory. This layout is fundamental to analytical performance because analytical queries typically access a small number of columns across many rows.
When a query reads three columns out of a table with fifty, a columnar engine reads only the data for those three columns. A row-oriented engine must read entire rows, including all fifty columns, and discard the forty-seven it does not need. For scan-heavy analytical workloads, this difference translates to significantly less I/O and better cache utilization.
DuckDB organizes columnar data into compressed segments. Each segment stores a contiguous range of values for a single column and applies lightweight compression (dictionary encoding, bit-packing, run-length encoding, frame-of-reference encoding) based on the data distribution. Compression reduces memory usage and improves scan throughput by fitting more data into CPU caches.
Vectorized Execution
DuckDB processes data in vectors (batches of values from a single column) rather than one row at a time. This vectorized execution model is the key to DuckDB's analytical performance.
Traditional row-at-a-time engines (like SQLite) process each row through the entire query pipeline before moving to the next row. This incurs high per-row overhead from function calls, type dispatching, and branch mispredictions. Vectorized execution amortizes these costs across thousands of values at once:
- Reduced function call overhead: A single function call processes an entire vector of values instead of one value at a time.
- Better CPU cache utilization: Processing a contiguous vector of values from a single column keeps the data in L1/L2 caches.
- SIMD opportunities: Operating on vectors of homogeneous values enables the compiler and CPU to use SIMD (Single Instruction, Multiple Data) instructions for operations like filtering and aggregation.
The combination of columnar storage and vectorized execution gives DuckDB performance characteristics closer to purpose-built analytical engines like ClickHouse or Apache DataFusion than to general-purpose embedded databases.
Zero-Dependency Embedding
DuckDB is designed to be embedded directly into applications. It compiles to a single library with no external dependencies: no separate server process, no configuration files, no network setup. Applications link against the DuckDB library and interact with it through a C/C++ API, or through bindings available for Python, R, Java, Node.js, Rust, Go, and other languages.
This embedding model means DuckDB runs in the same process and address space as the host application. There is no serialization overhead for passing data between the application and the database, no network round-trips, and no separate process to manage. For analytical workloads that need to run close to the application (inside a data pipeline, a notebook, an API server, or an edge device), this architecture eliminates an entire class of operational complexity.
Key Features
Full SQL Support
DuckDB implements a comprehensive SQL dialect that includes:
- Window functions, CTEs (Common Table Expressions), and subqueries
- Complex joins including lateral joins and asof joins
- Nested types: structs, arrays, maps, and unions
- Regular expressions, string functions, and date/time operations
- User-defined functions and macros
- Prepared statements and parameterized queries
The SQL dialect is PostgreSQL-compatible in many areas, making it familiar to developers who work with PostgreSQL.
Direct File Querying
DuckDB can query data files directly without first loading them into a database. It supports reading from:
- Parquet files: with predicate pushdown and column pruning for efficient scans
- CSV and TSV files: with automatic schema detection and parallel reading
- JSON files: including newline-delimited JSON (NDJSON)
- Apache Arrow: zero-copy integration with Arrow-based data pipelines
This capability makes DuckDB useful as an ad hoc query tool for data exploration. A developer can point DuckDB at a directory of Parquet files and run SQL queries immediately, without any ETL step or schema definition.
Parallel Query Execution
DuckDB automatically parallelizes query execution across available CPU cores. The query planner identifies opportunities for parallelism (parallel scans, parallel hash joins, parallel aggregations) and distributes work across threads. This happens transparently, without any configuration or query hints.
For analytical workloads that process large datasets, parallel execution provides near-linear speedups on multi-core machines. Combined with vectorized execution, this means DuckDB can process billions of rows per second on commodity hardware.
Transactions and Persistence
Despite being an embedded database, DuckDB supports full ACID transactions with serializable isolation. Data can be persisted to disk in DuckDB's native format, or DuckDB can operate entirely in-memory for transient analytical workloads.
The persistence layer uses a write-ahead log (WAL) for crash recovery and supports concurrent readers with a single writer. This makes DuckDB suitable for applications that need durable analytical storage without the operational overhead of a separate database server.
DuckDB vs. Other Engines
DuckDB vs. Apache DataFusion
Apache DataFusion is a Rust-native query engine built on Apache Arrow. Both DuckDB and DataFusion target analytical workloads with columnar processing, but they serve different roles:
- DuckDB is a complete database with its own storage engine, transaction support, and persistence layer. It is designed to be used as a self-contained analytical database.
- DataFusion is a query engine framework designed to be embedded into larger systems. It provides a query planner, optimizer, and execution engine, but relies on external systems for storage and data management.
DataFusion is more composable: it is designed to be extended with custom table providers, optimizer rules, and execution strategies. DuckDB is more turnkey: it provides a complete database experience out of the box. Spice uses DataFusion as its core SQL federation engine. For a detailed side-by-side comparison, see Apache DataFusion vs. DuckDB.
DuckDB vs. PostgreSQL
PostgreSQL is a server-based relational database designed for transactional (OLTP) workloads. DuckDB is an embedded database designed for analytical (OLAP) workloads. The key differences are:
- Architecture: PostgreSQL runs as a separate server process; DuckDB runs in-process with no server.
- Storage: PostgreSQL uses row-oriented storage; DuckDB uses columnar storage.
- Query execution: PostgreSQL processes rows one at a time (with some recent vectorization work); DuckDB uses fully vectorized execution.
- Concurrency: PostgreSQL supports many concurrent readers and writers with MVCC; DuckDB supports concurrent readers with a single writer.
For analytical queries that scan and aggregate large volumes of data, DuckDB is typically 10-100x faster than PostgreSQL. For transactional workloads with many concurrent writes, PostgreSQL is the appropriate choice.
DuckDB vs. SQLite
SQLite and DuckDB share the same deployment model: both are embedded, zero-dependency databases. The differences are in their target workloads:
- Storage: SQLite uses row-oriented storage; DuckDB uses columnar storage.
- Execution: SQLite processes one row at a time through a virtual machine; DuckDB uses vectorized execution on column vectors.
- Analytical performance: DuckDB is orders of magnitude faster than SQLite for analytical queries (scans, aggregations, joins over large datasets).
- Transactional performance: SQLite is faster for simple point lookups and small transactional operations.
SQLite is the right choice for transactional embedded workloads (mobile apps, configuration storage, small-scale data). DuckDB is the right choice for analytical embedded workloads (data pipelines, dashboards, local query acceleration).
Where DuckDB Reaches Its Limits
DuckDB runs one database in one process on one machine. That design makes it fast to adopt and fast on a laptop. The same design sets its limits when a workload outgrows one machine or one writer. Several engineering teams published accounts of these limits in 2025 and 2026.
One Machine Sets the Ceiling
DuckDB parallelizes a query across the cores of one machine. It does not distribute a query across machines. A shared service must therefore size each instance for the largest query that it can receive.
That sizing is hard when users write the SQL. PostHog ran its warehouse product on DuckDB for about five months, with one instance for each pilot customer. Its team could not predict the CPU and memory that each customer query needed. Complex queries forced very large instances. The main PostHog analytics database runs on ClickHouse, not DuckDB.
DuckDB also has no network server of its own. PostHog served it over the PostgreSQL wire protocol and reported problems with reconnects, idle connections, and load balancing. In November 2026, PostHog moved the warehouse to Trino, a distributed SQL engine. Buttondown also took its analytics off DuckDB in 2026. Its team blamed its own data models in part. It also blamed the point "where some of the scaling really falls off the cliff" in DuckDB.
One Writer for Each Database File
One process at a time can write a DuckDB database file. Other processes can open the file read-only, but only when no process writes it. Inside the writer process, two transactions that change the same rows conflict, and one of them fails.
Other teams report the same limit. Microsoft's PyRIT project replaced DuckDB with SQLite in 2025, because DuckDB "limited PyRIT execution to a single notebook" at a time. A MotherDuck case study describes a team that "hit the concurrent writers limitation" in production and moved to the hosted MotherDuck service.
This model fits one application that owns its data. It fits poorly when ingestion and queries must scale independently. A cache that refreshes while it serves queries puts both loads on the same file and the same process. To add writers, a deployment must split data across more files, and each query must attach the files that it joins.
Memory Follows the Largest Query
DuckDB spills some operators to disk when memory runs short, so it can process data larger than RAM. The spill path has gaps. Index memory does not spill, and the memory limit does not cover every allocation. By default, DuckDB uses up to 80% of the memory on the machine. Bauplan also reported memory spikes when DuckDB worked with Arrow data.
Lakehouse Metadata at Scale
DuckLake keeps table metadata in a SQL database, such as PostgreSQL, and table data in Parquet files. It adds multi-writer tables to DuckDB, but its catalog design sets limits of its own. PostHog stored about 2 PB and 1 trillion rows in DuckLake, across 15.3 million snapshots.
At that size, a write to one table took more than three minutes. Each commit re-read the statistics for the whole catalog. More than 99% of those statistics rows belonged to tables that no longer existed. A cleanup made writes 30 to 50 times faster, but the stale rows returned. PostHog kept a fork of DuckLake to carry its fixes. Databox, which reads its tables with DuckDB, chose not to use DuckLake. Its team wrote that DuckLake "looked promising for analytics, but too early for production multi-tenant workloads" in March 2026.
Who Controls DuckDB
The MIT License lets anyone use, change, and fork DuckDB. Governance decides who sets the roadmap and who owns the name. The Stichting DuckDB Foundation, a Dutch non-profit, holds the core intellectual property and trademarks. A three-person board runs it: Hannes Mühleisen (chair), Mark Raasveldt, and Peter Boncz. Under the deed of incorporation, the board appoints and dismisses its own members, for indefinite terms. Supporting members can give input, but the foundation documents no vote for members or contributors.
Mühleisen and Raasveldt also co-founded DuckLabs, the company whose team drives DuckDB development. In August 2026, Amazon agreed to acquire DuckLabs. AWS says that both founders will keep leading the team and the technical direction of the project as part of AWS. The projects stay under the foundation and the MIT License. The foundation plans a Technical Advisory Board, which "can influence the direction" of the projects.
Other analytical engines use different models. Apache DataFusion is an Apache Software Foundation project. Its project management committee elects new committers from active contributors, and the foundation holds the trademark. Bauplan cited governance when it moved from DuckDB to DataFusion in 2025. Its team called DuckDB "more of an open-source product than an open-source project" in its migration write-up.
Signs a Workload Has Outgrown DuckDB
DuckDB remains a strong choice for notebooks, local files, tests, and single-user tools. The PostHog team still calls it "probably the best single-node tool for analyzing heaps of data" in the post that announced its move. Consider another engine when a deployment shows these signs:
- Instance sizes follow the largest query, and nobody can predict that query.
- Queries spill to disk often, or fail on memory limits.
- Refreshes and user queries compete for one writer process.
- Commit latency rises for batches of the same size.
- Catalog snapshots number in the millions.
- The team maintains a fork to carry fixes.
Alan West's analysis of the PostHog migration lists similar checks, with SQL to measure a DuckLake catalog.
Advanced Topics
Adaptive Compression in DuckDB
DuckDB's storage engine applies compression at the column segment level, choosing the most effective encoding for each segment based on the data distribution. The available compression schemes include:
- Constant encoding for segments where every value is identical
- Dictionary encoding for segments with low cardinality
- Bit-packing for integer segments with a narrow value range
- Frame-of-reference (FOR) encoding for segments with values clustered around a base
- Delta encoding for monotonically increasing sequences
- FSST (Fast Static Symbol Table) for string compression
The compression selection is automatic and per-segment, so different segments of the same column can use different encodings. This adaptive approach achieves good compression ratios without manual tuning, and the encodings are designed to be fast to decompress during vectorized scans.
Parallel Pipeline Execution
DuckDB's query execution model is built around parallel pipelines. The query planner decomposes a query into a series of pipelines, where each pipeline is a sequence of operators that can process data in a streaming fashion. Pipelines are separated by pipeline breakers: operators like hash joins and sorts that must consume their entire input before producing output.
Within each pipeline, DuckDB parallelizes execution by partitioning the input data across threads. Each thread processes its partition independently through the pipeline's operators, producing partial results that are merged at the pipeline breaker. This morsel-driven parallelism approach provides good load balancing across cores without the overhead of fine-grained synchronization.
For complex queries with multiple pipeline stages, DuckDB can execute independent pipelines concurrently. The scheduler manages thread allocation across active pipelines to maximize hardware utilization while respecting memory budgets.
Extension System
DuckDB supports a modular extension system that adds capabilities without bloating the core database. Extensions can add new data types, functions, file format readers, and storage backends. Notable extensions include:
- httpfs: enables reading Parquet and CSV files directly from HTTP/S3 endpoints
- spatial: adds geometry types and spatial functions
- json: provides JSON parsing and querying functions
- icu: adds Unicode collation and time zone support
- fts: enables full-text search with inverted indexes
Extensions are loaded on demand and can be installed from DuckDB's extension repository. This modular architecture keeps the core database small and dependency-free while allowing users to add functionality as needed.
From DuckDB to Spice Cayenne
Spice used DuckDB as a data acceleration engine in its SQL federation and acceleration platform. An accelerated dataset copied data from a source such as PostgreSQL, Databricks, Snowflake, or Amazon S3 into a local DuckDB file. Queries then ran against that local copy.
As customers accelerated more data, Spice hit the limits above. The single database file serialized concurrent writes, so ingestion under load queued. Memory overhead grew with dataset size. At large sizes, the single-file model set practical limits on how much data one dataset could hold. The Vortex engineering post describes these problems in detail.
How Cayenne Removes the Single-File Limits
Spice Cayenne is the accelerator that Spice built to replace DuckDB. It stores data in immutable Vortex files and keeps metadata in an embedded metastore. No dataset depends on one database file:
- Writes: A refresh stages new Vortex files, then commits them in one metastore transaction. Queries read the previous snapshot until the commit completes.
- Memory: A memory pool enforces limits for the whole runtime. Queries spill to disk instead of failing.
- Planning: One metastore query returns the schemas, snapshots, and file statistics that the planner needs. Pruning skips the files that a filter excludes.
- Execution: Apache DataFusion plans and runs each query, and Vortex returns Arrow data without extra copies.
In the Spice benchmarks, Cayenne ran TPC-H at scale factor 100 1.4 times faster than DuckDB, with nearly three times less memory. On ClickBench, Cayenne ran 14% faster and used 3.4 times less memory. The tests compared DuckDB v1.4.2 in file mode with Spice v1.9.0, on a 16 vCPU, 64 GiB instance with local NVMe storage.
Move a DuckDB Acceleration to Cayenne
Spice v2.4 makes Cayenne the default accelerator on Linux and macOS. It deprecates the duckdb accelerator and the DuckDB vector engine, and Spice v2.5 removes them. To move a dataset, set engine: cayenne and remove the duckdb_* parameters:
datasets:
- from: s3://my-bucket/orders/
name: orders
ready_state: on_load
acceleration:
engine: cayenne
mode: fileWith ready_state: on_load, queries do not fall back to the source during the first Cayenne load. Compare query results with the old acceleration before you delete the DuckDB file and its .wal file. An acceleration can hold rows that its source no longer has, so read the Cayenne migration guide first. Cayenne is not available on native Windows, so run Spice in Docker or WSL there.
The Cayenne Data Accelerator recipe accelerates a local copy of taxi trip data from S3 with Cayenne. Spice still reads DuckDB files as a source. The DuckDB Data Connector recipe queries an existing DuckDB database file of TPC-H data. For large tables in object storage, see data lake acceleration.
DuckDB FAQ
DuckDB and SQLite are both embedded, zero-dependency databases, but they target different workloads. SQLite uses row-oriented storage and processes one row at a time, making it well-suited for transactional workloads like mobile apps and configuration storage. DuckDB uses columnar storage and vectorized execution, making it orders of magnitude faster for analytical queries that scan, aggregate, and join large datasets. Choose SQLite for transactional embedded workloads; choose DuckDB for analytical embedded workloads.
DuckDB runs on one machine, and one process at a time writes each database file. Each instance must have enough memory for its largest query, which is hard to predict for user-written SQL. DuckLake catalogs can slow down as snapshots and statistics accumulate. PostHog and Bauplan both moved off DuckDB and cited these limits.
Yes, DuckDB uses the MIT License. The Stichting DuckDB Foundation, a Dutch non-profit, holds its intellectual property and trademarks. A three-person board runs the foundation and appoints its own members. Two of the three board members co-founded DuckLabs, which Amazon agreed to acquire in August 2026.
Partly. DuckDB spills some operators to disk when memory runs short, and it stores persistent tables on disk. Index memory does not spill, and the memory limit does not cover every allocation. All work still runs on one machine, so the largest query sets the instance size.
Spice v2.4 deprecates the DuckDB accelerator, and Spice v2.5 removes it. Spice Cayenne is the default accelerator from v2.4 on Linux and macOS. To move a dataset, set the acceleration engine to cayenne. Spice still reads existing DuckDB files through its DuckDB data connector.
DuckDB can query Parquet, CSV, TSV, and JSON files directly without first loading them into a database table. For Parquet files, DuckDB supports predicate pushdown and column pruning for efficient scans. DuckDB also integrates with Apache Arrow for zero-copy data exchange with Arrow-based data pipelines and applications.
Learn more about DuckDB and data acceleration
Guides and blog posts on analytical databases, data acceleration, and query performance with Spice.
Cayenne Migration Guide
Move DuckDB, Arrow, and SQLite accelerations to Spice Cayenne before Spice v2.5 removes those engines.
How we use Apache DataFusion at Spice AI
A technical overview of how Spice extends Apache DataFusion with custom table providers, optimizer rules, and UDFs.
Vortex at Spice AI: The Columnar Format for Data-Intensive Workloads
Why Spice moved its accelerations from DuckDB to Cayenne on Vortex, and how Cayenne handles writes, deletes, and memory.
See Spice in action
Walk through your use case with an engineer and see how Spice handles federation, acceleration, and AI integration for production workloads.
Talk to an engineer (opens in a new tab)


