Skip to content
audiotale.net
Sign in
GuidesGuide

What is DuckDB? How to query Parquet, its limits and when to use it

A plain guide to the in-process analytical database now under Amazon Athena: what it reads, how to run SQL on files, how it handles big data and where concurrency bites.

audiotale.net team

· 7 min read

Written by AI from the sources linked below. How we use AI

On this page
  1. In short
  2. Why people are asking
  3. What DuckDB is
  4. OLAP versus OLTP in one minute
  5. What it can read
  6. Try it: query Parquet with SQL
  7. Data bigger than memory
  8. Concurrency: the limit people hit first
  9. When to use it, and when not to
  10. What AWS has changed, and what it has not
  11. A short checklist
  12. Sources

In short

DuckDB is a free, open-source analytical SQL database that runs inside your own program or on your laptop instead of as a separate server. It is built for scanning and aggregating lots of data (OLAP), reads files such as Parquet, CSV and JSON directly, and can handle data larger than memory by spilling to disk. It is a poor fit for many programs writing to one database at once, although newer options exist for that. It is in the news because AWS has put it under Amazon Athena.

Why people are asking

On 1 December 2026, AWS put Amazon Athena powered by DuckDB into preview, and said it plans DuckDB for more of its analytics services. If you have only used Postgres, MySQL or a cloud warehouse, the obvious questions are what DuckDB is, why it is suddenly everywhere, and what you would use it for. This guide answers them from DuckDB's own documentation.

What DuckDB is

DuckDB's project site lists five properties.

  • Simple. It has no external dependencies, and building it needs only a working C++17 compiler. There is no server to install or maintain.
  • Portable. It compiles for Linux, macOS and Windows on x86 and ARM, from edge devices to large servers, and a WebAssembly build (DuckDB-Wasm) runs it in browsers.
  • Feature-rich. It supports complex SQL, window functions and a large function library, with ACID transactions through its own multi-version concurrency control (MVCC).
  • Fast for analytical work, because the engine is "columnar-vectorized": it stores data by column and processes batches of values per operation, not one row at a time.
  • Free. It is MIT-licensed, and the independent, non-profit DuckDB Foundation holds the project's intellectual property.

"In-process" is the idea that makes it different. By default DuckDB runs embedded inside the host process, so using it feels like using a library, not connecting to a database service. The project's page notes it has since moved beyond purely in-process use, through a protocol called Quack (more on that below).

OLAP versus OLTP in one minute

Transactional databases (OLTP) are tuned for many small reads and writes of individual rows: place an order, update a profile. Analytical databases (OLAP) are tuned for questions that touch a lot of rows but few columns: total revenue by month, the slowest endpoints this week. Storing columns together means a query that needs two columns out of fifty reads only those two, and processing values in batches cuts per-row overhead. DuckDB targets the second kind of work. It does not replace the database behind your web app.

What it can read

According to DuckDB's documentation, it works with:

  • its own single-file database format, which supports secondary indexes;
  • Parquet, JSON and CSV files, and files over HTTP(S) or S3, through extensions;
  • lakehouse table formats, including DuckLake, which the site says can scale to petabytes;
  • Pandas data, which the Python package can query without copying it.

That list is the reason many people use DuckDB as a "SQL for files" tool: you point it at the data where it already lives.

Try it: query Parquet with SQL

The Parquet documentation gives these patterns. Read one file (the function is optional when the name ends in .parquet):

SELECT * FROM 'test.parquet';
SELECT * FROM read_parquet('test.parq');  -- other extension

Read several files as one table, with a glob or a list:

SELECT * FROM 'test/*.parquet';
SELECT *, filename FROM read_parquet('test/*.parquet');
SELECT * FROM read_parquet(['folder1/*.parquet', 'folder2/*.parquet']);

Pushdown is automatic. Only the columns a query needs are read (projection pushdown), and filters are pushed into the scan and can skip parts of the file using zonemaps, if the file contains them:

SELECT id, amount FROM 'test.parquet' WHERE amount > 100;

Write results back out, optionally compressed:

COPY (SELECT * FROM tbl) TO 'result-snappy.parquet' (FORMAT parquet);
COPY tbl TO 'result-zstd.parquet' (FORMAT parquet, COMPRESSION zstd);

Snappy is the default compression. The column and table names here (id, amount, tbl) are placeholders from the documentation's style, not a real data set.

Data bigger than memory

DuckDB can process data larger than RAM by spilling to disk, for the blocking operators GROUP BY, JOIN, ORDER BY and window functions. The tuning guide says the temporary directory defaults to database_file_name.tmp for a persistent database and .tmp for an in-memory one, and you can change it:

SET temp_directory = '/path/to/temp_dir.tmp/';

The same page lists limits to know about: a query with several blocking operators can still run out of memory, string_agg() does not offload to disk, and some sorted aggregates on large data can also fail with out-of-memory errors. If an import or export of large Parquet or CSV data runs out of memory, setting preserve_insertion_order to false can lower memory use, at the cost that results without an ORDER BY may come back in a different order.

Other tuning facts from that page:

  • The default row group size is 122,880 rows, and a query needs at least k times 122,880 rows to use k threads, so small tables will not use many cores.
  • You can set the thread count with SET threads = X. The guide suggests lowering it if HyperThreading makes DuckDB launch too many, and raising it to roughly two to five times the core count for remote compressed CSV or JSON files.
  • Compression applies by default only to persistent databases. In the guide's TPC-H query 1 example at scale factor 30, the query ran in 0.23 seconds on an uncompressed in-memory database and 0.15 seconds on a compressed in-memory or persistent one. A compressed in-memory database needs an explicit CHECKPOINT after loading.

The guide's overall message is that DuckDB aims to perform well out of the box and most workloads need no tuning. Treat that example as one benchmark on one query, not a promise about your data.

Concurrency: the limit people hit first

This is where DuckDB differs most from a server database. The concurrency page sets out the rules.

  • One process, read-write. One process can read and write. Inside it, several threads can write at once. Appends never conflict, even on the same table. Threads can update separate tables or separate subsets of one table, but if two threads edit the same row at the same time, the second fails with a conflict error and you rerun the transaction.
  • Many processes, read-only. Multiple processes can read the same file if it is opened in read-only mode (access_mode = 'READ_ONLY'), but none can write.
  • Many processes, writing. Two routes exist. Quack turns DuckDB into a client-server database and lets multiple processes write to the native format; the documentation says it first shipped in DuckDB 1.5.3 and is polished in 2.0. Alternatively DuckDB instances can coordinate through a central PostgreSQL catalog using DuckLake, whose version 1.1 the documentation calls intended for production use.
  • File locks. DuckDB uses file locks, so be careful with a database file on a shared directory, network storage, or accessed from different operating systems or file systems.

If your design has many independent services each writing to the same database file, plan for one of those multi-process options, or use a server database for that part.

When to use it, and when not to

Reasons to reach for DuckDB:

  • You analyse files on your laptop or in a job, and a database server would be overhead.
  • You want SQL over Parquet, CSV or JSON without loading them into another system first.
  • You are prototyping queries locally that you may later run at larger scale (the idea behind AWS's "develop locally and scale on Athena" pitch).
  • Your pipeline is a single process that reads, transforms and writes.

Reasons to hesitate:

  • Many concurrent writers on one database (see the previous section).
  • A transactional application whose workload is lots of single-row reads and writes.
  • Data that depends on a feature the documentation flags as limited, such as operators that cannot spill.

DuckDB's own page makes the same point in a sentence: no one-size-fits-all system exists, and DuckDB makes trade-offs for analytical workloads.

What AWS has changed, and what it has not

AWS announced in August 2026 that it would acquire DuckLabs, the company behind DuckDB's development, and said at the time that it was not acquiring the open-source project, which stays MIT-licensed under the DuckDB Foundation. In December, AWS put a DuckDB engine in Athena preview. Per The Register, AWS says it plans to extend DuckDB to Amazon EMR and Amazon Redshift. That does not change how you use DuckDB locally. It does mean cloud tooling you already use may speak DuckDB's SQL dialect soon. If you are on Athena, test existing queries before switching a workgroup, since the dialect differs from engine version 3.

A short checklist

  1. Start with one file: query it with SELECT * FROM 'file.parquet'.
  2. Select only the columns you need, and filter early, so pushdown does the work.
  3. For big jobs, check the temporary directory has room, and watch for queries with several blocking operators.
  4. Open shared files read-only, and decide before you build how multiple writers will coordinate.
  5. Benchmark on your own data before trusting any speed claim, including those in this guide.

Sources

Written by

audiotale.net team

The official account of the people who run audiotale.net: announcements, conversation starters and the newsroom's drafts. Posts written with AI say so. Every other account here is a real person.