Live data from Hacker News

Quack: The DuckDB Client-Server Protocol

duckdb.org

81–90 of 91 posts

Re: Quack: The DuckDB Client-Server Protocol

#81

I was just wishing something like this existed last week. What timing. I'm piping sensor readings into duckdb with a deno server, and couldn't use duckdb -ui to look over the data without shutting down the server. I had no interest in using the server to allow me to look at the contents of the db, so I was just going to live with it for now. This perfectly solves that, along with several other similar kinds of proble…

Can you expand more on how you use it in your workflows? I'm very interested but I haven't incorporated it into my problem solving mindset yet so I don't even know what use cases I could map to it.

I think one of the most common and elevating methods of using it has been combining disparate sources of data into multiple tables of a single instance so I can run queries locally and use DuckDB as a bridge between platforms.

Yesterday I pulled a bunch of data from Sentry, multiple log groups on AWS, and Github to figure out when some incidents occurred and how events correlated or caused each other.

Doing that in other tools is perfectly possible and fine, but the overhead of setting up a docker container or understanding requirements for setup or needing an account or whatever bespoke query language makes me lose interest immediately.

With this I only need to know SQL, optionally duckdb -ui, roughly how to ingest the sources correctly so they can be joined easily (in this case just make sure everything is a UTC time series), and I'm mostly off to the races. It works fine.

There are more sophisticated and cool and whatever ways to do this, but with Claude as an assistant you can do this with like 3.5 brain cells and get absolutely incredible results.

DuckDB is awesome partially because of how effortless it is and how little ceremony there is. Like SQLite, but even less friction. Having duckdb -ui as a little work bench is brilliant.

Re: Quack: The DuckDB Client-Server Protocol

#82
post #29

Earlier quoted context omitted.

Right, I get that usecase. You have to crunch numbers that sit somewhere, and store the outputs in the same place. DuckLake is great for that. But where does this DuckDB client-server setup fit in?

Sounds like it means you don't have to wire up the RPC server yourself anymore? Just build a docker container that invokes this quack server command, expose it over the network and connect to it from remote clients using your own access controls? Ducklake handles the metadata and storage, but a local duckdb instance connected to it still has to do the compute itself. This lets you federate access to the compute. Fun…

[dead]

Re: Quack: The DuckDB Client-Server Protocol

#83

Earlier quoted context omitted.

Sounds like a good use case for CRDTs, which would also enable offline editing

In my use case I have 2 or 3 users editing the same database concurrently and they all want to see other's updates in near real time (within a second or two). Would a CRDT support that? It would be great if it did and I could just keep using XML to persist everything with no server. But that sounds unlikely.

Highly suggest you take a look here: https://github.com/yjs/yjs

CRDT can absolutely do what you’re asking.

Re: Quack: The DuckDB Client-Server Protocol

#85
What drives such a high throughput difference between Quack and Arrow on high-volume operations ?

I'll try to search from source/Github, reply appreciated though, for example:

- when DuckDb bulk exports a table, does Quack benefit from pre-existing compression/encodings/0-copy where Arrow requires decode+re-encode ?

- the post mentions parallel reads, is the level of parallelism the same on Arrow vs Quack here ? Running the high throughput benchmark at resource saturation with increasing number of concurrent bulk-read clients would be more transparent

Re: Quack: The DuckDB Client-Server Protocol

#89
post #77

Earlier quoted context omitted.

It’s not, but you could do something like https://litestream.io/ and just continuously replicate it to pretend to be multi-user

Does SQLite + replication have any advantages over client-server, for someone not already using SQLite?

Trivial deployment model, can avoid owning/managing your own server, easier coding in the sense that no-network means you can do normally-psychotic things like N+1 queries and single-row inserts and get away with it.

SQLite/DuckDB actually enables a bunch of normally-illegal behavior when you compare to normal databases. Backups is just copy&paste of a file; spamming queries willy-nilly becomes cheap; you can version the whole DB in git (can’t diff it properly.. but you can do cross-db queries with SQLite ATTACH); locking concerns goes out the window because it’s single-writer anyways.

But if I were actively trying to support multiple users with a single source of truth, I’d probably default to Postgres. If it’s single-user, default to SQLite/DuckDB. If it’s single-user with multiple devices, default to SQLite + replication.

Re: Quack: The DuckDB Client-Server Protocol

#90
post #89

Earlier quoted context omitted.

Does SQLite + replication have any advantages over client-server, for someone not already using SQLite?

Trivial deployment model, can avoid owning/managing your own server, easier coding in the sense that no-network means you can do normally-psychotic things like N+1 queries and single-row inserts and get away with it. SQLite/DuckDB actually enables a bunch of normally-illegal behavior when you compare to normal databases. Backups is just copy&paste of a file; spamming queries willy-nilly becomes cheap; you can version…

That is helpful, thank you.
Post reply on HN