Part One – Introduction
This is a series of articles on Yahoo Small Business’s adoption of microservices architecture using the latest technologies like Kubernetes, Istio and Spinnaker. In the first part of the series, we will talk about what microservices architecture is and how it’s going to help our engineers and our customers.
Historically web applications were deployed using an architecture known as monolithic architecture. In this architecture, usually the whole application is deployed on the production servers as a single unit and all the application code runs in the same (operating system) process. If we want to scale up the application, this will require deploying multiple copies of the exact same application code to multiple servers.
There are some problems with this approach. When features and services are added to the application the codebase can quickly become very complex. If a new feature is released, the entire big monolith will need to be updated and another round of testing must be done to test all the functionalities. The agility of the team and product is sacrificed.
The microservices architecture is designed to address these exact issues. In the microservices architecture, the services defined in the monolithic application are broken out into individual independent services and deployed separately from one another on a separate group of hosts.
This allows developers to create an application from a combination of small services. Each of these services is built individually and deployed separately, so they run their own processes and communicate with the help of lightweight APIs. This approach makes web-based development more agile and codebases easier to maintain.
Each microservice is aligned with a specific business function, for example – ordering functionality or payment functionality – and only defines the operations necessary for that specific business function. This allows development teams to organize around business capabilities instead of organizing around the technology that is being used.
Each of these microservices also can be adapted to be used in multiple ways – this way each microservice can be reused for more than one business process.
Each individual microservice can be scaled based on its resource requirements as opposed to scaling the whole monolith application. Rather than having to run large servers with lots of CPU and RAM, microservices can be deployed on smaller hosts containing only those resources required by that service. When done correctly, this can greatly impact cost savings.
In addition, each microservice can be implemented in the programming language most suitable for the operations that the microservice performs. The microservices architecture doesn’t require the “one size fits all” model that the monolith architecture does. It can use different backing database technologies as appropriate.
If built properly, failure of one microservice will not take the entire application down unlike the monoliths. Larger applications can remain mostly unaffected by the failure of a single module.
This architecture also allows us to easily put each microservice into production one by one. Individual services are faster to develop. Different teams can be working on different components simultaneously without having to wait for one team to finish a chunk of work before starting theirs. With added simplicity, developers can better understand the functionality of a microservice and get onboarded quickly. The simplicity of having individual microservices help applications become easier to build and maintain when they’re split into a set of smaller, composable units.
Smaller codebases and scope equals quicker deployments, which also allow us to start to explore the benefits of Continuous Deployment and Delivery using open-source CI/CD tools such as Jenkins, Spinnaker etc.
This also increases the autonomy of individual development teams within an organization, as ideas can be implemented and deployed without having too much coordination with a separate IT delivery function.
Microservices are also a blessing for distributed teams. Carrying out the development of a massive monolith system can be complicated and messy if you have divisions around the globe. Microservice based applications grant the developers more independence to work autonomously and make technical decisions quickly in smaller groups.
In the next part of the series, we will talk about the process we went through for identifying tools to implement microservice architecture at Yahoo Small Business.