Hacker News new | ask | show | jobs
by nitsky 1350 days ago
This is a really exciting milestone for WASM! Has anyone tried compiling postgres for wasm32-wasi and implementing a wasi-compatible interface for the file system and other OS bits postgres needs? I think that would be a big improvement.
1 comments

Supabase developer here. I worked on this project with the guys over at Snaplet.

One thing we are working on is putting postgres on an alternative filesystem using 9p. There's some really cool work by humphd that creates a filesystem inside IndexedDB[0]. We'd also like to maybe use the browser filesystem component to let you store the database on the host device in a path of your choosing. Not sure if these are possible yet, though.

[0] https://humphd.github.io/browser-shell/

Using IndexedDB, the forthcoming SQLite support in Chrome, or the browser filesystem components all might be good paths. Either way, what do you think about using WASI instead of Linux? I think it would reduce the overhead significantly.
I'm not familiar with WASI but I'll take a look. We're using Buildroot now and it's nice and small, but we could make it smaller by optimizing the kernel. Now, if I only know how to optimize the kernel without breaking things :)

Where's all those kernel hackers? Your help, we need. :)