Database / DuckDB Interview questions
How does DuckLake's data inlining solve the small-file problem?
The "small-file problem" in traditional Parquet-based lakehouses happens when frequent, small write transactions (like streaming inserts arriving one at a time or in tiny batches) each generate their own small Parquet file, quickly accumulating an enormous number of tiny files that hurt both storage efficiency and query performance, since reading many small files carries more per-file overhead than reading fewer, larger ones.
-- small, frequent inserts stay "inlined" in the catalog instead of -- immediately becoming individual tiny Parquet files INSERT INTO events VALUES (...); -- small transaction, gets inlined
DuckLake's data inlining addresses this by letting small transactions' rows (and delete "tombstone" records) live directly as rows inside DuckLake's own catalog database tables, rather than immediately being written out as a brand-new small Parquet file per transaction. A query reads a single unified logical view that transparently combines the inlined, metadata-resident rows with the existing Parquet files, so query correctness isn't affected by where a given row's data currently physically lives.
Only once a transaction's row count crosses a configured threshold does DuckLake write that data straight to Parquet immediately; smaller transactions accumulate as inlined rows until a maintenance operation, either an explicit call to flush inlined data or a routine checkpoint, consolidates them into proper, appropriately-sized Parquet files, converting many small inlined writes into fewer, larger files without requiring every individual small write to pay that cost immediately.
More Related questions...