top | item 47070446

Stoolap/Node: A Native Node.js Driver That's Surprisingly Fast

27 points| murat3ok | 11 days ago |stoolap.io

23 comments

order

dspillett|10 days ago

> But notice the pattern: SQLite’s wins are on simple, single-row operations where both databases are already sub-millisecond. Stoolap’s wins are on the analytical and complex queries where the difference is 10x to 100x+.

So for a great many workloads, particularly multi-user, SQLite will be faster overall, as most application workloads will have many simple single/few row lookup operations per single/few row update operations, and an order of magnitude less complex analytical queries.

But this should be much faster for genuine analytical operations, and better suited to them due to support for things like temporal storage and queries.

Basically the age-old distinction between optimising for OLTP or OLAP operations.

murat3ok|10 days ago

Try it first. I hope you can give a shoot.

z3t4|11 days ago

I dont think the micro benchmarks are fair, as it really doesn't matter if something takes 0.01 ms or 0.001 ms even if its 10x faster.

pfix|11 days ago

Until it does ;)

But I still agree - if the benchmark was in memory, Stoolap might be optimized for speed. Sqlite is optimized for persistence, so you have to benchmark on disk and compare how it performs when writes fail.

moralestapia|10 days ago

You probably have not been exposed to environments where code performance matters.

I can tell you, for sure, that 0.01ms -> 0.001ms is a massive win in plenty of these environment.

Examples:

* embedded systems

* GPU code

* tight loops in C/Rust

and probably hundreds of other examples.

ignoramous|10 days ago

> No serialization overhead. Just your Node.js process talking directly ... through native bindings.

NAPI-RS has no serialisation overhead?

petesergeant|11 days ago

Stoolap looks pretty interesting, anyone want to share their experience of using it?

gomoboo|11 days ago

Never used it but I’ll chime in that the naming choice is unfortunate. For me as an English speaker it collides with stool, a term for excrement.

pdyc|11 days ago

interesting, github says works for both olap+oltp but it was for go, does the same apply to rust as well? I want to try it in browser is wasm available somewhere or is there any plan to support it? [Edit] looks like it is available for browser here https://stoolap.io/playground/ i will be trying it with my product this weekend, excited to see how it goes.

tekkk|10 days ago

But what is stoolap's binary size? Specifically, WASM size? wa-sqlite is 1.2 MBs.

ramon156|10 days ago

Blog post written with an LLM, a project that went Go -> Rust -> Node? Also, is it really native? Does it not bind to your already built Rust tool?

I guess I'm a bit confused but don't want to read AI fuzz further

kitd|10 days ago

Blog post written with an LLM

What makes you say that?

a project that went Go -> Rust -> Node?

The DB went from Go to Rust. The Node part is the Node DB driver

Does it not bind to your already built Rust tool?

It's in the 3rd paragraph.

I guess I'm a bit confused but don't want to read AI fuzz further

Personally, I'd learn to get used to it.