Should I use Laravel Vapor?
laravel-tips Jack Ellis · Mar 25, 2020A lot of people have heard of Laravel Vapor, and know that it's for Serverless Laravel deployment, but they aren't too sure what it does.
Laravel Vapor was built by Taylor Otwell and the Laravel team and is a serverless deployment platform for Laravel applications. It effectively marries our code to underlying AWS infrastructure with very little effort from us, which is great. A lot of people have avoided AWS, because there’s too much to learn, but we now have an easy route in.
The beauty of Vapor is that we can control AWS resources through its beautiful user interface. This means we always stay at the high level and, only occasionally, do we need to dive into AWS a little to play around with some configuration.
Vapor, to me, is a step up from Heroku. For those of you who haven’t used Heroku, it’s a beautiful GUI / platform that lets you provision dynos (servers), and attach add-ons, without doing any configuration yourself. But it’s expensive and they limit you to rigid tiers with certain things such as Redis / Postgres / MySQL, meaning it costs more when you need a small upgrade. Instead of allowing you to upgrade to the next AWS tier, they limit the tiers to force you into paying more. Comparatively, with Vapor, you get access to every single sizing option that AWS offers.
Laravel Vapor is the future of Laravel applications. With Vapor, they charge a fixed price of $39 / month and you get AWS prices, with zero markups, for everything it provisions. No markup, how wonderful. It ends up being MUCH cheaper for a lot of use cases.
But that’s the technical side of things, what is Vapor actually for? Why would I use Vapor instead of DigitalOcean?
Why should I use Vapor
You don’t want to spend your time managing servers
You don’t want the updates, CPU / RAM monitoring, server reboots, corrupted hardware, etc. You value your health and enjoy your sleep. Being on-call 24/7 is stressful and exhausting. 2 AM downtime notifications and whatever else comes with managing servers. Sure, it doesn’t happen all the time, but you (or a member of your team) need to always be available to put out fires. Using Vapor means you can utilize a series of AWS services that are all fully managed for you, meaning the AWS team gets the 2 AM calls. Your time is more valuable spent building your application.
You don’t want to hire outside help to manage your servers
When we used a multi-VPS set-up for Fathom Analytics, we were quoted $1,000 / month for DevOps support. We’d have someone who gets notified if our servers have issues and they’ll respond as soon as possible. That is expensive. We only had around 3-4 servers.
You have unknown or varying server load
Vapor is perfect for unknown or varying workloads, since you could process 400 million requests at 6 random times throughout the month, and then 1 million every other day, and you wouldn’t have to over-provision. You only pay for the requests you use.
You run a critical service and want as little downtime as possible
Because Vapor uses AWS Lambda, it means thousands of different servers are being used to process your web requests. This means that you won’t run into these server-related downtime issues on AWS Lambda. The same applies to the queue service (SQS) and the database. Sure, the database service can have downtime, but you can mitigate that very easily. We’ll be covering that in the course.
You like to tweak settings & experiment
In Vapor, scaling your cache or database is as simple as clicking Scale and then entering your desired size. This means you can tweak to your desire and monitor the outcome.
You want a platform that was made specifically to host Laravel applications
Laravel Vapor was built by Taylor Otwell and the Laravel team. Why is this important? Because they are Laravel experts, and the platform was built specifically for the framework your application uses
When you shouldn’t use Vapor
Now before we close up, I want to balance out this argument and keep it objective. If a hosting bill over $20 / month concerns you, or the $39 / month price tag for Vapor seems expensive, I’m going to go ahead and say Vapor is probably not for you.
Vapor is for people who hear "$39 for zero server maintenance" and reply immediately with "Sign me up now". When I first pitched Vapor to a client of mine and explained that you can set up applications on-demand, have zero server maintenance and high availability, they wanted to move right away. Businesses understand the human cost of server maintenance, and it’s thousands of dollars. If they can pay such a small amount to solve this problem, they would fly someone to Taylor Otwell’s house and hand him $3,900 for 10 years of Vapor, and it would be cheaper to do all of that than to pay a developer for a week of server set-up and then the infinite server maintenance that comes with that.
And that's my summary on Vapor and whether you should use it. If you're curious, I hear that someone has a course on how to use Laravel Vapor.
BIO
Jack Ellis, CTO + teacher
Recent blog posts
Tired of how time consuming and complex Google Analytics can be? Try Fathom Analytics: