Indexer and searcher as WASM Apps
WASM-Apps finally seems to fulfil the promises of serverless:
- they really scales up/down instantly within less than 1ms (only when request is incoming)
- are secure by design
- are vendor neutral (no login) and could run anywhere e.g. via wasmtime
- could be made of components of even different programming languages (interconnecting at highspeed and soon even async with next version of wasi P3)
good overview needed? https://www.youtube.com/watch?v=PexRsU8sVIs
=> since this looks like a perfect fit to Nixie-Search, maybe one could think about making Nixies indexer and searchers in the future also available as Wasm-Apps
The way to how this could be made possible: Lucene -> GraalVM /Quarkus was possible in 2020: e.g. https://www.morling.dev/blog/how-i-built-a-serverless-search-for-my-blog/
GraalVM -> WASM since March 2025: https://2025.wasm.io/sessions/the-future-of-write-once-run-anywhere-from-java-to-webassembly/
As for GraalVM - yes, I have a plan to make it work. Actually I already have a branch with graalvm experiments :) The use-case is very similar to the "serverless search" article you've shared:
- minimalistic graalvm-based docker container with only alpine + nixiesearch binary.
- immutable indexing: index (and all embedding/ranker models) is part of a docker container to minimize startup latency.
- after reindexing you redeploy lambda with a newer container version, and that's it.
But it should all be well documented with a easy-to-run demo.
As for WASM - it's hard for me to imagine a valid use case. Running nixiesearch in browser? Targeting JS runtime of AWS Lambda?
As for GraalVM - yes, I have a plan to make it work. Actually I already have a branch with graalvm experiments :) The use-case is very similar to the "serverless search" article you've shared:
* minimalistic graalvm-based docker container with only alpine + nixiesearch binary. * immutable indexing: index (and all embedding/ranker models) is part of a docker container to minimize startup latency. * after reindexing you redeploy lambda with a newer container version, and that's it.But it should all be well documented with a easy-to-run demo.
This sounds pretty awesome!! Looking forward to it.
As for WASM - it's hard for me to imagine a valid use case. Running nixiesearch in browser? Targeting JS runtime of AWS Lambda?
WASM has grown out the browser. I’m (only) thinking about serverside usecases. WASM Apps today can run anywhere: in browser, in serverless, in Kubernetes, on the edge... many people already think they may be the successor of todays containers... see e.g. https://www.cncf.io/blog?_sf_s=wasm
this gives also a good overview of what is possible and already done with wasm: https://wasmcloud.com/blog/2024-10-15-beyond-byoc-wasmcloud-everywhere-platform/
Yes I've played with WASM quite a lot. But I mean which particular benefits WASM will give to Nixiesearch use-cases, compared to GraalVM native image, apart from the awkward ability to run the whole thing locally in the browser? :)
Yes I've played with WASM quite a lot. But I mean which particular benefits WASM will give to Nixiesearch use-cases, compared to GraalVM native image, apart from the awkward ability to run the whole thing locally in the browser? :)
- you can run it on more places and edges like in Bowser (if really wanted), node, fermyon/Akamai, in general its more "universal"
- not sure about performance (coldstart)/resource usage GraalVM is already good- maybe Wasm is still better (couldn’t find any benchmark yet)
- maybe security is also a benefit (I’m not deeply in the GraalVM world, but on the WASM site this is pretty good)
- if one make it possible in general, people could build versions of searcher and indexer as components sticking to a standard
harnessin their system - maybe some others :-)
Of course its not a very short term thing, the idea of this issue was to have this in mind as future opportunity and making no architecture decisions in the opposite direction...