News for hackers. Stuff that matters.
Re:Quicker Serverless Postgres Connections by kccqzy on Tuesday March 28, 2023 @01:21PM (#35344594)
> 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.

So we introduced so many optimizations just because we can't persist state. I can't help but think this is being penny wise pound foolish; the problems this article is solving wouldn't have been problems in the first place if you choose a boring architecture.

Re:Quicker Serverless Postgres Connections by insanitybit on Tuesday March 28, 2023 @01:38PM (#35344870)
As if boring architectures don't have their own problems.
Re:Quicker Serverless Postgres Connections by Cthulhu_ on Tuesday March 28, 2023 @01:48PM (#35345029)
Such as? Besides of course not being able to find people that want to work on it.
Re:Quicker Serverless Postgres Connections by endisneigh on Tuesday March 28, 2023 @03:07PM (#35346237)
Boring architectures generally don’t scale well
Re:Quicker Serverless Postgres Connections by yamtaddle on Tuesday March 28, 2023 @03:29PM (#35346529)
I usually find that "interesting" architectures scale even worse, at least for the 99% of projects and organizations that'd never actually outgrow the "boring" solution. All the pain of the big fancy solution, but without the actual need that makes it truly better than the alternative.

... of course, the best-paying jobs are at the places that really do need that scale, so of course we all want an excuse to play with those tools, even when it's not the right business choice. And it's not as if software folks are the only ones with a principal-agent problem, in business. Oh well.

Re:Quicker Serverless Postgres Connections by notjoemama on Tuesday March 28, 2023 @06:54PM (#35349235)
I'm with you. I understand the critique, but experience has shown me "boring" is more maintainable, and at some point even "clever" tools stop being worth the effort. Besides, eventually scale pushes tech to roll their own, or rewrite/augment tools.

I dislike using boring as a measure of sufficiency. It makes me wonder if those drawn to the clever solutions carry a "I know better than you" perspective, the kind of dogmatic optimism that tanked SVB.

Re:Quicker Serverless Postgres Connections by manigandham on Tuesday March 28, 2023 @03:14PM (#35346320)
Being boring has nothing to do with scale. Some of the biggest applications run on incredibly simple architectures, and often are able to scale so well because of that (boring) simplicity.
Re:Quicker Serverless Postgres Connections by SebJansen on Tuesday March 28, 2023 @03:17PM (#35346370)
Cassandra is probably in the realm 'boring and scalable'
Re:Quicker Serverless Postgres Connections by manigandham on Tuesday March 28, 2023 @03:37PM (#35346644)
Definitely not. I'd much rather scale Postgres manually through layers of sharding and proxies than handle Cassandra.

There is ScyllaDB for a much better reimplementation of Cassandra/Dynamo, but wide-column databases are still best for niche scenarios, especially as RDBMS are rapidly evolving into natively distributed architectures.

Re:Quicker Serverless Postgres Connections by endisneigh on Tuesday March 28, 2023 @03:42PM (#35346729)
What are the biggest apps on the simplest architectures and what are the architectures?
Re:Quicker Serverless Postgres Connections by fabian2k on Tuesday March 28, 2023 @03:44PM (#35346752)
Stack Overflow is probably one of the more public examples. That is mostly a C# monolith with a relational database behind it.
Re:Quicker Serverless Postgres Connections by manigandham on Tuesday March 28, 2023 @03:53PM (#35346877)
Monolithic apps running on big servers talking to databases running on big servers. Very little orchestration overhead or complexity with serverless and the rest.

Everything from StackOverflow to ad serving systems to high-frequency trading exchanges are run this way.

Re:Quicker Serverless Postgres Connections by endisneigh on Tuesday March 28, 2023 @04:17PM (#35347216)
Stack overflow is unique in that it’s most read only. Link to high frequency trading “boring” architecture?
Re:Quicker Serverless Postgres Connections by manigandham on Tuesday March 28, 2023 @04:26PM (#35347314)
What is your definition of non-boring architecture? I'm curious as to what you consider the exciting architectures necessary for scaling to make sure we're talking about the same thing (since this thread started about serverless).
Re:Quicker Serverless Postgres Connections by leetbulb on Tuesday March 28, 2023 @04:50PM (#35347624)
Ironic that this page is down? (also not https? heh)
Re:Quicker Serverless Postgres Connections by endisneigh on Tuesday March 28, 2023 @06:50PM (#35349194)
I do not consider any of your examples really that simple or boring.

Boring to me is a load balancer, app server and cache. Once you start talking about background jobs and queues I don’t see how that’s any simpler than the alternative.

You could say Google, running Borg, is basically a database with a bunch of load balancers and background job processors. Obviously the complexity is in the scale and implementation.

Re:Quicker Serverless Postgres Connections by lelanthran on Tuesday March 28, 2023 @05:15PM (#35347973)
Define "boring" and "scale", because in my experience you can vertically scale hardware to an almost unbelievable number of concurrently logged-in users.

With most services, until you go over a few million users concurrent users, you really don't need to horizontally scale.

Re:Quicker Serverless Postgres Connections by insanitybit on Thursday March 30, 2023 @12:10AM (#35367846)
IDK, I'm assuming "boring" here means stateful monolith?

So you have:

a) No enforceable isolation, reliance entirely on good behaviors and module systems

b) No independent scaling

c) No isolation of security components so instead of a minting service and an edge service you have one service that does both

d) Single language lock-in

I could go on and on an don

Re:Quicker Serverless Postgres Connections by nikita on Tuesday March 28, 2023 @01:29PM (#35344730)
Serverless environments are a matter of fact. They exist, they are super convenient, and people want to use Postgres in them. This is a bridge for such people. Yes, it requires some sophisticated engineering, but it also enables to have less boilerplate code for a lot of people.
Re:Quicker Serverless Postgres Connections by Cthulhu_ on Tuesday March 28, 2023 @01:50PM (#35345071)
I think if this particular logic is hidden away behind a server, it doesn't really matter - people want convenience, and for someone else to hide the complexity.

Serverless postgres-as-a-service isn't a stretch at all.

This thread does remind me of a previous thread, I believe it was something like optimizing a basic string operation (concatenation?) by going down to assembly and SIMD. Few people have a need to know the details of that particular implementation, and mere mortals cannot comprehend the wizardry going on there either, but that's just fine because if it gets incorporated into standard libraries or the underlying implementations that said standard libraries use, everybody benefits without ever having to understand the inner workings.

Re:Quicker Serverless Postgres Connections by interstice on Tuesday March 28, 2023 @01:55PM (#35345135)
Unless it breaks one day and no one knows why
Re:Quicker Serverless Postgres Connections by hot_gril on Tuesday March 28, 2023 @06:50PM (#35349199)
Someone knows why, but that someone is not me. And if it had to be me, I'd go figure it out given some time. Point is, I don't need SIMD knowledge hot-loaded in my head.
Re:Quicker Serverless Postgres Connections by manigandham on Tuesday March 28, 2023 @03:16PM (#35346359)
Also known as layers of abstractions. The entirety of (software) technology is built on that concept.
Re:Quicker Serverless Postgres Connections by hot_gril on Tuesday March 28, 2023 @06:49PM (#35349182)
Sure, you want the easiest thing possible that fulfills the common use cases. But right now serverless isn't there quite yet. Having persistent Postgres connections is a really basic requirement that the serverless platforms should've implemented already.

Heroku and similar things are the sweet spot right now for me. I don't have to deal with much, and I get exactly the amount of flexibility that I need. Sure it'd be a little nicer not to deal with Express on my own in a NodeJS environment, but right now it's easier to deal with than it is to avoid. Some day I'll happily go serverless.

Re:Quicker Serverless Postgres Connections by jrsj on Tuesday March 28, 2023 @01:53PM (#35345105)
Things are getting more serverlesss too. With Deno Deploy, Cloudflare Workers, etc I see myself eventually wanting to run most of my application on platforms like this, and a serverless & distributed database makes that much easier and I expect it’ll probably perform better in many cases too.
Re:Quicker Serverless Postgres Connections by nikita on Tuesday March 28, 2023 @03:02PM (#35346161)
100%
Re:Quicker Serverless Postgres Connections by agrippanux on Tuesday March 28, 2023 @08:28PM (#35350252)
Deno Deploy doesn’t yet support npm (it’s coming), which I found out the hard way last week.

Overall tho I agree with your statement, and I now build most of my apps using serverless and databases like Neon.

Re:Quicker Serverless Postgres Connections by stickfigure on Tuesday March 28, 2023 @02:50PM (#35345998)
I've been doing "serverless" on app engine for more than a decade and it handles postgres connections fine without any heroics.

There's always instances with state somewhere; it's just a question of how smart your serverless infrastructure is about pooling the instances.

Re:Quicker Serverless Postgres Connections by jeremyjacob on Tuesday March 28, 2023 @08:28PM (#35350250)
The “serverless” being referred to in the article is run using V8 isolates, whereas app engine runs full Node.js processes. Although they have limitations like not supporting raw TCP, isolates can start within a couple milliseconds and are much more CPU efficient than standalone processes.
Re:Quicker Serverless Postgres Connections by chmod600 on Tuesday March 28, 2023 @03:36PM (#35346627)
Boring architectures already exist. Why reimplement what's already done?
Re:Quicker Serverless Postgres Connections by streblo on Tuesday March 28, 2023 @05:41PM (#35348323)
Bound to be controversial hot take: serverless is the boring architecture you were looking for in the first place
Re:Quicker Serverless Postgres Connections by hot_gril on Tuesday March 28, 2023 @06:27PM (#35348881)
Almost. It'd be boring if it'd handle these Postgres connections efficiently for me instead of making me rely on workarounds.
Re:Quicker Serverless Postgres Connections by hot_gril on Wednesday March 29, 2023 @03:21PM (#35361973)
(As cool as Neon is. If you're already serverless for other reasons, they're providing a nice solution for Postgres!)
Re:Quicker Serverless Postgres Connections by icedchai on Tuesday March 28, 2023 @06:26PM (#35348862)
I think serverless is fine as long as you don't lock yourself in to proprietary, vendor-specific APIs. For example, with AWS Lambda and Python, you could use Mangum (see https://mangum.io/ ) so you're deploying an ASGI app, based on say FastAPI or Starlette. For databases, stick with Postgres.