What are microservices? Introduction to microservice architecture for eCommerce

Care to share?

In the last few years, microservices have been touted as the new way of building agile, easily scalable and fast-to-deploy infrastructures. They promise swift adaptation of businesses opportunities in an ever-changing landscape of online sales. What are microservices and do they deliver on their promise?

The concept of Microservices is rather new in development. The term ‘microservices’ was coined by a group of software architects in 2012. But it was not until 2014 that they started gaining popularity thanks to several publications by Martin Fowler, a British software developer and evangelist of microservices.

What is microservice architecture?

Microservices and microservice architecture have their roots in Service Oriented Architecture, also known as SOA, which is an IT structure built upon a collection of services exchanging normalized data and coordinating activities with each other, often based on specific events.

“We are already pursuing SOA with many hundreds of services. Microservices are the next step in SOA” – Ron Murphy, Principal MTS, Cloud Infrastructure and Platform Services at eBay (source).

The microservices approach takes these services, divides them into elementary pieces (the fine granularity is the key to microservices), complements them with an API layer, REST support, NoSQL databases, and organizes them around business domains.

monolith - services oriented architecture - microservices

Although there is no official definition of microservices or microservice architecture, we can make quite clear assumptions about this modern approach in software development. 

Microservice architecture is a modern development technique which structures the application as a set of loosely coupled, autonomous services (microservices) communicating over a network to fulfill one specific and well-defined purpose. Microservice architecture is tightly connected with the business domain in relation to which it arranges all services. This means that in practice the services are modeled after, and follow internal business processes. That’s why the structure of an organization plays an important role in the architecture of the microservices. 

Microservices are the basic units of microservices architecture – fine-grained services that answer to single business functionalities. All of them are small in size, with a single purpose, and communicate with each other via API’s and message busses. A microservice is like a self-contained piece of business functionality, rather than a layer within a monolithic application. 

The characteristics of microservices

  1. Fine granularity – microservices are small in size, organized around fine-grained business capabilities, and so their footprint is much smaller than services in SOA.
  2. Independence – microservices are developed and organized in order to be independent from any other parts of the system, and thus you can develop them, test them out and deploy them separately. 
  3. Specialization – microservices are designed to answer one, specific problem / business capability. If a microservice grows over time, it should be broken into smaller services.
  4. API oriented – microservices don’t share any of their code with other services, they communicate with well-defined APIs.
  5. Point scaling – with microservices, it is possible to scale up only the microservice that supports the function with resource constraints, which gives additional resource and cost optimization.
  6. Technology-agnostics – microservices are designed to communicate over a network. To fulfil this goal, they often use technology agnostic protocols such as HTTP or a message bus. 
  7. Openness for technologies – thanks to their independence, microservices can be implemented using different programming languages, databases, hardware and software environments, depending on what fits best. Different microservices can be built upon different technologies, but a single microservices won’t be a patchwork of programming languages.

From a philosophical point of view, microservices follow one simple rule: “Do one thing and do it well.” 

Microservices Architecture for eCommerce. Get free ebook>

How to understand microservices?

There are many technical aspects to microservices, but people and organization within the company also play a vital role in this architectural approach. 

“Organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations.” — M. Conway 

Microservices should reflect the way a company works. This includes people, teams, and processes. That’s why implementing microservices can require some organizational changes inside the company. Breaking a technical monolith up quite often goes hand in hand with dividing enterprise departments into agile, rapid teams to achieve faster results. In the end, the final outcome is that processes that took a few months can now be executed in weeks and everybody feels engaged. It’s something you cannot underestimate.

Beginnings of microservices 

The concept of microservices was shaped by evangelists of microservices, with Martin Fowler at the forefront, and global companies that faced the wall in terms of business scalability, agility and speed of implementing changes. Amazon, the provider of the major online marketplace, was one of the first. 

Not more than 10 years ago, Amazon’s IT infrastructure was built upon a mix of monolithic systems, and separate services and components that, at the time, were tightly coupled with one another. With hundreds of developers on board, Amazon could no longer deploy changes quickly. Their major goal was to simplify and shorten the pipeline of the development process, but this clean up soon turned into the revolutionary transformation of Amazon’s infrastructure into microservices. 

In the end, Amazon not only provided an example of microservices implementation but also released multiple solutions for building microservices (like AWS) and encouraged others to follow in their footsteps.

Examples of microservices in eCommerce

It was not long after that leading eCommerce companies joined this movement and transformed their infrastructures into microservices. eBay, Etsy, Gilt and Zalando, just to name a few, used microservices to created flexible, global systems and a whole new working culture, which is easy-to-enter and motivating for developers. 

For many of them, microservices were also a way to take control over typical eCommerce challenges, like traffic peaks during Black Friday and other holiday seasons. We’ll get back to the additional advantages of microservices for eCommerce platforms

Discover the success stories of Amazon, Coca Cola and other companies that implemented microservices.

Why have microservices become so popular?

Roughly speaking, because of what scaled systems achieve nowadays and the number of changes that are deployed on a daily basis.

As we observe the market, we see that companies tend to keep leading positions on the market, which is hard in an environment of fast-changing technologies and young disruptors who are changing and growing at unprecedented speed. 

Uber, Zalando and other companies that changed the online sales landscape in the past years managed to achieve that thanks to their ability to adjust to the market’s needs by experimenting, testing, and launching modern solutions in a short time. Well, it’s not that simple if you have the baggage of legacy systems and work with sophisticated business rules coded by thousands of lines of code. 

Microservices have become a way to overcome this by breaking monolithic systems into smaller pieces, with self-sufficient and granular areas of responsibility that can be easily tested and deployed even by small, inexperienced teams.

migration monolith to microservices
Monoliths to microservices

Top reasons for which companies are converting to microservices:

  • Simplifying and shortening the development and deployment process while keeping the system stable
  • Gradual replacement of legacy software
  • Allowing multiple developer teams to work on a single application ecosystem
  • Building systems that are easy to understand, maintain and modify
  • Increasing the productivity of new and existing team members
  • Working with continuous deployment
  • Scaling applications where it is needed and without limits
  • Adopting emerging technologies (new programming languages, technologies, trends, etc.) without major risks

Benefits of microservices

Adopting microservices brings back agility and technological freedom to organizations. With fine grained services, teams can work faster, choose technology that best suits the service and take ownership of it. In addition, a company can shorten the time-to-market of new solutions.

Developing isolated services allow developers to speed up deployment processes. With continuous integration and delivery it is much easier to try out new ideas or roll back if some features are not working properly – without affecting the stability of the whole infrastructure.

By decoupling systems, you gain small services that are simpler to learn and change, and engage new developers or even external teams. Microservices can also be reused by other teams within the organization.

Benefits of microservices for eCommerce

From the eCommerce perspective, microservices are the ultimate way to prepare eCommerce platforms for traffic peaks, as well as implement and test out the latest trends, like new payment methods, voice assistants or Progressive Web Apps, without significant risks. 

Most of the newly introduced solutions are built using the headless approach and fit and match perfectly with systems built using microservices architecture.

Microservices can also be a way of setting up complex omnichannel systems. To fulfill your customers’ expectations about omnichannel, you have to integrate each and every piece of information about products, shipments, stocks and orders, and keep it all up to date. And although there are some one-stop solutions, microservices enable companies to use API gateways to integrate POS, ERP or WMS solutions that are best-in-category, and synchronize them with existing processes.

Are microservices the right fit for your eCommerce platform?

Of course, microservices aren’t a panacea. With all the benefits microservices promise, one might wonder why some online platforms have not turned to the solution.

With every microservice added to your application landscape the overall overhead increases. Vast containerized hosting clusters are needed, deploying new code needs advanced orchestration, and in this forest of small applications, IT teams might get lost in which service is handling what. 

Nonetheless, multiple case studies show that microservices improve performance of eCommerce platforms, as well as the whole team working with them. The excellent examples of Amazon, Coca Cola or Zalando prove that even large, global enterprises can use microservices to rescue their monolithic systems

“Almost all the successful microservice stories have started with a monolith that got too bit and was broken up” – Martin Fowler

Learn more about microservices.

What if we could have some of the important benefits of microservices while limiting this overhead? That is possible with Service Oriented Architecture which isolates certain bigger business processes into larger services that cover a few coupled functionalities. 

Make eCommerce ready for changes with microservices architecture >

Published September 18, 2019