Laravel Queues in Action (2nd edition) is now available!

To use Vapor or not to use it?

Updated: Aug 15, 2019 — 1 min Read#vapor

A $5/mo instance is cheap anyway, why should I use Vapor?

If a $5/mo instance is working great for your project then you don't need Vapor. However, if your app needs to run on more than one of those instances then Vapor is a great choice, it'll let you focus on your business logic while utilizing AWS lambda to handle all the scaling work for you.

Serverless is a hype. I don't want to build my app in a different way and make it impossible to go server-ful in the future.

I doubt it's a hype, it's a supercharged auto-scaling solution and could save you a lot of time & money. Even if you decide to move away from serverless and return to the familiar server environment, all you need to do is remove laravel/vapor-core from your project and deploy your app on a server as you used to do.

I don't need auto scaling, I'm happy on a single server.

If your app isn't that critical then I agree. However, servers go down all the time; so at least consider a service like Oh Dear! to warn you when this happens so you can fix the server or spin a new one. Or, you can use Vapor and rely on the fact that a container will always be available to run your app, and if one container crashes, a new one will be used instead.

Local Development is a hell when using serverless.

I wouldn't say it's a hell, but yeah it's a bit more complicated. That's the case when you are using microservices, where you split your application to multiple lambdas. Laravel Vapor doesn't work this way; Vapor allows you to build your app the same way you're used to with Laravel applications. Local development is same as you always do, use Laravel Valet or Homestead or Docker. You can also use the vapor test command to run your tests using the same runtime Vapor uses on your lambda.

Hey! 👋 If you find this content useful, consider sponsoring me on GitHub.

You can also follow me on Twitter, I regularly post about all things Laravel including my latest video tutorials and blog posts.

By Mohamed Said

Hello! I'm a former Laravel core team member & VP of Engineering at Foodics. In this publication, I share everything I know about Laravel's core, packages, and tools.

You can find me on Twitter and Github.

This site was built using Wink. Follow the RSS Feed.