Live data from Hacker News

A bank runs serverless with PHP and AWS Lambda

bref.sh

31–40 of 132 posts

Re: A bank runs serverless with PHP and AWS Lambda

#31

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).

Re: A bank runs serverless with PHP and AWS Lambda

#32

I feel like the naming of the bank (Treezor) is slightly unfortunate since it's so close to the "Trezor" bitcoin hardware wallet...

Tresor means safe / vault, it's a quite natural name for a bank.

Tresor -> Treasure

Re: A bank runs serverless with PHP and AWS Lambda

#33
post #3

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.

We use Lambda (via Laravel Vapor; https://vapor.laravel.com/ ) for a big analytics batch processing job every night; it spawns hundreds of thousands of individual jobs that make various API calls, but only for a few minutes. For the rest of the day it's doing very little. I'd imagine a bank has quite a few of these sorts of bursty bash processing needs; ACHes, end-of-day reconciliation, etc.

What's your experience with Vapor? We played around with it and thought about switching from Forge, but it was too complicated for our codebase. I love the idea though.

How expensive our your cloud costs? CI/CD pretty good?

Re: A bank runs serverless with PHP and AWS Lambda

#34

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.

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.

Re: A bank runs serverless with PHP and AWS Lambda

#35
post #14
post #9

Earlier quoted context omitted.

hur dur php bad because they told me

I mean, it's not like that sentiment is totally baseless. I've used PHP years ago and both language and core libraries were not well-designed and came with many footguns. I've heard that modern PHP with frameworks like Laravel fixed a bunch of this, so presumably it's quite capable these days. But PHP certainly wouldn't be anywhere near the top of my go-to list at this point.

Eh, at this point can we just stop with the echoing of old memes? I used PHP4 and have used it continuously up to the modern day. If it's not your choice of language that's fine - language choice is pretty unimportant in the grant scheme of things... that said, it can do everything you need it to do (outside of low level memory control). If you need bit-efficient data structures it isn't going to be a good fit... but compared with most other system programming languages it's fine. I'd even go so far as to say it's one of the leading language in terms of meta-programming at this point with an excellent Reflection suite and great built-in magic methods.

Re: A bank runs serverless with PHP and AWS Lambda

#36

I'd really like to play with Bref but it more or less requires using serverless framework from what I understand as there are no guides on how to get it working with something like SST. I've used serverless framework before and I won't touch it again. It seems like a complete dead end with the team behind it more or less giving up on it to go work on a cloud backend alternative to lambda/etc. Docs were a mess, lot's…

What is "SST" in this context? Is it this thing? https://sst.dev/

I'm having trouble understanding where PHP fits into this scenario. If your cloud backend is in PHP, can't you just host that anywhere, separate from your frontends? Where does the serverless come in? And which did you use? (There are so many out there now, from AWS Lambda to Cloudflare to Fastly, etc.)

If you're not limited to AWS, Google's Cloud Run lets you containerize a PHP app and auto-scale it up and back down to zero in bursts, for example. It's not really serverless, just an auto-scaling VM that goes up and down as needed.

edit: google cloud functions might be even closer: https://cloud.google.com/functions/docs/create-deploy-http-p...

Re: A bank runs serverless with PHP and AWS Lambda

#37
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…

These are public facing bank services - so at some point have to be connected to the internet, quite a few banks use AWS for this [1]. I don’t know about Treezor but most of them will still have their own data centres for some or all of their ‘secure’ systems (if only because it’s running on some legacy hardware)

[1] https://aws.amazon.com/financial-services/banking/

Re: A bank runs serverless with PHP and AWS Lambda

#38
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…

What makes a physical server so much more secure than a cloud-provided one? AWS services are very secure: they have a list of compliances and security controls for banking-related services here:

https://aws.amazon.com/financial-services/security-complianc...

Re: A bank runs serverless with PHP and AWS Lambda

#39

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).

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

Re: A bank runs serverless with PHP and AWS Lambda

#40
post #3

Earlier quoted context omitted.

We use Lambda (via Laravel Vapor; https://vapor.laravel.com/ ) for a big analytics batch processing job every night; it spawns hundreds of thousands of individual jobs that make various API calls, but only for a few minutes. For the rest of the day it's doing very little. I'd imagine a bank has quite a few of these sorts of bursty bash processing needs; ACHes, end-of-day reconciliation, etc.

What's your experience with Vapor? We played around with it and thought about switching from Forge, but it was too complicated for our codebase. I love the idea though. How expensive our your cloud costs? CI/CD pretty good?

Overall quite good. We use their Docker container support (to get ffmpeg, mostly) and it's been pretty smooth running throughout. I'd previously used a lot of Heroku so the habits developed there paid off in our codebase for Vapor; only a few tweaks were really needed.

Cost-wise we're pretty bursty, so it's saved us quite a bit. Lambda runtime is money, so a little bit of performance optimization can go a long way. CI we run through Github Actions; an environment secret plus `vapor deploy` and it's on its way up after a successful run.

Wasn't a fan of Forge; for that style of things I'd use Ploi nowadays.

Post reply on HN