HNHacker News
TopNewBestAskShowJobs

kiwicopple

6,216 karma · joined April 6, 2017

Supabase (YC S20)

copple [at] supabase [dot] io

submissionscomments
kiwicopple··on Postgres Foreign Data Wrappers with WASM
Hey HN, Supabase CEO here.

This release makes it easy for anyone to create a Foreign Data Wrapper and share it with the community. Usually FDWs need to be "pre-installed" on Postgres which makes it harder for platforms like Supabase/RDS/Azure/etc

Since the FDWs are written in WebAssembly, they can safely be installed from S3 or GitHub and they are sandboxed by our Wrappers framework, a Rust framework for developing Foreign Data Wrappers (https://fdw.dev)

There are some trade-offs: the performance isn't as good as a "native" FDW. That said, we think the flexibility makes it worthwhile, and we'll improve the performance over time.

The blog posts explains a lot of the technical details. You can find some docs to build your own Wasm Wrapper here:

https://fdw.dev/guides/create-wasm-wrapper/

kiwicopple··on Neon Postgres vs. Supabase
sure - I'll jump in next week (after we've wrapped up Launch Week). What is your discord?
kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
This one isn’t available in that format, but it looks like this open source tool could help:

https://github.com/KarnerTh/mermerd

kiwicopple··on Neon Postgres vs. Supabase
we're hosted on AWS (and so is Vercel) - it could have been the region that your database was hosted?
kiwicopple··on Neon Postgres vs. Supabase
I'm also surprised. Here is a 3rd-party benchmark published last month using various ORMs:

https://www.prisma.io/blog/performance-benchmarks-comparing-...

kiwicopple··on Neon Postgres vs. Supabase
Here is a real-world comparison for 3 startups on Supabase, showing how our Auth pricing compares to Firebase:

https://x.com/kiwicopple/status/1656746963277340672

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
1. You can see the relevant code block here[0]. To summarise, instead of storing the embeddings "next to" the data that you provide, we create a table that can be referenced. This is because often we need to send the LLM some data from the table (like creating a chart). If the LLM sees a reference to `meta.embeddings` then it knows it can "fetch" that data later if it's needed (for RAG etc)

2. We haven't fine-tuned, it's all just detailed prompts which you can find in the code. We might need to fine tune later for local-only models, but for now GPT-4o is solid.

[0] https://github.com/supabase-community/postgres-new/blob/4d6c...

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
> take an existing database schema, developed either in the Supabase migrations ... and draw the diagram?

It might not be so obvious, but this diagram tool is already built into the Supabase Dashboard (under "Database")

I can see some value in providing this as a generic service for any PG database - I'll look into it - but I know that Dbeaver already has something like this built in (and I think pgadmin too)

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
if your session is completely broken you might need to clear your localstorage (in the browser devtools)

I'll flag this with the team but we can't actually access your "db id oy6g6g6o5qbt78fo" as it's run directly in your browser and doesn't touch our servers at all

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
we have something like that from an earlier launch:

https://wasm.supabase.com/

Be aware that the WASM file is 30Mb, but i think it fits what you're describing. details here: https://supabase.com/blog/postgres-wasm

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
There are a lot of reasons that you might want Postgres in the browser, but one of my favorite possibilities is to use it as a local data store (similar to mobx or redux)

The Electric team have built this extension which will fit that use-case very well: https://pglite.dev/extensions/#live

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
at this stage there is not, but you can just write SQL and the LLM is smart enough to run it directly on the database.

I can see some situations you might want direct access to postgres, so we'll jot that done as something to look at too

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
we're working on this right now - I don't know if we'll get it out for today, but it will certainly be available this week
kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
Everything is open source with the exception of the LLM at the moment, which we'll get to. Here are all the tools:

* postgres-new (https://github.com/supabase-community/postgres-new): The frontend. Apache 2.0

* PGlite (https://github.com/electric-sql/pglite): A WASM build of Postgres. Apache 2.0

* pg-gateway (https://github.com/supabase-community/pg-gateway): Postgres wire protocol for the server-side. MIT

* transformers.js (https://github.com/xenova/transformers.js): Run Transformers directly in your browser

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
> at least give mobile a synopsis of what it’s suppose to do

agreed - we rushed this one a bit. we're working on some some updates now for mobile users

edit: we've shipped some changes for mobile which embed the video and link to the blog post so that it's a bit clearer. Thanks for the feedback

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
my bad - it has been a crazy week with lots of messages flying around. You're right about safari
kiwicopple··on Postgres.new
see my comment for more context: https://news.ycombinator.com/item?id=41226482

here is a video, if you're on mobile: https://www.youtube.com/watch?v=ooWaPVvljlU

and a blog post with more details: https://supabase.com/blog/postgres-new

We originally linked[0] to the blog post but it looks like this one overtook us on HN

[0] https://news.ycombinator.com/item?id=41224286

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
fwiw this will show for 2 reasons:

1/ you're using a small window (even on Chrome/FF). We don't support mobile yet, so if you're seeing this on a desktop just expand the window

2/ you're on safari, which doesn't have support for OPFS yet: https://github.com/electric-sql/pglite/pull/130

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
good feedback, thanks

we'll change the verbiage for now, and look at ways we can provide a 100% local experience without logins

kiwicopple··on Postgres.new: In-browser Postgres with an AI interface
We tested several models and GPT-4o was the most accurate and makes the most sense for our initial launch

That said: it's 100% our intention to add local models. This is just our v1.

kiwicopple··on Postgres.new
hey HN, supabase ceo here. Full details here: https://supabase.com/blog/postgres-new

This is a new service that we're experimenting with that uses PGLite[0], a WASM build of Postgres that runs in the browser. You might remember an earlier WASM build[1] that was around ~30MB. The Electric team [2] have gone one step further and created a complete build of Postgres that’s under 3MB.

Their implementation is technically interesting. Postgres is normally multi-process - each client connection is handed to a child process by the postmaster process. In WASM there’s limited/no support for process forking and threads. Fortunately, Postgres has a relatively unknown built-in “single user mode” [3] primarily designed for bootstrapping a new database and disaster recovery. Single-user mode only supports a minimal cancel REPL, so PGlite adds wire-protocol support which enables parametrised queries etc.

We have created https://postgres.new as an experiment. You can think of it like a love-child between Postgres and ChatGPT: in-browser Postgres sandbox with AI assistance. You can spin up as many new Postgres databases as you want because they all live inside your browser. We pair PGlite with an LLM (currently GPT-4o) and give it full reign over the database with unrestricted permissions. This is an important detail - giving an LLM full autonomy means that it can run multiple operations back-to-back: any SQL errors from Postgres are fed back to the language model so that it can have a few more attempts to solve the problem. Since it’s in-browser it’s low risk.

Some other features include:

    - CSV upload: you can upload a CSV and it will automatically create a Postgres table which you can query with natural language.

    - Charts: you can ask the LLM to create a chart with the data and change the colors of the charts.

    - RAG / pgvector: PGLite supports pgvector, so you can ask the LLM to create embeddings for RAG. The site uses transformers.js [4] to create embeddings inside the browser.
We’re working on an update to deploy your databases and serve them from S3 using pg-gateway [5]. We expect to have a read-only deployments ready by the end of the week. You can access them using any postgres-compatible tool (eg: psql).

Everything is open source. A huge shout-out to the Electric team who have been a pleasure to build with.

[0] PGLite: https://github.com/electric-sql/pglite

[1] Postgres-wasm: https://supabase.com/blog/postgres-wasm

[2] Electric: https://electric-sql.com/

[3] Single user mode: https://www.postgresql.org/docs/current/app-postgres.html#AP...

[4] transformers.js: https://github.com/xenova/transformers.js

[5] pg-gateway: https://github.com/supabase-community/pg-gateway

kiwicopple··on Show HN: Pg_replicate – Build Postgres replication applications in Rust
(I'm on the supabase team)

> equivalent to SQLite: a very cheap option for simple deployments

FWIW, we will launch something tomorrow which will cover this part of your use-case. You will be able to find it on our blog in the morning (PT)

kiwicopple··on Show HN: I made an open source search engine for AI tools,or customizable data
looks great Ryan - congrats on the launch
kiwicopple··on AI Optimism vs. AI Arms Race
the spend is definitely justified by increased market caps - the test will be whether it translates to revenue. It's early to tell. I don't know if a irrational market will last for 10 years (MS PE Ratio has gone from 31.37 to 38.52 in the past ~12 months)
kiwicopple··on AI Optimism vs. AI Arms Race
> We are now in a cycle of competitive escalation between three of the biggest companies in the history of the world, collectively worth more than $7T.

> At each cycle of the escalation, there is an easy justification—we have plenty of money to afford this.

> This helps explain another potential motive for the aggressive behavior we’re seeing from the cloud providers: Defense

so basically we have three tech giants acting irrationally because they know it's better to over-invest and maintain their position than under-invest and lose. As a result, all the tier-2 companies are over-investing because "this is normal" (but they don't have the warchest to sustain it)

kiwicopple··on Show HN: Z Js - The literally low overhead Js framework.
This looks nice Kizz - very simple and approachable. Well done
kiwicopple··on Show HN: I built a backend so simple that it fits in a YAML file
(Supabase team member)

Congrats on shipping, this looks nice and well thought-out

One possible correction: the only code we generate for a user is either SQL migrations or TS types (if devs want to use the TS client). I’m not sure many would classify Supabase as NoCode, and we strongly recommend users use CI/CD development with our CLI and database migrations

https://supabase.com/docs/guides/cli/local-development#datab...

kiwicopple··on Better RAG Results with Reciprocal Rank Fusion and Hybrid Search
Here is our doc with RRF:

https://supabase.com/docs/guides/ai/hybrid-search

kiwicopple··on Show HN: Serverless Postgres
Since this is dockerized, the best AWS primitive would be Fargate or ECS

As far as I know you can’t mount a file system like EBS to Lambda, and tbh even if you could the implementation of Lambda+Postgres sounds particularly cursed.

kiwicopple··on Show HN: Serverless Postgres
I think it’s pretty simple with S3, and the permissions are basically “keep the bucket private”

That said, this is very much an MVP and I’m sure I’ll encounter some dragons as I push for scale or as I receive feedback from customers

← PreviousPage 4 of 33Next →