Edge-compatible Serverless Driver for Postgres

  • The "How it works" section surprised me - I did not expect to see Websockets there.

    Other serverless drivers or database APIs (PlanetScale Serverless Driver, AWS RDS Proxy or Prisma Data Proxy) usually use HTTP to replace the stateful TCP connection. The post explains a bit why this might be beneficial (can use existing tools, and use connection state) - but what about the other benefits and use cases of going with HTTP?

    For example in that architecture the connection pool also moves from the application to the component in between and all that complexity can completely be removed from the app. Especially on serverless platforms, where in theory each request gets its own application with its own pool, that is huge. How does that work here? Or does the pool also move to the "WebSocket-to-TCP proxy" and you just did not highlight it in the post? (The graphic shows a "Connection Pool" but I can not really make sense of what that means.)

  • I’m Neon CEO. Happy to answer questions. We also have an interesting roadmap for the driver where we hope to keep driving latency and number of round trips down

  • Just for the recerence, it is possible to use Cloudflare Tunnel to connect to Postgres from Cloudflare Workers [1]. IIRC they also use WebSockets for communication between the Worker and the Tunnel.

    [1] https://developers.cloudflare.com/workers/tutorials/query-po...

  • Hmm. Wouldn't this also be useful for browser-hosted application code that wants to talk to PG directly?

  • Would it ever be possible to run neon on a mobile phone, offline?