Published on

Laravel vs lumen


Before going in deep, let me introduce with microservice. Because lumen is microservice and Laravel is a full-stack framework.

What is Microservice?

Micro Service is an independently deployable service modeled around a business domain. It's a method of breaking large software applications into loosely coupled modules, in which each service runs a unique process and communicates through APIs. It can be developed using messaging or event-driven APIs or using a non-HTTP backed RPC mechanism.

Not all but mostly, the big project like Amazon is built over microservice. Microservices like a user account, payment, product, etc..

Introduction of Lumen

Lumen micro framework is a lightweight version of Laravel full-stack framework. Lumen use the Laravel syntax and components and can be 'upgrade' easily to Laravel.

Lumen is a more specialized (and stripped-down) framework designed for Microservices development and API development. So, some of the features in Laravel such as HTTP sessions, cookies, and templates are not needed and Lumen takes them away, keeping what's necessary to querying using API and returning data- routing, logging, caching, queues, validation, error handling, etc…

Additionally, Lumen uses a faster router than Laravel and many features are disabled by default in Lumen in comparison with Laravel, for example, Facades, Eloquent and so on Use of Lumen and Laravel

  • Lumen is microservice, which generally uses where you need only HTTP API endpoint which fetches data in any format, you specify from data storage like database…

  • Laravel is a full-stack framework, using this you can develop a full-fledged website, scratch to design deployment and also you can build API using Laravel

Lumen vs Laravel Performance

Lumen is all about speed and performance. Lumen has the same component as in Laravel but strips down the bootstrapping process to a minimum. Laravel glue together all components including third-party packages

one of the largest proponents for using Lumen is its performance. It still beats most other frameworks (Laravel included). However, Laravel is speeding up. We see from Taylor’s recent benchmarks Laravel (without sessions) pushes 600 req/sec. This is still a third of what Lumen touts - around 1900 req/sec. conclusion

so you’ll generally only be using Lumen for an API and not for displaying a website to the user.