Company
Date Published
Author
George MacKerron
Word count
1827
Language
English
Hacker News points
164

Summary

The Neon serverless Postgres driver has reduced the latency of connections by cutting network round-trips in half. It achieves this by redirecting the PostgreSQL TCP wire protocol over WebSockets, eliminating the need for a separate WebSocket-to-TCP proxy. The driver uses TLS 1.3 to establish connections and eliminates unnecessary round-trips such as the `SSLRequest` message exchange. Additionally, it has improved Postgres authentication speed by using simple password auth instead of SCRAM-SHA-256, and pipelining Postgres interactions to reduce round-trips. With these improvements, the driver now achieves a total of four network round-trips, which is the lowest possible with current technologies. The team hopes to further optimize performance with WebSockets over QUIC in HTTP/3 and pipelining independent queries in Postgres.