TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Quicker serverless Postgres connections

164 pointsby nikitaabout 2 years ago

11 comments

kccqzyabout 2 years ago
&gt; A key feature of these environments is that state is not generally persisted from one request to the next. That means we can’t use standard client-side database connection pooling.<p>So we introduced so many optimizations just because we can&#x27;t persist state. I can&#x27;t help but think this is being penny wise pound foolish; the problems this article is solving wouldn&#x27;t have been problems in the first place if you choose a boring architecture.
评论 #35344730 未加载
评论 #35348323 未加载
评论 #35344870 未加载
评论 #35346627 未加载
carlsverreabout 2 years ago
Pretty insightful observation on authentication. Using a password method that requires the client to compute a brute force resistant hash that takes ~100ms of cpu time is a non-starter for most serverless platforms.<p>I&#x27;m curious if Cloudflare, or other serverless platforms offer the ability to generate short lived JWTs assigned to each worker. Combined with some configuration (pub key exchange, claim setup, etc) a platform like Neon could use these JWTs to establish identity. Sorta SSO for workers without the CPU overhead.<p>Seems like a safer approach than basic auth with fixed pws.
评论 #35345690 未加载
评论 #35344887 未加载
评论 #35344519 未加载
评论 #35346705 未加载
评论 #35344400 未加载
评论 #35350205 未加载
janpioabout 2 years ago
That is some serious optimization. Nice!<p>The article ends with the statement that you are pretty much done here for now. Would optimizing your TLS termination not maybe offer some more ways to speed this up? Or is that also already fully optimized?<p>I did not realize before that your approach with Websockets actually meant that there was no application&#x2F;client side pooling of connections. What made you choose this approach over an HTTP API (as for example PlanetScale did) anyway?
评论 #35343681 未加载
spullaraabout 2 years ago
This isn&#x27;t just useful for serverless. Any process-per-request based architecture can also benefit (PHP, Ruby, etc).
评论 #35347576 未加载
moderationabout 2 years ago
The end of the post mentions HTTP&#x2F;3 and QUIC. Planetscale have blogged about this [0].<p>0. <a href="https:&#x2F;&#x2F;planetscale.com&#x2F;blog&#x2F;faster-mysql-with-http3" rel="nofollow">https:&#x2F;&#x2F;planetscale.com&#x2F;blog&#x2F;faster-mysql-with-http3</a>
nikitaabout 2 years ago
I&#x27;m CEO of Neon. Happy to answer any questions you might have.
评论 #35343700 未加载
评论 #35344682 未加载
评论 #35345808 未加载
评论 #35350048 未加载
评论 #35343431 未加载
评论 #35346766 未加载
评论 #35344366 未加载
评论 #35343340 未加载
评论 #35346993 未加载
0xbadcafebeeabout 2 years ago
With a persistent OS-level network tunnel (ex. wireguard) that exists when the app starts, you wouldn&#x27;t need HTTP, WebSockets, TLS, etc. The app could open a single TCP connection to a sql connection pool and send its request, and it would be tunneled securely from point to point, with no additional round trips or protocols.<p>The idealist in me would rather this kind of thing become a standardized extension of address + transport protocols. But every person I talk to would rather stack 12 protocols on top of each other than work on improving the existing status quo. It feels like a truism of human societies; everyone wants improvement, but nobody wants fundamental reform.
评论 #35348834 未加载
评论 #35348316 未加载
boundlessdreamzabout 2 years ago
I didn&#x27;t know that neon supports using S3 as cold storage. That&#x27;s seriously amazing. How does that work with indexes and queries? It&#x27;s there a single index which will always grow and stored on disk or is the index split?
评论 #35343453 未加载
armatavabout 2 years ago
So how do you do development with this?<p>Is the recommendation to have a per-dev branch off the main DB?
评论 #35346978 未加载
eashish93about 2 years ago
neon.tech compute units looks costly as compared to mongodb atlas and cloud postgres
throwaway290about 2 years ago
To spare someone a click, yes there is still a postgres server.<p>Can&#x27;t stop being mad at the misuse of &quot;serverless&quot;. Even worse than using crypto for cryptocurrencies. Words have meaning...
评论 #35347198 未加载
评论 #35347021 未加载
评论 #35345559 未加载