- An explanation of microservices and how to build with them
- A list of 5 key advantages of microservices architecture
- Some cases in which monoliths still serve the business need
Check the speaker list of any eCommerce conference or meetup and you’ll find plenty of talks referencing microservices. But what makes it such a popular subject today?
Amazon, Netflix, Coca Cola, Uber, or Zalando already know what the fuss is about. These global leaders typically started using a monolithic architecture because, in the initial phase of projects, it is much faster to set up and get the business running. The problems, however, arise when it comes to scaling the business as the code gets more complicated, the architecture more complex, and more developers are needed just for the maintenance processes.
At some point, monolithic architecture becomes an obstacle standing in the way of growth. Expanding a business requires breaking the boundaries, experimenting, changing, and risk-taking; keeping the status quo means simply going backward. But with a team of a few dozen engineers and extremely sophisticated business rules and thousands of lines of code—which is how it looks with robust monoliths—it is extremely hard.
The global leaders have already hit this wall. Amazon’s scaling was blocked by typical bottlenecks such as long deployment times, difficulties with adding new features, and dealing with cast databases; Netflix’s tightly coupled architecture was a blocker to development as a single mistake could have caused expensive downtime of the whole system; and Zalando couldn’t handle the dynamic rise in traffic to the site. Even though the specific problems each company seemed different on the surface, their core was very similar: monolithic systems were convenient at the start but turned out to be insufficient for scaling up business.
Read more about 10 global brands that implemented microservices and paved the way for others in our blog post. Read the full article
However, microservices should not be considered as a solution only for globally-operating brands. In fact, the main idea is based on the separation of particular services which come together as a whole system; this makes them the particularly good choice for start-ups as it is almost impossible to forecast the future needs of a fledgling business and microservices can be added and removed as desired.
What is microservices architecture?
What exactly stands behind the term “microservices architecture”? Basically, it’s a modern way of structuring IT systems not as an “all-in-one” unit but as a set of loosely-coupled, collaborating services. With microservices architecture, each system feature is implemented by a single microservice. For example, a system might consist of microservices (e.g., CRM, CMS, OMS, loyalty programs) “covered” under one app. If one of them doesn’t meet the expectations, it is easily replaceable with another
Even though it is set to become the norm, this is still a quite innovative approach. Traditionally, monolithic applications that contain all the code driving the business were the go-to solutions for all sizes of company. Businesses simply seemed the most convenient and reliable solution to get projects started, and that meant choosing a solution with features delivered out-of-the-box by providers. It saved time and in-house resources while allowing the companies to get their business up and running relatively fast.
It’s also worth noting, that the problems with scaling may never occur. If the business growth is stable and predictable, monoliths can handle all the challenges. However, this is the exception rather than the norm and it is more common—especially in highly competitive environments such as eCommerce—to use a system that can dynamically adapt as consumer needs move fast and initial assumptions about the business quickly become outdated.
The drawbacks of monolith architecture are numerous and impact not only technology issues but also company structure. As all elements in the system are tied to each other, every single change—such as altering the UI layer, switching to a faster framework, or replacing the CMS with a more user-friendly alternative—has the potential to crash the system. It is, after all, a closed unit which is not designed to be messed with. What’s more, even the tiniest update costs time as it needs to be thoroughly tested to be confident that nothing will go wrong. At some point, it becomes extremely difficult to make any updates with no worries about the potential repercussions. App development is therefore significantly slower and developers stop trying to innovate and break boundaries with new features as they are primarily focused on not breaking the system. That is obviously not the way to win any market.
It is easy to see why monoliths are not well suited for today’s demands. Success in online business means traffic increases, dealing with robust databases, adding new features and integrating external tools. The once convenient and easy-to-use all-in-one platform is soon overwhelmed as the market moves on and the business grows.
Microservices are the answer to this challenge. Their decoupled architecture allows companies to develop their infrastructure at different speeds, which is crucial to overtake the competition in an age of fast-shifting user expectations. The frontend technology must be capable of moving forward within short iterations to make room for never-ending testing and adding new features, while the backend must ensure the whole system is stable.
The key advantages of the microservice approach:
1. Business constancy
With the microservices approach, all business features are granularly split into separate micro-applications, even when migrating from monolith architecture to microservices. Each can be developed, tested, and deployed separately and without shutting down the whole system or risking losing stability.
2. Faster time to market
Leveraging a decentralized development process, you can test out ideas in a short time and introduce innovative solutions to customers before your competitors. Progressive web apps are one such solution and we have run a proof of concept for the Magento platform. What’s more, by promoting teams whose features are published for production, you can raise their accountability, effectiveness, and engagement.
3. Domain expertise
Microservices allow you to have separate services for things like promotions, checkouts, or product catalogs. Each can be continuously improved by a dedicated development team with business analysts and developers on board. Such an approach builds engagement of the team and speeds up development and innovations.
4. Simpler knowledge transfer
Leveraging the Single Responsibility Principle means that a single microservice only performs one business function. Therefore, developers can create more efficient, clear, and testable code. The overall microservices architecture is much easier to understand so even new developers can maintain or modify it quickly and with fewer mistakes.
5. Easier outsourcing
With the microservices approach, all services are separable and relations between them usually have to be well documented. It’s therefore quite easy to use ready-made products, such as mobile-first solutions, or outsource particular services to other companies.
Are there any disadvantages of microservices?
The benefits of microservices should be clear by now but how about the drawbacks? No system is perfect, so we can point to a few.
– Microservices aren’t always the best fit for every organization as it requires a lot of research to establish the goals and needs.
– Microservices speed up business growth where monoliths fail. However, if the monolith is not complex, switching to microservices will not bring any benefits.
– Microservices require a mature, agile culture and a deep understanding between business and tech departments. The API-focused approach means the entire system is designed to bend technology to the needs of the business… but those business needs must be recognized and clearly translated to the tech team.
Monolithic architecture has some clear advantages and is good for getting a business up and running with limited in-house technical knowledge. However, it is too slow and too inflexible for turning a company into a leader, shaking up the market, or outpacing the competition. Microservices are a much better choice in this case but also make sense for small businesses which are unsure what their technology needs will be in future.
From an organizational point of view, introducing microservices architecture into the company can also positively influence management, push teams towards an agile way of working, and help the company adapt quickly to changing market needs. The pace and dynamism of the company starts to mirror the technology it uses.
Learn more in the Microservices Architecture for eCommerce ebook, available to read here.
This article was originally written by Ola Kwiecien and later updated for publication by Kaja Grzybowska.