4 ms·
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:
by pistoriusp 4y ago
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 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 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 https://news.ycombinator.com/item?id=32500526
- justinclift 4y agoHave 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-size-of-wasm-files https://github.com/golang/go/wiki/WebAssembly#reducing-the-s...
- pistoriusp 4y agoOur 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
- ankraft 4y agoZstandard is able to compress this file to 1.4MB. a2b67f25.bin : 8.26% (16777216 => 1386514 bytes, a2b67f25.bin.zst)
- dchest 4y agobrotli 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).
- stuaxo 4y agoNice, I wonder if anyone has got Django with postgres working in this environment?
- pistoriusp 4y agoI don't see why it wouldn't work! You can exit pg and try it out :P
- collinmanderson 4y agoPyScript ( https://pyscript.net https://pyscript.net ) recently came out, though I don't know if Django works with it yet.
- sgt 4y agoDidn't realize you guys are in SA. Hi from Stellenbosch. Cool to see more South Africans here and in the startup community in general.
- pistoriusp 4y agoo/