Last couple of years, since my early retirement, I’ve been experimenting with building a document database that has a wasm runtime embedded into it. And Planck, a document database with a wasm runtime baked in, is the result of that.
The idea was simple. What if we eliminate the separate service layer and embed it into the database itself, where the data actually resides. I benchmarked it and found that it’s around 4.5x faster than node/express/mongo for an exactly similar workload.
Planck ships as a set of a few small binaries:
- planck, the server.
- planctl, manages various tasks like ddl, export/import, backup/restore, app initialisation, build and deployment, and compiles .zsx to .zig during the build.
- workbench, a Web UI to manage everything that’s deployed, like Scheduling Backups, WAL Truncation, Garbage Collection, Export/Import and more.
Planck also has features like async replication for read-replicas, WAL streaming to network locations, and change-streams that can be used for server side events via ssehub.
Everything is built using Zig. You can build wasm apps using schnell-zig and ssehub that can serve hypermedia as well as JSON.
Give it a try, download the binaries, follow the instructions to set up the Planck System, and run perf-compare to see the performance for yourself.
- Releases · plancksystems/plancks · GitHub
- GitHub - plancksystems/perf-compare: Apps for Performance Comparison with Node/Express/MongoDB · GitHub
If the idea resonates, come join to take it further.
PS: Some of the trickier components, like the zsx compiler and the pql builder, were built with the help of AI agents.