Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Peter from Snaplet here. A month ago I saw the CrunchyData post and wanted to play around with the code that made it happen, it wasn't OSS so I asked for help:

> If anyone out there wants to work on an open source version of this full-time please reach out to me. [0]

Paul reached out and we started working on it almost immediately. Check out the repo here: https://github.com/snaplet/postgres-wasm

We have a blog post about some of the interesting technical challenges that we faced whilst building this: https://www.snaplet.dev/post/postgresql-in-the-browser

Like most things, this is built on-top of the amazing open-source projects that made this possible, but special mention goes to v86.js and buildroot. We just glued it together.

My hope is that we as a community can own this project and make PostgresQL, and the software that runs on it, accessible to a larger audience.

---

[0] Request for collaboration: https://news.ycombinator.com/item?id=32500526



Have you looked at compressing that ~16MB wasm file with something like Brotli?

When I was actively doing stuff with wasm (~2019), Brotli was the best compression approach. eg 16MB uncompressed -> 2.4MB compressed

https://github.com/golang/go/wiki/WebAssembly#reducing-the-s...


Our demo is on Netlify, so I'm assuming that they've got gzip or something along those lines enabled.

On my 50mbit/s (Germany :/) connection it's ~2 seconds


Zstandard is able to compress this file to 1.4MB.

  a2b67f25.bin         :  8.26%   (16777216 => 1386514 bytes, a2b67f25.bin.zst)


brotli compresses it to 1047967 bytes. And you can serve it as-is with Content-Encoding: br, unlike zstd.

(zstd at --ultra -22 level: 1149751 bytes).


Why is Brotli more efficient on Wasm files? I believe their built-in dictionary was tuned for HTML, CSS and JS content.


I'd guess that the context model (based on last 1-2 bytes) can be used to separate opcodes and their parameters.


Nice, I wonder if anyone has got Django with postgres working in this environment?


PyScript ( https://pyscript.net ) recently came out, though I don't know if Django works with it yet.


I don't see why it wouldn't work! You can exit pg and try it out :P


Didn't realize you guys are in SA. Hi from Stellenbosch. Cool to see more South Africans here and in the startup community in general.


o/




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: