Hacker News new | ask | show | jobs
by joshstrange 968 days ago
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 of half-implemented things, etc.

I wouldn't lift-and-shift the PHP app I work on, it requires too many FreeBSD-specific/custom underlying services but I could make use of lambda for certain tasks while leveraging the PHP code we already have. We use SST for for some NodeJS (TypeScript) lambdas that have been very popular but PHP isn't going anywhere in our stack so I'd love to find a way to move the bursty parts of it to lambda.

2 comments

You can deploy using the CDK for example: https://bref.sh/docs/deploy/aws-cdk
Oh wow, that’s almost exactly what I need. Thank you! I don’t know if this is newer or if I just totally missed it the last time I looked.
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...

Sorry I wasn’t clear.

Yes, that’s the correct SST. Yes, we could host our PHP anywhere and there are options like Cloud Run. We are on AWS and so I was talking about AWS Lambda but I understand that wasn’t clear at all.

The reason for wanting to use Lambda is for bursty/inconsistent workloads. We have EC2 servers that handle all our traffic right now but some are oversized to handle the peaks. There are parts of our system that we could easily offload to lambda to reduce the load on the main servers if we could easily run PHP in lambdas.

I’m going to take a look at the CDK example OP posted (sibling comment to yours) since SST is just a layer over CDK and you can reach down into CDK easily.

I see, thanks for explaining!

Have you also looked into Elastic Beanstalk? It's an older AWS service but it's made to help you handle bursts or scheduled peaks.

I was about to say that wouldn't work but EB does appear to let you use a custom AMI which means we could have a FreeBSD host and make use of our full existing stack. I had written it off thinking it was little more constrained, or at least constrained to AL2/linux hosts. Thank you for bringing that to my attention.