neondatabase / serverless

Connect to Neon PostgreSQL from serverless/worker/edge functions
https://www.npmjs.com/package/@neondatabase/serverless
MIT License
343 stars 13 forks source link

[Question] question about performance? #21

Closed shiyuhang0 closed 1 year ago

shiyuhang0 commented 1 year ago

We can connect to Neon with node-pg via TCP or with serverless driver via WebSocket.

I have seen multiple efforts has been made to improve the performance of serverless driver in this blog https://neon.tech/blog/serverless-driver-for-postgres

So, I wonder if there is any performance comparison between node-pg and this serverless driver. thanks!

jawj commented 1 year ago

Good question. Not yet, but I expect we'll publish something on this soon.

shiyuhang0 commented 1 year ago

@jawj Excited to see this blog: https://neon.tech/blog/http-vs-websockets-for-postgres-queries-at-the-edge

This blog compares websockets and HTTP, but should I use the traditional TCP connection via node-pg or serverless-driver in serverless function which supports both.

Could you please give me some advice :)