Full-Stack Framework or Microframework, Laravel or Lumen?

Sep 16, 2016

Web framework is a tool for solving common software development problems fast (read as “cost-effectively”). Web frameworks are divided into full-stack frameworks and microframeworks. In this article, we will show what the differences between them are.

Belitsoft is a custom software development company (offshore software development). We provide custom application development services (PHP Development ServicesNET Development ServicesJava Development ServicesNodejs Development Services etc.)

Laravel Development Vs Lumen Development

Figure. It is faster to develop some types of software applications with a lightweight microframework rather than a full-stack framework.

 

WHAT IS A WEB FRAMEWORK?

There is no accepted definition of a “web-framework” meaningful for both developers and non-tech people. Someone says it is a skeleton of any modern web application, others – that it is an application without custom functionality, or even - it is architecture, plus an implementation, plus documentation etc.

Well, there are a lot of official websites of different web frameworks. How do their creators describe what is a web (server-side, PHP) framework?

  1. Symfony Framework is a "set of PHP Components. Symfony Components are a set of decoupled and reusable PHP libraries".
  2. The Joomla! Framework is a "PHP framework (a collection of software libraries/packages)".
  3. Zend Framework is a "collection of professional PHP packages".

Based on those official definitions, we can say that web framework is a collection of libraries/packages for creating a web application.

As a rule, programming library/package is a set of functions to perform specific task, for example, a library for sending emails. Here is a great list of libraries. The discussion about “framework” and “library” definitions can be found on the Stack Overflow and Stack Exchange, websites for professional programmers.

What is beyond doubt is that web frameworks “allows developers to save time by re-using generic modules in order to focus on other areas”. As an example, a framework will keep the developer from having to spend 2 or 3 days creating an authentication form (which is not a specific task). The time that is saved can be dedicated to more specific components as well as to the corresponding unit tests; giving the solid, sustainable and high quality code. Another example: when working in teams, things can get ugly when it comes to choosing options for libraries and tools. Usually, each member of the team will try to push her/his preferred options. Nevertheless, if the team is using a framework, it can simply use the default options and avoid discussions.

DIFFERENCES BETWEEN FULL-STACK AND MICRO WEB FRAMEWORKS

A full-stack framework is a framework that attempts to provide nearly everything — from web serving to database management right down to HTML generation — that a developer could possibly need to build an application. It likely includes components that may not be needed by the majority of applications, but having them available makes it easier to integrate new features.

Microframework

A microframework is a framework that attempts to provide only the components that are absolutely necessary for a developer to build an application; or it may focus on providing the functionality of one particular area very efficiently. Microframeworks often tend to be better-suited for smaller applications or for applications with specific purposes for which the framework was designed. In the case of web application frameworks, a microframework may be specifically designed for building the so-called APIs for another service or application. Microframeworks often need to be extended with additional components in order to make them provide more functionality.

Full-Stack Framework

Source: digitalcommons.uri.edu/cgi/viewcontent.cgi?article=1632&context=theses

 

Underlining this key difference between framework and microframework, some software engineers refer to their microframeworks as “Slim” or “Fat-Free”.

By the way, here is one more explanation about differences between frameworks and microframeworks, which was made by the creator of one of the microframeworks. The popular «microframework movement» took off in 2013 as an ideology. A microframework is a collection of bare necessities required to build a web application. Typically, a microframework facilitates receiving an HTTP request, routing the HTTP request to the appropriate controller, dispatching the controller, and returning an HTTP response. Some microframeworks take this a few steps forward and also provide additional tools to manipulate the HTTP response (HTTP caching, status updates, redirects, and so on) as well as a middleware implementation. Many developers are familiar with larger full-stack frameworks like Laravel or Symfony. These excellent frameworks have a larger codebase, more "kitchen-sink" functionality, but also require more time to learn them. For some projects, both Laravel and Symfony are great tools. For other projects that do not require additional features, microframeworks are a more appropriate tool for the job.

DIFFERENCES BETWEEN LARAVEL AND LUMEN

Lumen microframework 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 templating are not needed and Lumen takes them away, keeping what's essential - routing, logging, caching, queues, validation, error handling and a couple of others.

As Taylor Otwell, the main creator and maintainer of the Laravel and Lumen frameworks, underlined in his interview: “Lumen opts for maximum speed. The actual Lumen framework repository is probably only a dozen files or so. The rest is made up of the Illuminate components. This allowed me to flesh out the features of the framework very quickly, though it did take me three or four iterations to find a solution that was really, really fast while still providing very powerful features”.

Taylor Otwell also talked about one more key difference: «The entire bootstrap process is also located basically in a single file, which is less configurable overall than full-stack Laravel, but for small microservices and APIs that are mainly interested in speed it's a good trade-off».

Additionally, Lumen uses a faster router than Laravel (FastRoute instead of Symfony’s) and many features are disabled by default in Lumen in comparison with Laravel, for example, Facades, Dotenv environment files, Eloquent and so on.

 

WRAPPING UP

Being the best in a competitive market such as global outsource software development means providing the best technology solution to meet business needs while keeping in mind the limited resources (time and money) and quality requirements.

Which tool to use – a full-stack framework like Laravel or a microframework like Lumen – depends on software requirements and developer competence/experience. Top-notch developers teach: “Use microframework if you are comfortable with making all of your own architecture decisions and full-stack framework if not”. Since large web application can be built based on microservice architecture approach, this means that projects must not be just micro or small to use the microframework.

 

Subscribe to Belitsoft's Blog for Entrepreneurs

Join successful software startup founders! Get insights from growing companies like, where to get an idea, how to validate it, how to launch, and how to hire people - everything. Enter your email address below (no spam):

Email *