Live data from Hacker News

A bank runs serverless with PHP and AWS Lambda

bref.sh

101–110 of 132 posts

Re: A bank runs serverless with PHP and AWS Lambda

#101
> In October 2021, they successfully migrated their first API route to AWS Lambda, the most critical one handling all live credit card transactions. Over the following year, more and more API endpoints were migrated away from the servers to AWS Lambda.

Why? Why do people insist on doing this? Move something less important first, prove you can operate in production, then move the crown jewels.

Re: A bank runs serverless with PHP and AWS Lambda

#102

> In October 2021, they successfully migrated their first API route to AWS Lambda, the most critical one handling all live credit card transactions. Over the following year, more and more API endpoints were migrated away from the servers to AWS Lambda. Why? Why do people insist on doing this? Move something less important first, prove you can operate in production, then move the crown jewels.

I'd love to hear about the rationale behind this decision, because operational cost certainly isn't it. It's ludicrous to migrate a high-traffic, high-risk API to a function-as-a-service solution like AWS Lambda. Either they have a very unique requirement or it sounds like this might very well be the poster child of clueless resume-driven development.

Re: A bank runs serverless with PHP and AWS Lambda

#103

Earlier quoted context omitted.

This was my thought. Lambda works well for infrequent tasks. But hosting an API? That seems like it could get expensive pretty fast.

It's cheaper than most options where you need to pay a human to manage something with the same level of scalability and security that AWS provides.

Lambda scalability for an API is awful; it can't run concurrent requests (of course PHP largely can't do this either). An ECS service with pretty much any other language (for async/multithreaded runtimes) will scale far better.

Re: A bank runs serverless with PHP and AWS Lambda

#104
post #102

> In October 2021, they successfully migrated their first API route to AWS Lambda, the most critical one handling all live credit card transactions. Over the following year, more and more API endpoints were migrated away from the servers to AWS Lambda. Why? Why do people insist on doing this? Move something less important first, prove you can operate in production, then move the crown jewels.

I'd love to hear about the rationale behind this decision, because operational cost certainly isn't it. It's ludicrous to migrate a high-traffic, high-risk API to a function-as-a-service solution like AWS Lambda. Either they have a very unique requirement or it sounds like this might very well be the poster child of clueless resume-driven development.

What specifically makes it ludicrous to you?

Re: A bank runs serverless with PHP and AWS Lambda

#105

Earlier quoted context omitted.

It's cheaper than most options where you need to pay a human to manage something with the same level of scalability and security that AWS provides.

Lambda scalability for an API is awful; it can't run concurrent requests (of course PHP largely can't do this either). An ECS service with pretty much any other language (for async/multithreaded runtimes) will scale far better.

A single lambda can only handle one request at a time, but you can scale up 1,000s of instances if needed.

Re: A bank runs serverless with PHP and AWS Lambda

#106

Earlier quoted context omitted.

This was my thought. Lambda works well for infrequent tasks. But hosting an API? That seems like it could get expensive pretty fast.

Lambda is $0.0000166667 for every GB-second, which works out to ~$43.20 for 30 days. For a little more ($49/month), you could get a c6g.large and get two dedicated CPU cores (ie, not the shared burstable t2/t3) and 4 GB of RAM. So yes, very expensive fast if you get much traffic at all. That c6g.large should easily be able to handle dozens (if not hundreds) of requests in parallel, especially if many of those request…

2 cores and 4GB RAM should have no problem handling thousands or tens of thousands of concurrent requests on the JVM. Lambda's documented concurrency maximum is "tens of thousands"[0], which means an 8GB m6g.large or ECS instance can probably handle larger bursts than lambda can. If you had extreme bursts, you'd also be having almost every request hit a cold start.

[0] https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-...

Re: A bank runs serverless with PHP and AWS Lambda

#107
post #102

> In October 2021, they successfully migrated their first API route to AWS Lambda, the most critical one handling all live credit card transactions. Over the following year, more and more API endpoints were migrated away from the servers to AWS Lambda. Why? Why do people insist on doing this? Move something less important first, prove you can operate in production, then move the crown jewels.

I'd love to hear about the rationale behind this decision, because operational cost certainly isn't it. It's ludicrous to migrate a high-traffic, high-risk API to a function-as-a-service solution like AWS Lambda. Either they have a very unique requirement or it sounds like this might very well be the poster child of clueless resume-driven development.

IME the rationale behind such decisions is what I call the "sinking ship" phenomenon in infrastructure. Maybe their system was failing in weird ways, hard to maintain, causing all sorts of issues, etc. In that "sinking ship" it's always gonna be "women and children first," or rather, their most critical systems first.

Re: A bank runs serverless with PHP and AWS Lambda

#108

Earlier quoted context omitted.

Lambda is $0.0000166667 for every GB-second, which works out to ~$43.20 for 30 days. For a little more ($49/month), you could get a c6g.large and get two dedicated CPU cores (ie, not the shared burstable t2/t3) and 4 GB of RAM. So yes, very expensive fast if you get much traffic at all. That c6g.large should easily be able to handle dozens (if not hundreds) of requests in parallel, especially if many of those request…

Then your EC2 instance suddenly stops working and your downtime cost you a fat contract that makes the cost of serverless a pocket change. If you want to compare AWS Lambda with EC2, you need to bring in AWS Load Balancer, Auto Scaling, Security Upgrades for the OS, Healthcheck and many more. Yes, Lambda is not needed in a lot of context, but if you have the expertise to use it and you want to provide enterprise-grad…

With Lambda you’re in three different Availability Zones by default, so you also need to factor running your proposed EC2 solution in 3 AZs too.

Re: A bank runs serverless with PHP and AWS Lambda

#109
post #105

Earlier quoted context omitted.

Lambda scalability for an API is awful; it can't run concurrent requests (of course PHP largely can't do this either). An ECS service with pretty much any other language (for async/multithreaded runtimes) will scale far better.

A single lambda can only handle one request at a time, but you can scale up 1,000s of instances if needed.

A single minimal ECS instance can handle thousands of concurrent requests with an async runtime without running into so many cold starts that your p25 time is in the hundreds of ms.

1000 lambdas with 1000 database connections is also going to be a horrible way to do things on the backend. Add in the cost of RDS proxy for lambda and the ECS solution becomes even better.

Re: A bank runs serverless with PHP and AWS Lambda

#110

Treezor is not really directly a bank but more a "bank as a service" company. Lots of companies or "neobank" that want to offer a kind of bank account, for personal or corporate use, but that don't have an official banking agreement, and not really a banking infrastructure, can use them as "white label" solutions. All the bank accounts and banking operations will be done by treezor, but from the user point of view, h…

As a customer of US Bank in the US, I can attest to the fact that they aren’t as reliable as I’d want. Their website and app tend to be “under maintenance” quite often. I think you overestimate the reliability of many bank operations.
Post reply on HN