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.

By Mohamed Said

Hello! I'm a web developer, cyclist, runner, swimmer, and freediver. Nice to meet you! I currently work at Laravel. You can find me on Twitter, Github, and Strava. You can also check my blog.

Join Our Mailing List

If you like this article, you may want to consider joining our mailing list to receive new content once it is posted.
This site was built using Wink. Follow the RSS Feed.