Live data from Hacker News

A bank runs serverless with PHP and AWS Lambda

bref.sh

41–50 of 132 posts

Re: A bank runs serverless with PHP and AWS Lambda

#41

I always love a story about a successful strangler pattern migration. I do wonder how they came to Lambda though. I love it for small workloads and highly variable demand services, but something like Treezor you'd think has relatively flat and high demand. The cloud cost for Lambda would be much higher than running the equivalent compute, even with something also highly scalable like ECS.

Their clients have very variable traffic patterns because they are in very different industries. They have traffic spikes at lunch, or at the end of every month for example:

> infrastructure must be able to scale and be resilient to accommodate various usage patterns. Whether it's a luncheon voucher transaction spike at lunchtime or a monthly batch of transactions by corporate clients

Re: A bank runs serverless with PHP and AWS Lambda

#42
post #28

I have no clues about what's better but as a french I'm amazed by the idea to delegate banking operations to a cloud provider. Last time I worked in bank IT political requirement and good practices were using their own private physical network infrastructure over all the country and data storage server rooms were literally bunkers with armed security. Is it that common around the world and 'we' just happen to have be…

In the US at least, I never thought of banks as particularly tech-savvy, just change-averse. They tend to be the big companies with the worst websites and apps, transactions take days to clear, their secure messaging is a mess, everything about the UX is terrible, fraud handling and benefits usage seem like separate apps altogether... I dunno if any of that translates to their security handling, but I would imagine big cloud providers with huge security teams would be better equipped to deal with those concerns than any single bank would?

Certainly I would trust AWS with my information more than my bank. My bank is only trustworthy because we have regulations limiting my liability for unauthorized charges... without that I would never trust my bank (or Paypal, for that matter) to hold my funds. These are the same people that still use magstripes and publicly-visible numbers to authorize transactions, after all. Of all the services I've used, my bank is the only one that regularly gets its info stolen (credit card fraud). Thankfully the law doesn't let them hold me responsible for the charges.

Re: A bank runs serverless with PHP and AWS Lambda

#43
post #24

Earlier quoted context omitted.

It also makes sense if you look at things in the context of Choose Boring Technology [1]. If you have a working PHP app and want to scale into the cloud, you can use a single innovation token to move the app into lambda. This is the key sentence: > To do a controlled migration, the team deployed the application both to the servers and to AWS Lambda. Only 10 lines of code needed to be changed to run the monolith on AW…

Interesting to re-read that article again and see that technologies he cites as so cutting edge you're spending innovation tokens on them are now mainstream and very well understood. What would the new "you can use those but you're spending innovation tokens!" technologies would be. Rust? AI? CGP?

AI for sure. Rust maybe less. The big thing about these tokens is, folk spend them too early and try to use them for everything.

Part of choose boring is more about choose the right tool.

Would you build a PoC webapp by having AI generate Rust? Or, just bang out a few lines of PHP or JS? If the objective is to build a working business tool it's choice B; if the objective is to test AI making Rust then A

Re: A bank runs serverless with PHP and AWS Lambda

#44

I wonder why they went with AWS Lambda and PHP instead of something serverless-native like Cloudflare Workers? I guess they still have some critical parts of the legacy stack on AWS (DBs especially, but also other AWS services). I wonder if you can build something like this entirely greenfield today, like what you'd use as a permanent data store for all the transactions, without having to manage the scaling of each i…

Also, I just realized "Bref" is its own project that lets you run PHP on serverless Lambdas... like a Google Cloud Run on Amazon? Is this really such a big niche? It's weird to me to you'd want to use PHP for something like this (and I love PHP, it just doesn't strike me as the best tool for serverless).

PHP is great for serverless because its execution model is compatible with it.

Unlike Node, Python, Java, etc. that start a long-lived server, each request is handled by PHP in a separate process.

That's what makes it really to use with serverless (and lift-and-shift, like what Treezor did).

Re: A bank runs serverless with PHP and AWS Lambda

#46

Earlier quoted context omitted.

Also, I just realized "Bref" is its own project that lets you run PHP on serverless Lambdas... like a Google Cloud Run on Amazon? Is this really such a big niche? It's weird to me to you'd want to use PHP for something like this (and I love PHP, it just doesn't strike me as the best tool for serverless).

As you can see on the website ( https://bref.sh/ ) there's 13 billion monthly AWS Lambda invocations using Bref (PHP).

That doesn't really say much. Isn't the whole point of serverless to support high-volume, individually-inexpensive, invocations?

For context, 13B is like roughly a $2000 (edit: more like $4000, sorry) spend on Cloudflare Workers, similar cost (harder to calculate but ballpark similar) on Lambda. That could be a single company spending the bulk of that.

(Further edit: Lambda pricing is way off too. See reply below.)

Re: A bank runs serverless with PHP and AWS Lambda

#47

There was once upon a time a discussion about bank/finance software system. You have to keep long history of audit records / logs. It is difficult to peruse such consideration here with the database ballooned to the cloud.

> You have to keep long history of audit records / logs. It is difficult to peruse such consideration here with the database ballooned to the cloud.

Actually, it's easier. AWS RDS with multi-zone failover and replication + backups with retention schedules, deletion protection and legal holds... easy as a cake, less than 100 lines of Terraform code. And no risk of insider threats deleting, manipulating or ransoming the backups.

Re: A bank runs serverless with PHP and AWS Lambda

#49

I wonder why they went with AWS Lambda and PHP instead of something serverless-native like Cloudflare Workers? I guess they still have some critical parts of the legacy stack on AWS (DBs especially, but also other AWS services). I wonder if you can build something like this entirely greenfield today, like what you'd use as a permanent data store for all the transactions, without having to manage the scaling of each i…

DynamoDB as a data store for transactions works just fine, as long as you are aware of the trade-offs and design a good data model.

Re: A bank runs serverless with PHP and AWS Lambda

#50
post #44

Earlier quoted context omitted.

Also, I just realized "Bref" is its own project that lets you run PHP on serverless Lambdas... like a Google Cloud Run on Amazon? Is this really such a big niche? It's weird to me to you'd want to use PHP for something like this (and I love PHP, it just doesn't strike me as the best tool for serverless).

PHP is great for serverless because its execution model is compatible with it. Unlike Node, Python, Java, etc. that start a long-lived server, each request is handled by PHP in a separate process. That's what makes it really to use with serverless (and lift-and-shift, like what Treezor did).

Does that really matter when JS can be isolated in V8?

Comparing Bref (https://bref.sh/docs#maturity-matrix) which inherits Lambda's 200ms+ cold starts vs Cloudflare's 5ms (https://blog.cloudflare.com/eliminating-cold-starts-with-clo...), for example, is a pretty big difference.

But I guess if performance isn't a critical use (or you just have so many invocations all the time in every data center that cold start isn't an issue), it's nice to be able to ~port~ copy and paste over your existing PHP code.

Post reply on HN