4 ms·
"Error establishing a database connection" That's more irony than I can handle this early.
by redleggedfrog 8y ago
"Error establishing a database connection"
That's more irony than I can handle this early.
- shroom 8y agoThe shoemaker's children go barefoot
- mavdi 8y agoUpvoted for the irony of it.
- jaimehrubiks 8y agoI came to write this too :P
- mxpxrocks10 8y agosame lol
- cheeze 8y agoMan, that's hilarious
- kohanz 8y agoBut it's "serverless", how could it go down? (and I say this as someone that runs a web app built on the Serverless platform that I'm quite happy with - I just think it's a dumb name)
- deleted 8y ago[deleted]
- jackhack 8y agofinancial divide by zero error or wallet capacity underflow. Just speculating, but my guess is the bandwidth demand exhausted the available capacity and author wasn't willing to pay for more.
- kohanz 8y agoMy question of how it could go down was firmly tongue-in-cheek. My own serverless web app has gone down a few times during AWS outages, for example.
- thanatos_dem 8y agoI really hope that the website itself is running serverless on AWS, because that would be a great learning opportunity! It's quite easy and common to wreck a database when you have it hooked up to serverless infrastructure. Depending on the DB, there can be a significant amount of overhead for each client connection. Postgres is particularly bad at this, since it spawns an entire process for each client that connects. This is why connection pooling is so important for applications. Serverless is a different beast tho; every function is isolated, so having a client pool is much harder/impossible. If you get a flood of traffic, and your function interacts with a DB, you suddenly have a ton of non-multiplexed client connections, which is all it takes to bring many databases to their knees. If this is a serverless website, I can't wait for the author's next article, describing this issue and how they addressed it. If it's not serverless... add a client pool.
- Aeolun 8y agoWe solved it by having an EC2 connection pool instance :P it just sits there and ensures all the lambdas don’t blow up the database. Kind of defeats the point though :/
- ty_a 8y agoYou could run pgbouncer in a fargate container in ECS. Still serverless technically?
- djhworld 8y agoIn Java you can create a shared connection pool for AWS lambda functions, e.g. using DI and initialising your injector statically when classes are loaded by the JVM It relies on AWS using the same container/JVM for your invocations though which isn't guaranteed depending on what your load is.
- scarface74 8y agoYes you technically can do the same with any language...configure your connection statically.
- paulmendoza 8y agoI find most sites can just be setup as an S3 bucket with Cloudfront as the CDN. Any special logic can then be housed in some Lambda expressions behind API gateway. That probably would have prevented this outtage. But I haven’t read the article.
- cal5k 8y agoHeck, even CloudFront is super easy to setup and works like a charm.
- nigealj 8y agoSo do you proxy your calls from S3 to a serverless service? And do you handle cross origin calls via CORS? Just curious because I've never used serverless before.
- benmanns 8y agoYou can use JavaScript on the frontend to call a Lambda function that you 100% control (including CORS, etc). You can use this to do things like authentication, authorization, and rate limiting, as well, versus just giving open access to an internal datastore.
- jhabdas 8y agoI imagine Aurora has some affordances as well even if comes to lambdas
- stephengillie 8y agoCORS can be set on the S3 bucket - wide open is the default setting when you open the CORS properties in the S3 console.
- deleted 8y ago[deleted]