-
I am just wondering why the decision was made to wrap DuckDB around a node.js server. If duckdb is a cpu process, wouldn't that block the Node.js event loop? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We chose Node for the server because the part that runs in the browser is all JS already so we didn't have to use multiple toolchains. Having said that, the mosaic server is just a very thin wrapper around DuckDB. In our experiments it doesn't seem to be an issue that the DB is running in the same process. DuckDB uses multiple threats so it doesn't seem to block. I implemented a similar wrapper in Python for the widget, and you can find the code at . I can imagine that we implement a server in e.g. Rust in the future. |
Beta Was this translation helpful? Give feedback.
We chose Node for the server because the part that runs in the browser is all JS already so we didn't have to use multiple toolchains.
Having said that, the mosaic server is just a very thin wrapper around DuckDB. In our experiments it doesn't seem to be an issue that the DB is running in the same process. DuckDB uses multiple threats so it doesn't seem to block. I implemented a similar wrapper in Python for the widget, and you can find the code at
mosaic/packages/widget/mosaic_widget/__init__.py
Line 66 in 1590456