DuckDB's Quack Protocol Ditches Row-by-Row Overhead for Streaming Columnar Results
DuckDB's new HTTP-based Quack protocol addresses inefficiencies in legacy database protocols by streaming query results in batches of column data, allowing developers to consume results as they are produced rather than waiting for full execution.

Legacy database protocols predate the era of big data and continue to operate with significant inefficiencies. Many transmit query results one row at a time, duplicating metadata such as column names and data types for each individual row. According to Guillermo Sánchez Dionis, product team lead at DuckLabs, this approach creates "quite a bloated message." When handling large result sets, this redundancy becomes a substantial performance penalty.
DuckDB's response to this problem is Quack, an HTTP-based protocol designed to transmit query results in columnar batches as the database engine generates them. The protocol entered preview in May and reached production status in October as part of DuckDB 2.0.0 LTS. Sánchez Dionis discussed the protocol's design and capabilities during a recent episode of The New Stack podcast, recorded at DuckLabs' Amsterdam office.
How Database Protocols Work
A database protocol establishes the formal rules and message structures governing communication between client applications and database servers. It functions as a specialized interface enabling software to transmit SQL queries securely, retrieve structured data tables, and coordinate transactions across networks. The protocol manages connection establishment, user authentication, query formatting, data encoding, and error handling.
The Limitations of Legacy Design
Most existing protocols were engineered before big data became prevalent, optimized for systems that operated with serialized rows rather than columns. Sánchez Dionis points out that these protocols introduce unnecessary overhead by repeating column types and column names alongside every row. "It becomes quite a bloated message. That already makes the protocol not only not good for analytical systems, but it's also quite heavy," he states.
While newer protocols adapted for analytical workloads did adopt columnar approaches, they retained inefficient practices. "They were still doing things like serializing one value at a time and other things that are really not efficient," Sánchez Dionis explains. "Modern systems are trying to converge on using vectorized execution to be able to serialize more values at a time and trying to use more efficient representations of columnar data formats to send over the wire."
Quack's Approach
Quack represents DuckDB's HTTP-based client-server protocol, with its initial production release arriving in DuckDB 2.0.0 on October 21. This milestone marks Quack's graduation from preview status and introduces several features aimed at developer convenience:
- The CONNECT statement permits developers to attach to and query a remote Quack server using standard SQL syntax.
- A new -serve CLI flag launches a Quack server instance directly from the command line, while -connect establishes connections to existing servers.
- Multiple clients can simultaneously write to the same database, with DuckDB's multi-version concurrency control (MVCC) managing transaction isolation.
Streaming and Efficiency
Quack leverages DuckDB's data chunks, the database's columnar data representation, and serializes them with the efficiency gains of a vectorized engine. The protocol's defining characteristic is its streaming approach: rather than waiting for query execution to complete before serializing all results, Quack sends results as the engine produces them. "Once you start producing results, instead of waiting for the query execution to end and then serializing all of the results at once, you serialize and send results as they are emitted by the engine," Sánchez Dionis explains. "Therefore, the client can keep consuming results without having to stop the engine."
From a developer perspective, this streaming capability requires no special handling. "You run a query from the comfort of your laptop, and you just get streaming results back," Sánchez Dionis says. "I think the biggest advantage that you will see is you will have a very small memory footprint."
I think the biggest advantage that you will see is you will have a very small memory footprint
Guillermo Sánchez Dionis, DuckLabs product team lead
Quack can be deployed wherever needed—installed on a developer's local machine or distributed across multiple servers. Multiple clients on the same system can communicate with each other through the Quack extension. The infrastructure overhead of running Quack servers remains minimal, representing one of the protocol's most significant efficiency advantages.
The DuckLabs team plans additional improvements to Quack in forthcoming DuckDB 2.0 patch releases, focusing on strengthening server-side stability.