Jun 26, 2018 Web Development
An Introduction to Microservices – Features, Advantages and Applications
Introduction to Microservices
Microservices are also known as the microservices architecture. It is a software development technique or architectural style in which a large application is built as a suite of modular services i.e. Small, independently versioned and scalable customer focused services with specific business goals, which communicate with each other over well defined and standard protocols and interfaces. In this, the services are fine and the protocols are lightweight. The main benefit of decomposing an application into different smaller services is that it improves modularity and makes the application easier to understand, develop, test and more protective against architecture issues. As these services are independently deployable and scalable hence each service also provides a firm module boundary, even allowing for different services to be written in different programming languages and can also be managed by different teams.
The modern day Web Developer knows about this that Microservices architecture is a distinctive method of developing software systems which have become popular. As this approach is scalable hence this architectural method is considered ideal when you have to enable support for a range of platforms and devices, for example: web, mobile, IoT (Internet of Things), wearables or even when you are not sure what kind of devices you will need to support in future.
The main reason behind microservices architecture is that some types of applications become lot more easier to build and maintain when they are broken down into smaller components which work together. Means each component is developed separately and the application is then simply the sum of all of these constituent components. In this approach, each service runs a unique process and manages its own database. This provides development team with a more decentralized way to build software. It also allows each service to be deployed, built and managed independently bringing so many benefits.
Features of Microservices:-
- Decoupling: As services within a system are mostly decoupled hence the application as a whole can easily be built, customized and scaled.
- Componentization: Microservices are treated as independent components which can easily be replaced or upgraded whenever required.
- Business Capabilities: Microservices are very simple and mainly focus on a single capability.
- Autonomy: This means that the developers and teams can work independently of each other thus enhances speed of development.
- Regular Delivery: It allows the frequent and regular release of software through systematic automation of software development, testing and quality assurance.
- Responsibility: Microservices do not treat applications as projects but they consider applications as products for which they are fully responsible.
- Decentralized Governance: In this approach, the main focus is on using the right tool and technology for the right job. This means that there is no standard pattern. Developers have the freedom to choose the best useful tools to solve their problems and issues.
- Agile Development: Microservices support Agile development. In this, any new feature can be quickly developed and discarded if not needed.
Benefits of Microservices
The present day Software Developer understands that Microservices give them many benefits when we compare it with monolithic architecture. Let’s discuss some of them here:-
- In microservices approach, the architects and developers can choose fit for purpose architectures and technologies for each of the microservice. This gives the flexibility to design more fit solutions in a more cost effective way.
- As services in this approach are very simple and smaller in size hence the enterprises can do experiment of new processes, algorithms, business logic etc. It helps the organizations to do innovation by offering the ability to experiment.
- Microservices help us in building the systems which are organic in nature because microservices are about independently manageable services which enable to add more and more services as the need arises with almost no impact on the existing services.
- Microservices make it possible to change or upgrade technology easily for each service individually rather than upgrading the entire application.
- Microservices also enable to implement scalability means the service can be independently scaled up or down and cost of scaling is lesl than monolithic approach.
- Microservices are independent and self contained deployment modules and enable the replacement of one microservice with another similar microservice if it doesn’t perform well. It also helps in taking the right decisions which are not easy to take for many organizations.
- Microservices group the service runtime environment along with the service itself which enable having many versions of the service to coexist in the same development and runtime environment.
- Microservices enable smaller and focused Agile teams for development. Teams can be organized based on the boundaries of the microservices.
Examples of Microservices Architecture Implementation
There are so many organizations which have evolved from monolithic to microservices architecture like Amazon, eBay, Netflix, Twitter, UK Government Digital service etc. Let’s discuss about some of these applications.
After many years of waiting Walmart finally did it by opting of Microservices architecture as their earlier one was negatively affecting the business. Walmart’s IT department had to make this decision as they had to address the issue after their failing Black Fridays for two years in a row. The main problem was that it was not able to handle the 6 million pageviews per minute thereby generating not good user experience. Before going for microservices, Walmart had an architecture for internet of 2005 which was designed around desktop and laptops. In 2012, Walmart decided to replatform this old system as it was unable to scale for 6 million pageviews per minute and was down for most of the day during peak events. Walmart wanted to prepare for the world of 2020, with 4 billion people connected and 25 million apps available. Hence Walmart replatformed to a microservices architecture and got these results:-
- Mobile orders were up by 98%
- Conversions were up by 20%
- No downtime on Black Friday or Boxing day
- The operational savings were increased
- They started saving 40% of computing power and 20-50% cost savings overall
Spotify knew that if they wanted to move fast and stay innovative in a highly competitive market hence they need a new architecture which can scale up easily. Spotify serves more than 75 million active users per month with an average session of 23 minutes. So, Spotify concluded that if they want to scale up to hundreds of millions of users, they need to build a system which can scale components independently. Therefore Spotify built a microservice architecture with autonomous full stack teams to avoid synchronization hell. These teams are autonomous and their work does not overlap with other teams. After opting for microservices, Spotify finds that they don’t have large failures.
Amazon has also migrated to microservices due to its benefits. In 2001, the Amazon.com retail website was a large architectural monolith. It was architectured in multiple tiers, and those tiers had many components in them, but they were coupled together tightly and worked like one big monolith. They had large number of developers working on one big monolithic website and even when these developers worked on very small piece of that application, they still needed to deal with the overhead of coordinating their changes with everyone else who was also working on the same project. It was a very long and complex process. Therefore Amazon went through its monolithic application into a service oriented architecture. They broke down their one, central product development team into small teams. After all these changes, Amazon tremendously improved its front-end development lifecycle. Now the product teams can quickly make decisions and roll out new features for their microservices. Thanks to microservices architecture, now Amazon makes 50 million deployments a year.
In this article, I have explained what is microservices architecture and approach, what are its features and benefits alongwith some of the applications and implementations of microservices in the market. I have discussed many positives about microservices which have been seen in so many organizations now. If you go for microservices approach alongwith good design and have a skilled team then definitely you will get success in your expanding business.