What are Microframeworks?

What are Microframeworks?

Over the last weekend, I built something simple with Lumen, APIs for onboarding users which included login, and a logged user profile. Coming from an AdonisJs Framework to Laravel and going straight to lumen gave me an experience I never expected, and then I saw the term microframeworks on the Lumen web page for the first time. This article answers some questions, what are microframeworks? When can it be used? And what examples of microframeworks exist?

What are microframeworks?

Judging from the term "micro" we might say an extremely small framework, and this shows that it is smaller than a framework in scope or capacity. So this means that a microframework can be a framework without its own template engine, database abstraction layer, a logger, a body-parser, a validator, an authentication module, etc.

When to use a microframework

The answer to this question is never a straightforward answer but some things can be put into consideration to help in making the decision to use a microframework.

  • Control: One question to ask is how much control are you willing to have and how much are you willing to surrender, this ranges from you having the choice to pick the different libraries you prefer for the project as you build instead of being stuck with the one that comes packaged with the framework to selecting the folder structure you desire for your project.

  • Size: How big is the project? The answer to this question helps you realise if installing all the packages a framework comes with is necessary, so if I am building APIs that have no interaction with the database, requires no authentication for users, and accepts no user input. Do I need to install a framework that comes bundled with a template engine, a database abstraction layer, a validator, and an authentication library or just one that has a routing library and enables me to make a request and simply returns a response?

Examples of microframework

Below are a few examples:

  • Express: This is a fast Nodejs framework that is used to build web applications. It is very minimalist and a backbone for many frameworks. It gives the users the freedom to fully structure there project the way they want and to select, whatever library the desire and need to accomplish the task before them. To learn more follow this link

  • Lumen: This is a PHP framework that is based on Laravel but made for building APIs and microservices. It gives one the power to use the needed Laravel features with little configuration while been fast. To learn more follow this link