Using Serverless for unpredictable traffic to for TV fundraiser event
medium.com
medium.com
Hard to know just how much serverless really helped here as opposed to other solutions. Also, the cost of the serverless execution would be great to know (don't forget those API Gateway fees or other such "hidden" costs).
The tech empower benchmarks[0] w/ a single DB request and NodeJS show some pretty good results (10k-100k) and since the max was 2.5k. I think Node isn't a particularly performance conscious choice, though it does async well and that should be pretty common knowledge these days (that doing async well is a good idea for high load).
Also normally you'd use Cloudflare workers to serve some data very close to customers -- was that the use case here? or was it more just that the workers were a good fit for deployment ease? There's also the question of essentially subsidies -- I hear that cloudflare worker ingress (egress?) traffic is free right now?
[0]: https://www.techempower.com/benchmarks/#section=data-r19&hw=...
Can tell you the total cost from RTE does Comic Relief, which was the same size, was about 16 euros to host the whole thing. This would be about the same, however is on RTE's cloudflare account, so not easy to get breakdown.
Workers were just a good fit not to have to host anything, due to the unpredictable number of donations that we would be getting through. Deployment and development is also really easy.
Anything interesting about the deployment method, choice of language, containerization/etc that made it particularly easy? There are tools in this domain (vercel springs to mind) that have adopted the static-site-over-serverless-something) model, but it sounds like you all had an easy time with just loading some workers up, did you do anything fancy to facilitate the frontend serving? I assume with the stripe proxy bit was just using Stripe's various (great) APIs for customer creation, one time charges (I guess?).
Curious about the technicals of the setup, you've baited us (HN) in at this point, give out those gory details!
For this we just wrote straight up Node JS and plumbing through to Stripe, super simple really. Deployed via github actions on RTE's cloudflare account, really simple. No one time charges from the Stripe side or anywhere really. Only other cost was Sentry, which was more than the hosting as we used it for a lot of the informational alongside error logging.
We have a separate article en-route with all the technicals, just waiting on client sign off, as is stats heavy...
Of course the company "We Are Serverless" is always going to recommend serverless, but in this case it's the optimal use case of huge unpredictable scaling over a short period.
Bit short on detail, mostly advertorial.
Sorry about the title.
I figured it was one of those AWS invoice shock stories from "serverless" and "millions of Euros".
I imagine Cloudflare Workers is better than AWS Lambda (or Lambda at Edge) at handling sharp traffic spikes, since the use of V8 isolates yields much lower cold start times than AWS's micro-VMs. Does anyone have real experience with both models?
Cloudflare workers took a different approach - they run V8 node-ish processes on all their edges, and you submit your code as JS or WASM that fits their interface (which is based on the service worker standard). They then execute it as a V8 isolate, which is blazing fast because the V8 process is already up and running, it’s just running JS/WASM code, which it knows how to do pretty well. Even the cold start is pretty small, because the JS/WASM tends to be pretty small and Cloudflare knows how to cache stuff.
They’re both very different systems, but both have their uses.
Cloudflare definitely has a place, but is definitely nowhere near as feature rich as the AWS ecosystem. For this use case it was perfect. Lack of warm up and responsiveness on cloudflare is a strong draw.
Here is my previous article on our AWS donation system.
https://read.iopipe.com/the-journey-to-90-serverless-at-comi...
Sadly the article doesn't go into technical details which is what I'm interested in. Therefore it can be resumed down to that one phrase.
I've seen first hand how a serverless application, "scaling" to meet a huge demand, will stampede the weakest downstream service and DDoS it.
In this case they're lucky that their payment processor (Stripe) didn't start throttling them. You may have spoken with Stripe beforehand about your expected load and get some sort of agreement / whitelist for your API token. That would be very wise.
Servereless stampeding a payment processor like Stripe as opposed to something like RDS are two different kettles of fish, as am sure you can imagine, stripe have very high capacity and there is 1:1 relationship to the user unlike DB writes, where there may be many per transaction / action.
I have don't it both ways in the past, queueing payments and processing later. Problem is with doing that you cannot immediately return card errors, which has a large effect on conversion. With something like Amazon it is fine to do that, as users inevitably come back to buy the products they want, for donations not so much.
Ok, maybe with a few extra steps :-)
Such a clickbait title.
This isn’t about getting rich quick but setting up a system to respond to high load that comes in bursts.
The authors setup a system to handle bursts of traffic driven by a popular tv show. Normally the traffic is zero so in this case lambda makes a ton of sense.
I'd rather "read" it by reading comments on articles here on HN and only then deciding to read the main article if it proves worthy of my time :-)
However you did assert that this article was about a get rich quick scheme which is taking things a bit further than commenting on a click vanity title.
Viewers likely saw your comments and used it to form their opinion of the content.
It was a submarine article as you can see at the end but the call to action is for charity. So clickbait for a worthy cause.