4 ms·
Sure would have loved to see a breakdown of the breadth of functions and the nature of each function (did you simply just serve as a stripe proxy? did you squir
by hardwaresofton 6y ago
Sure would have loved to see a breakdown of the breadth of functions and the nature of each function (did you simply just serve as a stripe proxy? did you squirrel away some data into a separate database? etc).
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=ph&test=db https://www.techempower.com/benchmarks/#section=data-r19&hw=...
- skifunkster 6y agoYeah, we literally used it as a stripe proxy and to serve frontend. All data was served in stripe and then queried using Stripe Sigma, their flavour of Presto. 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.
- hardwaresofton 6y agoThanks for sharing this -- that's an impressive cost amount for that service, in the range of 20 euros for the event with that amount of queries is pretty impressive, with little to no maintenance. The cost makes it sound like a full on win for serverless. 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!
- skifunkster 6y agoFor previous donation platforms operating at same scale on AWS we use Serverless Framework and have our own lambda wrapper which wraps the code and provides monitoring, etc... 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...
- hardwaresofton 6y agoThanks for laying this out!