Microservices Architecture: Development with Lumen (Laravel) Microframework

«Microservices» or «microservice architectural style» is an approach to developing a single application as a suite of small parts – services accessed through APIs - as opposed to «monolithic architectural style» when an application is built as a single unit. It allows different microservices to be written in different programming languages, and they can also be managed by different teams. When is it a good idea to use this architecture in custom software development and why do we use Lumen to build microservices?
Nov 27, 2017

Microservices Architecture Development

Figure. Example of Microservices Architecture.


According to the software requirements, each web project is reduced to one of the following types:

  • Development of an application from scratch;
  • Rebuilding (or refactoring) a legacy application;
  • Adding new functionality to an existing application.

Microservices architectural approach can be used in each of these cases. But often it is used for refactoring (rewriting) a legacy application from monolith into microservices.

Basically, there are 4 main reasons for it:

  • The application is getting so big that developers need a lot of time to understand it, and therefore organizational/project scaling issues are arising;
  • The application consists of different parts with independent and very different update&release frequencies;
  • There is a necessity to dynamically scale specific parts of the system up and down, independently from the other parts;
  • Different parts of the system have specific domain or technical requirements that force developers to use a programming language/framework which is different than the common programming language of the team. 


  • Protect from failure. In a monolithic service, if the service fails, everything stops working. With a monolithic system, we can run on multiple machines to reduce our chances of failure, but with microservices, we can build systems that can handle the total failure of services. Since services can fail at any time, it's important to be able to detect the issue quickly and, if possible, automatically restore working order. Microservice applications put a lot of emphasis on real-time monitoring, checking both architectural elements (how many requests per second is the database getting) and business-relevant metrics (such as how many orders per minute are received). Semantic monitoring can provide an early warning system of something going wrong that triggers development teams to follow up and investigate. This is one of the main reasons why organizations like Amazon and Netflix use these architectures—to ensure they remove as many impediments to getting software out the door as possible.
  • Scalability. A change made to a small part of the monolithic application (scaling), requires scaling of the entire application rather than parts of it which in turn requires greater resources (hidden costs of building the monolithic application). In contrast, microservices are independently scalable. With microservices, developers can make a change to a single service and deploy it (moving from test server to production server) independently of the rest of the system.
  • Decreasing team size and their productivity. Microservices help developers minimize the number of people working on each codebase to hit the sweet spot of team size and productivity. Project managers can also shift ownership of services between teams to keep people working on one service collocated. When services are isolated from each other,  much less coordination is needed between service owners. The less coordination needed between teams,  the more autonomy those teams have, as they are able to operate and evolve their services more freely.

Microservices Architecture Development

Figure. Microservices Architecture is sometimes the best technological solution for business. Source: martinfowler.com/microservices/#what


  • Gilt, an online fashion retailer, started in 2007 as a monolithic application, but by 2009 Gilt’s system was unable to cope with the load being placed on it. By splitting out core parts of its system, Gilt was able to better deal with its traffic spikes, and today has over 450 microservices, each running on a separate machine.
  • The Guardian website is another example of an application that was designed and built as a monolith, but has been evolving in a microservice direction. The monolith still is the core of the website, but they prefer to add new features by building microservices that use the monolith's API. This approach is particularly handy for features that are inherently temporary, such as specialized pages to handle a sporting event. Such a part of the website can quickly be put together using rapid development languages, and removed once the event is over. Similar approaches are used at a financial institution where new services are added for a market opportunity and discarded after a few months or even weeks.
  • Other examples include Amazon, Netflix, Google, Ebay, the UK Government Digital Service, realestate.com.au, Soundcloud, Forward, and comparethemarket.com.


Microservices need to possess the ability to read and write to a database, must be secured, be built with the so-called message-driven approach, and have the ability to provide reports. Modern microframeworks make these tasks as trivial as possible.

Lumen is the perfect solution for building microservices. It utilizes all benefits of Laravel framework including security, easy database configuration (MySQL, Postgres, SQLite, and SQL Server), queue service configuration, integration with reporting tools and so on.


Let’s imagine a standard web page on an ecommerce website. To pull together the various parts of that website, we might need several microservices. One of them might display the details about the product being offered for sale. Another might show the price and stock level. And we’ll probably be showing shopping cart contents too, which may be another microservice.

If the shopping cart service is unavailable, we’re probably in a lot of trouble, but we could still show the web page with the listing. Perhaps we just hide the shopping cart or replace it with an icon saying “Will Be Back Soon!” or replace the part of the UI containing the cart control with a phone number for placing an order.

The most popular open source microservices created using Lumen are located on github.com.

RESTful API Development with Lumen (Laravel) Microframework

API is an approach that allows different applications or different parts of a single application to share data among each other by special programming commands. By default, an application has no use for APIs if it is not defined by software requirements. When a customer orders an API creation from us and they want to go with Laravel Development then we usually suggest the use of Lumen. When is it necessary to develop an API for the application and why do we choose Lumen for this?

Example of using API

Example of using API

Probably every internet user has seen the most commonly known example of using API: the interactive Google Map in the 'Contact Us' section of almost any website. Each time a website displays this map, it sends a request across the Internet to a special APIs that’s offered by Google for that very purpose and it then receives the appropriate data transformed into an interactive Google Map. It means there is no necessity to redevelop Google Maps in order to add that functionality to the website (cost-effective approach) because it can be simply used by integrating the needed functionality through APIs.

Business perspectives of API development

As ProgrammableWeb editor-in-chief, David Berlind puts in his blog:

“For those who understand the potential of APIs, there could be millions of dollars to be made, or saved”.

Google Maps is an example of a cloud based web application that shares its own functionality through APIs for free, but with some limits, after exceeding which this API functionality becomes paid. Some other great companies such as Ebay provide APIs that help entrepreneurs to make money by integrating their web, desktop or mobile applications with the eBay API platform.

Lumen API development examples

For any API service, speed is very important, because if it is not able to serve a lot of requests per second fast, the business perspectives of using the API will be much reduced.

As we considered earlier, API development can be done using fast microframeworks like Lumen, which is one of the fastest PHP micro-frameworks available.

  • Lumen microframework can be used to build an API for a web application to integrate it with a mobile application. Simple example: a mobile bookstore application offers a search feature, where the user can look for books by author name. The mobile application needs to use an API, which should be provided by a bookstore web service, to get data about authors and books.
  • Lumen microframework can be used to build an API for integrating different microservices within a large service/application (core project). For example, a core web application helps to order stuff from local, offline stores/partners. Each of these stores/services come with their own APIs. The right development approach is to create a microservice, which will call the APIs of the partners and provide its own API to transfer data received from partners to the core web application.

The most popular open source APIs created using Lumen are located on github.com.

Articles you might be interested in:

Blog writers

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 *


If clothes make the man, the design makes the website. That's where potential customers start evaluating a product. The SaaS website can (and should) be an online lead-generation machine, so each component of it has to be as good as possible. As people generally remember the first and the last thing they see, having impressive header and footer can go a long way towards making your product successful. What do some of the best SaaS companies do with their websites’ headers/footers? Look at this list to get and keep in mind some ideas for custom software development while building or redesigning your SaaS website. ...

Our team is experienced both in PHP programming and Node.js development. We have a portfolio with both PHP-based applications and Node.js-based applications as well as mixed ones. What do we take into account when considering which tool to use in custom software development? ...

Laravel framework is very popular for custom software development. It is the Most Starred PHP Framework on Github: more than 35 000 developers from all over the world (mostly from the USA) greatly appreciate robust features of this platform. Based on data of the BuiltWith, Laravel's popular websites verticals include Business, Entertainment, Media, News, Shopping, Technology, Vehicles. Why is Laravel so popular? ...

Companies that hire remote (distributed, virtual, dispersed, or dedicated) workers and do it well seem to have a huge leg up on the competition. Let’s learn how these successful SaaS companies use global talents to increase software quality and reduce the cost of rent and office supplies: Basecamp, Buffer, Chargify, Convertkit, Ghost(pro), Groove, Hubstaff, Invision, Olark, and Zapier. As the company where you can find a remote PHP developer, we believe that you could utilize their experience and expertise to build your own full remote SaaS company. ...

Belitsoft has a huge experience in MVP software development for startups and prototypes for existing brands. MVP is a minimal version of the product with the minimum set of features that is enough to deploy and test the key hypothesis to solve problems of this product’ potential customers. Experts suggest that, in B2B, it’s not an MVP until you sell it. Viable means you can sell it. ...

The way to get profitable startup idea is not to try to think of startup ideas (including SaaS development). It's to look for problems, preferably problems you have yourself.  In fact, for many entrepreneurs, successful business ideas start out as solutions designed to address a challenge they face personally. Solving the problem that frustrates you may be one of the best ways of finding an idea for your startup. Look at these software developers who turned their problem into success.  ...

Get A Free Quote

Do you have a software development project to implement? We have people to work on it.
We will be glad to answer all your questions as well as estimate any project of yours.
Use the form below to describe the project and we will get in touch with you within 1 business day.

Call us:
Phone - USA
Contact form