Michael Timbs
2 min readMar 19, 2021

--

There are a few genuine concerns with Vapor but I honestly don't think any of these are very relevant.

Vendor lock in is not an issue I've ever run into anywhere and its generally more expensive to maintain vendor agnostic applications than it is to re-write parts of your code to move vendor.

Centralisation is a funny one. The beauty about lambda is you pay per execution. That means you can literally deploy your application to every single AWS region and have it cost exactly the same as if you'd only deployed in a single region. It would be a rare thing for AWS to be down globally. At that point I doubt anyone even notices if you are offline. Multi region deploys with traditional EC2 gets expensive fast.

The genuine problems with Laravel Vapor in my opinion are that you are putting a non-serverless application framework (Laravel) into a serverless execution environment which means you aren't getting the most out of it.

For example:

1. Lambda gives you infinite compute, if you are using RDS (or self managed MySQL) your database is not infinitely scalable. You are going to smash your DB if you get a spike in traffic as each lambda concurrently tries to access it. Generally your application layer will throttle with spikes and prevent that from overwhelming the database (unless there's a big discrepancy between capacity)

2. As you mentioned Lambda is designed to host single functions. Lambda is an excellent choice for building API's however it works best when your route handlers are just single functions that execute and not an entire framework that needs to boot up. Bootstrapping an entire application and routing inside the lambda is going to be slower than just shipping the handler code directly.

I'm also a little amused that you imply that the average person can run their own infrastructure better than AWS can run it for them.

So while I agree that Vapor has some issues - mainly that it only manages to capture about 20% of the value of a truly serverless application. I still think its going to be fine for most people. (and probably even the best choice). I do tend to think that AWS Fargate is a better solution for Laravel but given most of your grievances tend to be about hosting on AWS you'd probably have the same issues with that option.

--

--

Michael Timbs

Full-stack developer. In love with Typescript and Serverless