Decision in brief
Choose DuckDB for analytical scans where a single process can run the work near local files, Parquet or exported datasets. Choose PostgreSQL for a shared online application with independently connecting clients and transactional updates. Keep PostgreSQL authoritative and add DuckDB for reporting when a load test shows enough benefit to justify extract or connection costs.

Start with the write and read paths
PostgreSQL is a client-server transactional database. DuckDB is an analytical database that can run in an application process and push eligible filters and column selection into Parquet reads. For a native DuckDB file opened in read-write mode, one writer process can use multiple threads. DuckDB 2.0 documents Quack as a separate client-server option for multiple processes. Include its deployment and contention behavior if you test it.
| What you need | Start here | Limitation to test |
|---|---|---|
| Read a directory of Parquet and aggregate ad hoc | DuckDB on the machine running the analysis | Peak memory, spill storage and cold versus warm reads |
| Offer an API with concurrent mutations and relational constraints | PostgreSQL with an application connection pool | Write p95, retries, constraint integrity and recovery |
| Occasional reports over PostgreSQL data | Try SQL on a read replica or via DuckDB with a read-only source | Source CPU and I/O, connection limits, operator pushdown and query timeouts |
| Predictable recurring heavy scans | Test a PostgreSQL-to-Parquet export queried by DuckDB | Data freshness, reconciliation, backfills and recovery of the export |
What two HN implementations changed
uwemaurer shared a Java-to-PostgreSQL bulk-load comparison that included DuckDB and Arrow on some paths. The post reported binary COPY winning in that setup. The comparison included data conversion and transfer, making it a useful example of why execution time alone misses the cost of a hybrid system.
In the HitKeep Show HN, examo described using an embedded DuckDB for page-view analytics to operate fewer services. The design targeted reporting for a handful of sites. Test whether your analytics fit that serving pattern before assuming it applies to a shared application database.
Measure the application, the report, and the handoff
Use the same representative schema, record count and filters across variants. Report cold and warm runs separately. Account for data extraction or connection setup in end-to-end timing.
- Replay a mixed transactional workload in PostgreSQL with expected client concurrency. Record write p95, rejected or retried transactions, CPU and storage.
- Run three real reports in PostgreSQL and DuckDB on the same snapshot, for example a selective rollup, a full scan and a join. Verify totals and measure elapsed time and peak memory.
- Test a read-only DuckDB connection or a staged export. Log extraction time, source CPU during reporting, output reconciliation, and the maximum age of data on the dashboard.
- Keep PostgreSQL alone if operational simplicity meets the report target. Add DuckDB only if gains fit the freshness and recovery limits and the read path preserves online transaction latency.