6 ms·
Cool! At Neon[0], I work full time on our custom postgres proxy[1]. It's a very nice protocol to work with, although our usecase is quite a bit more complex com
by conradludgate 3y ago
Cool! At Neon[0], I work full time on our custom postgres proxy[1]. It's a very nice protocol to work with, although our usecase is quite a bit more complex compared to the ideas presented in the post.
Neon databases scale to zero, so the proxy needs to spin up databases on the fly. The proxy doesn't do that but it knows if the databases is running and asks our control plane to schedule it if it isn't. It's a fun service to maintain.
The biggest pain is error handling. Postgres is really bad for error messages and codes. The only available code we can use is usually protocol violation...
[0]: https://neon.tech/ https://neon.tech/
[1]: https://github.com/neondatabase/neon/tree/main/proxy https://github.com/neondatabase/neon/tree/main/proxy
- bearjaws 3y agoYeah I have tinkered with the PG protocol to de-identify data as its transmitted and the error handling is pretty bare bones. I think its reflected pretty well in how connection errors and even query errors come back as "you have an error" from Postgres most times lol.