Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
copycat
Generate deterministic fake values: The same input will always generate the same fake-output. (by snaplet)
-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Greenplum
Greenplum Database - Massively Parallel PostgreSQL for Analytics. An open-source massively parallel data platform for analytics, machine learning and AI.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
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 possibilities of Postgres+WASM, and so Supabase & Snaplet teamed up to create an open source version. The linked blog post explains the technical difficulties we encountered, and the architecture decisions we made.
We’re still working hard on this, but it’s at a good “MVP” stage where you can run it yourself. Snaplet are working on a feature where you can drag-and-drop a snapshot into your browser to restore the state from any backup. Supabase are exploring ways we can run the entire Supabase stack inside the browser. You can find the Snaplet repo here [2], and the Supabase fork here [3]. There’s very little difference between these two, we just have a different browser UI.
Both Supabase team and the Snaplet team will be in here commenting if you want to know anything else about the technical details.
[0] Snaplet: [https://www.snaplet.dev/](https://www.snaplet.dev/)
[1] Crunchy post: [https://news.ycombinator.com/item?id=32498435](https://news....
[2] Snaplet repo: [https://github.com/snaplet/postgres-wasm](https://github.com...
[3] Supabase fork: [https://github.com/supabase-community/postgres-wasm](https:/...
I believe the team at Wasmer have worked on something like this:
https://github.com/wasmerio/wasmer-postgres
It only works for PG10, but I can't imagine it will take much effort to bring it up to the latest version
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 possibilities of Postgres+WASM, and so Supabase & Snaplet teamed up to create an open source version. The linked blog post explains the technical difficulties we encountered, and the architecture decisions we made.
We’re still working hard on this, but it’s at a good “MVP” stage where you can run it yourself. Snaplet are working on a feature where you can drag-and-drop a snapshot into your browser to restore the state from any backup. Supabase are exploring ways we can run the entire Supabase stack inside the browser. You can find the Snaplet repo here [2], and the Supabase fork here [3]. There’s very little difference between these two, we just have a different browser UI.
Both Supabase team and the Snaplet team will be in here commenting if you want to know anything else about the technical details.
[0] Snaplet: [https://www.snaplet.dev/](https://www.snaplet.dev/)
[1] Crunchy post: [https://news.ycombinator.com/item?id=32498435](https://news....
[2] Snaplet repo: [https://github.com/snaplet/postgres-wasm](https://github.com...
[3] Supabase fork: [https://github.com/supabase-community/postgres-wasm](https:/...
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 possibilities of Postgres+WASM, and so Supabase & Snaplet teamed up to create an open source version. The linked blog post explains the technical difficulties we encountered, and the architecture decisions we made.
We’re still working hard on this, but it’s at a good “MVP” stage where you can run it yourself. Snaplet are working on a feature where you can drag-and-drop a snapshot into your browser to restore the state from any backup. Supabase are exploring ways we can run the entire Supabase stack inside the browser. You can find the Snaplet repo here [2], and the Supabase fork here [3]. There’s very little difference between these two, we just have a different browser UI.
Both Supabase team and the Snaplet team will be in here commenting if you want to know anything else about the technical details.
[0] Snaplet: [https://www.snaplet.dev/](https://www.snaplet.dev/)
[1] Crunchy post: [https://news.ycombinator.com/item?id=32498435](https://news....
[2] Snaplet repo: [https://github.com/snaplet/postgres-wasm](https://github.com...
[3] Supabase fork: [https://github.com/supabase-community/postgres-wasm](https:/...
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 possibilities of Postgres+WASM, and so Supabase & Snaplet teamed up to create an open source version. The linked blog post explains the technical difficulties we encountered, and the architecture decisions we made.
We’re still working hard on this, but it’s at a good “MVP” stage where you can run it yourself. Snaplet are working on a feature where you can drag-and-drop a snapshot into your browser to restore the state from any backup. Supabase are exploring ways we can run the entire Supabase stack inside the browser. You can find the Snaplet repo here [2], and the Supabase fork here [3]. There’s very little difference between these two, we just have a different browser UI.
Both Supabase team and the Snaplet team will be in here commenting if you want to know anything else about the technical details.
[0] Snaplet: [https://www.snaplet.dev/](https://www.snaplet.dev/)
[1] Crunchy post: [https://news.ycombinator.com/item?id=32498435](https://news....
[2] Snaplet repo: [https://github.com/snaplet/postgres-wasm](https://github.com...
[3] Supabase fork: [https://github.com/supabase-community/postgres-wasm](https:/...
We actually kinda see parts of this in https://github.com/superfly/litefs, albeit for SQLite.
And here we see some ideas forming around "pluggable storage for PostgresQL": https://wiki.postgresql.org/wiki/Future_of_storage#Pluggable...
Seriously! If any of this sounds interesting to build, reach out, and we'll make it happen!
I was wondering if anyone had thought about using this to experiment with the planner.
The engineering and support teams at Greenplum, a fork of Postgres, have a tool (minirepro[0]) which, given a sql query, can grab a minimal set of DDLs and the associated statistics for the tables involved in the query that can then be loaded into a "local" GPDB instance. Having the DDL and the statistics meant the team was able to debug issues in the optimizer (example [1]), without having access to a full set of data. This approach, if my understanding is correct, could be enabled in the browser with this Postgres WASM capability.
[0] https://github.com/greenplum-db/gpdb/blob/6X_STABLE/gpMgmt/b...
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...
> 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 application. If you're looking to run a native application in the browser using v86, the repo & blog post is a good launching pad.
I think `direnv` [1] may be closer to `asdf` than this. They also mention it, and the integration, `asdf-direnv` on their website [2].
[1] https://direnv.net/
I was trying to find a way to make apps "data-leak resistant" and one step into this direction was to let the user store the data by bringing his/her own database. I even made a poc https://github.com/andersonDadario/byoda (explanation in the blog post link found on the readme) - but no user would manage his own database. Having a database in the browser opens more possibilities though. I will give it some thought. Looking forward to what else will be built on WASM.
I wrote an in-browser serverless platfrom [1] a few months ago with which this would pair well; but seeing the techniques described here, it might make sense to compile workerd [2] to wasm instead.
[1] https://github.com/johnhenry/actually-serverless
Related posts
- Show HN: I made a SQL game to help people learn / challenge their skills
- Ask HN: Who is hiring? (May 2022)
- How do I make my github project straight out of github buildable (no library dependecy errors,no library manager bullshit)?
- Pgcopydb: Copy a Postgres database to a target Postgres server
- Serverless Postgres with Neon - My first impression