Remix.run Logo
markusw 3 days ago

While I really like DuckDB, I wouldn't use it for OLTP workloads.

I'm curious, when do you want to treat your Postgres like SQLite? :-) That's basically the opposite of what I was thinking of in the article.

srameshc 3 days ago | parent [-]

One of our web apps need a small subset of data from Postgres and we use DuckDB WASM to keep it clost to front end. Yes, I agree with not using it for for OLTP workloads. But instead of installing like author mentions in the post, this is a light replacement that works perfectly if you need a Postgres like DB in your app. Just have to add a new file, INSTALL postgres, LOAD postgres,

ATTACH 'dbname=mydb user=dbname host=25.25.25.25 password=aaaa AS db (TYPE postgres, READ_ONLY);

You can CREATE TABLE my_duck_table_stream AS SELECT * FROM db.table_stream;

It's just fun

markusw 3 days ago | parent [-]

I had no idea that was possible. I'll keep that in mind if I need a similar workflow. DuckDB is awesome. :D