What Benefits Can a Microservice Architecture Bring to Your Project?
- 20596 views
- 6 min
- Apr 16, 2019
The question of architecture usually arises when a product runs into issues. Whether they’re facing scalability or maintenance difficulties, product owners begin to think about moving from a monolithic to microservice architecture. But is it really worth it? What sorts of problems can a microservice architecture solve, what are microservices architecture advantages and what big names have already migrated to microservices? Let’s find out!
6 advantages of a microservices
So why is a microservice architecture so popular and what advantages can a microservice architecture bring to your business? Keep reading to find out the key benefits of a microservice architecture.
#1 Dynamic scaling up
Entrepreneurs rarely think about a microservice architecture right from the beginning. They prefer to go with a monolithic since it’s cheaper, faster and requires fewer specialists. However, when the product is launched and its complexity grows, the team has to deal with a range of issues. Like the team at Airbnb did.
Consider a large online marketplace Airbnb that started with a monolithic architecture built on Ruby on Rails. This solution worked perfectly at first. However, as the company grew, they faced a range of problems connected with the constantly growing complexity of the platform. Their product became increasingly rigid. This, in turn, led to issues with deployment, scalability, and performance speed.
Jessica Tai, a developer at Airbnb, says that the delay in deploying code to production reached 15 hours a week due to reverts and rollbacks. The tipping point was when the platform grew to 500,000 lines of code. At that point, Airbnb realized that its monolithic architecture — with various components tightly coupled — had become spaghetti code. When a problem occurred, it was difficult to find it in the pile of code, so every engineer had to check if it was their code that had caused the problem.
Airbnb decided to break their monolithic architecture into small, discrete services that would be easy to manage. This way it would also be easy to add new services when needed. They started migrating to a microservice architecture.
Today, Airbnb deploys 3,500 microservices every week, has 1,000 software engineers instead of 200, and has improved page load productivity up to tenfold, providing every user with 100 percent availability and 100 percent productivity.
The modern Agile approach is tightly connected with such practices as DevOps, continuous integration (CI), and continuous deployment (CD). All of these practices allow for faster deployment, problem-solving, and time to market. Because of its tight connections between each and every component, a monolithic architecture hampers the Agile and DevOps processes.
This problem, as well as a range of smaller ones, made Amazon reconsider their monolithic architecture and migrate to microservices. In a microservice architecture, each service does only one thing or implements only one functionality. It’s really easy to release, scale, deploy, and test every service separately, as it contains a lightweight codebase.
All microservices work independently and can be written with different technologies. This is a big advantage of microservices: it allows each team to choose the stack of technologies that best fits their particular functionality.
A microservice architecture allowed Amazon to move from their three-layer team structure (UI, database, and engineering teams) to small, efficient, cross-functional teams that are built according to business capabilities. Small teams are each responsible for one service, building it and running it for its full lifetime.
The size of teams at Amazon is determined by the “two pizza rule”: two pizzas should be able to feed any one team. This rule was invented by Amazon CEO Jeff Bezos.
#3 Improved scalability
One of the greatest advantages of a microservice over a monolithic architecture is that a microservice architecture allows different components to scale at different rates; a monolithic architecture requires you to scale the whole application. The flexibility of microservices lets a system expand fast without requiring a significant increase in resources.
This is exactly what Netflix was searching for when it faced the challenge of a growing user base and the need to scale fast. At the time, it took the team hours or even days to increase the capacity of data centers. With a microservice architecture, hundreds of server instances can be commissioned simultaneously to meet the increased demand for services, meaning the team could increase or decrease capacity within minutes.
Adrian Cockcroft, Netflix’s cloud architect, admits that a large number of systems means more time needed to manage them efficiently. But at the same time, this approach guarantees better stability for the whole system. A problem in one small service is easy to detect and solve. And losing one small service is much better than losing the whole system at once. But this wasn’t the only problem Netflix solved when they moved to a microservice architecture.
#4 Independent team collaboration
When Cockcroft explained the reasons why Netflix decided to move to microservices, he mentioned that a team with more than 25 engineers starts facing difficulties collaborating while working on one product. The Netflix team was even bigger, and managing it became a real headache.
By decomposing the monolithic structure into separate services, Netflix also decomposed one team into more than 30 small engineering teams that now work independently.
#5 Flexibility of components
A monolithic product is rigid when it comes to replacing one piece of functionality or making some changes. When engineers amend something in one place, it can cause ripple effects, bugs, and errors in the entire system.
This disadvantage of a monolithic architecture was the trigger that made The Guardian move their website from a monolithic to microservice architecture. The new microservice architecture allows engineers to add, replace, and remove different services without influencing all other microservices since they all work independently.
Today, the Guardian can easily add and remove different sections of the website as needed. This is especially important for event sections. When an event is over, developers can easily remove the section for the event without changing the main functionality of the site. Thus, The Guardian improved the replaceability and upgradeability of their system when they moved to a microservice architecture.
#6 Reduced response downtime
For a huge retailer like Walmart, response downtime plays a crucial role in success. Once the company reached six million page views per minute, its engineers understood that their monolithic architecture would be unable to manage continued growth. What was even worse was the time needed to process every operation. That’s why in 2012, Walmart decided to move to microservices.
The results were stunning. The downtime was minimized. Walmart saved up to 50 percent on operating expenditures when they stopped using expensive hardware and migrated to virtual servers. The conversion rate increased by 20 percent and mobile orders went up by 98 percent.
Microservice architecture is a perfect solution for a growing product and an agile team. If you still hesitating to move to a microservice architecture, look at the infographic below that outlines the key advantages of microservices.
Ready to get the most out of microservice architecture?
A microservice structure lets engineers avoid the majority of problems common to monolithic applications and maximize the productivity of your product. After reading this article, you shouldn’t have to ask why to migrate to microservices, only how.