Live data from Hacker News

Postgres WASM

supabase.com

161–170 of 190 posts

Re: Postgres WASM

#161

Hey HN, we’re excited about this launch. This was a collaborative effort with the team at Snaplet [0]. postgres-wasm is an embeddable Linux VM with Postgres installed, which runs inside a browser. It provides some neat features: persisting state to browser, restoring from pg_dump, logical replication from a remote database, etc. The idea was inspired by CrunchyData’s HN post about a month ago [1]. We love the possibi…

Do you have a benchmark of load times after the includes are cached? Depending on whether it's 1s it will make the applications for this very different.

Re: Postgres WASM

#162

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…

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...

Zstandard is able to compress this file to 1.4MB.

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

Re: Postgres WASM

#163

Earlier quoted context omitted.

I've also noticed a number of fun WASM projects this year. I think the underlying WASM features that enable all this have been around for a while, so the breakthroughs are probably coming from the community and ecosystem growing incrementally and synergistically, building on each other's work and collaborating.

I believe they are coming from people wanting to push people to get confortable with running binary blobs in their browsers so they can suck up all that juicy personal information leaked by browsers.

Sadly, I'm not sure you really need binary blobs to "suck up all juicy personal informations" in the first place.

Re: Postgres WASM

#164

Earlier quoted context omitted.

I've also noticed a number of fun WASM projects this year. I think the underlying WASM features that enable all this have been around for a while, so the breakthroughs are probably coming from the community and ecosystem growing incrementally and synergistically, building on each other's work and collaborating.

I believe they are coming from people wanting to push people to get confortable with running binary blobs in their browsers so they can suck up all that juicy personal information leaked by browsers.

WASM is unnecessary and unsuitable for such a purpose, since it would need to go through JavaScript to get that information anyway. It's far more sandboxed than JS, and cannot get any more personal data than JS can already.

Re: Postgres WASM

#165

Earlier quoted context omitted.

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...

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).

Re: Postgres WASM

#166

Earlier quoted context omitted.

Doesn’t pg_dump/pg_restore work across versions? (So long as the CLI tools are the latest version). I guess version compatibility could be an issue in theory, but I’m yet to hit into a backwards compatibility issue with Postgres.

I wish. You'd think it'd just be able to check the db to see if there's any schema or procedure incompatibility, but it doesn't. Instead, it goes "Remote uses version X and you're using version Y, sort that out" and then it exits.

Oh, that's incredibly unhelpful!

Re: Postgres WASM

#167

Hey HN, we’re excited about this launch. This was a collaborative effort with the team at Snaplet [0]. postgres-wasm is an embeddable Linux VM with Postgres installed, which runs inside a browser. It provides some neat features: persisting state to browser, restoring from pg_dump, logical replication from a remote database, etc. The idea was inspired by CrunchyData’s HN post about a month ago [1]. We love the possibi…

Do you have a benchmark of load times after the includes are cached? Depending on whether it's 1s it will make the applications for this very different.

We don't have any benchmarks yet, but it's definitely something we should add/automate now that we're past the "POC" phase

Re: Postgres WASM

#168
post #127

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…

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/

Re: Postgres WASM

#169

Earlier quoted context omitted.

> How much work was done supporting the VM All of the heavy lifting here is done by v86: https://github.com/copy/v86 v86 can be used for a number of things besides Postgres - things like Repls or other entire applications are definitely achievable. Networking between Postgres and the internet was a lot of work, and Mark came up with a neat solution detailed in the blog post. This solution can be used for any other ap…

This is cool, but is also somewhat saddening too. The dream is a real wasm native postgres; in fact to get all of postgresql's cool shared mem proccess stuff and make it something like shared array buffer! The dream is also that WASI interface and new-school OS interfaces like memfd_create are increasingly aligned. Instead of rationalization our interfaces, however, it's just emulation layer on top of emulation layer…

I think we'll see this - and it would be amazing to get someone to work towards this - once there is an amazingly compelling use case that resonates with the market, then I think there's room for optimization!

Re: Postgres WASM

#170
post #115

There have been a lot of new WASM things popping up on HN. Was there some major new change the enabled all this?

I've also noticed a number of fun WASM projects this year. I think the underlying WASM features that enable all this have been around for a while, so the breakthroughs are probably coming from the community and ecosystem growing incrementally and synergistically, building on each other's work and collaborating.

It does have a similar feel to how things went when DHTML was becoming The Thing. People would share increasingly elaborate demos that built on older stuff until there were whole web applications. Then AJAX happened and it was all over. It seems like WASM is finally fulfilling all those early fantasies of the browser as the operating system.
Post reply on HN