A Guide to Microservices Architecture

A guide to Microservices components

Microservices software development architecture is meant to address the traditional monolithic approach for building enterprise applications. 

 

Microservices architecture is a software development approach that arranges an application as a collection of loosely-coupled services that communicate over API and lightweight protocols. A suite of small (or micro) services, running independent processes that reduces the dependencies and the complexities around the infrastructure and allows organizations developing software to grow, scale, and innovate with less concern of potentially affecting other systems.

This decentralized method has services that are self-contained and owned by individual teams for development. These independent services allow organizations to be more agile and progress to a DevOps model of continuous integration and delivery.

 

Components of a Microservices Architecture

The term Microservices when separated, ‘Micro’ and ‘Services’ as it suggests is a collection of smaller services that is part of a larger system. Familiarizing yourself with the key components of the architecture will help your team achieve a successful migration.

 

Microservices – A microservice is the foundation of this architecture and is part of a suite of services to help execute a business requirement. Self-contained that can be written in any language and communicates over lightweight protocols such as API. Smaller focused teams have the flexibility and agility to update and innovate while minimizing dependencies between services and enable service autonomy. 

 

Containers – A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. 

 

A Docker (who is one of the most recognizable container providers) container image is a lightweight, standalone, executable package of  software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

The success and ubiquity of containers has emerged a tooling ecosystem of container orchestration tools such as Kubernetes.

 

Service Mesh – A service mesh is a platform layer on top of the infrastructure layer that enables managed, observable, and secure communication between individual services. This platform layer enables companies or individuals to create robust enterprise applications, made up of many microservices on a chosen infrastructure. Service meshes use consistent tools to factor out all the common concerns of running a service, like monitoring, networking, and security. That means service developers and operators can focus on creating and managing applications for their users instead of worrying about implementing measures to address challenges for every service.

 

Service Discovery – Microservices instances can change constantly. Keeping track of the multiple services deployed in the distributed network in the architecture can be challenging.

 

Service discovery helps service instances adapt in a changing deployment, and distribute load between the microservices accordingly. The service discovery component is made up of three parts:

    • A service provider that originates service instances over a network;
    • A service registry, which acts as a database that stores the loction of available service instances; and
    • A service consumer, which retrieves the location of a service instance from the registry, and then communicates with that instance.

Service discovery also consists of two major discovery patterns:

    • A client-side discovery pattern searches the service registry to locate a service provider, selects an appropriate and available service instance using a load balancing algorithm, and then makes a request.
    • In a server-side discovery pattern, the router searches the service registry and, once the applicable service instance is found, forwards the request accordingly.

Data residing in the service registry should always be current, so that related services can find their related service instances at runtime
.
API Gateway
– API gateways are a crucial component in any microservice architecture. They are vital for communication between services in a distributed architecture and create the layer of abstraction between the microservices and the client.

API gateways take on a large responsibility of communication allowing the microservices to remain lightweight. They also handle authentication, cache, requests, and monitor messaging as needed.

 

Examples of Microservices

BMC states, many large companies now utilize microservices within their architecture. Netflix is one of the earlier, most well-known adopters. Some other well-known examples include Amazon, Twitter, SoundCloud, Paypal.

 

Present in each of these companies are a network of microservices. For example, SoundCloud might have a new user microservice designed to onboard a user onto its application. The microservice will activate the user’s account on the backend, and it might be responsible for sending a welcome email to the user, and a walkthrough when the user first logs into the application.

 

Another microservice for Soundcloud might be to handle uploading and storing a user’s song to the platform. Another might be its search functionality and recommended artists.

 

As a company is divided into departments with people having different responsibilities, like a sales agent, a financier, and a bank teller are all points of contact with the same bank, a company’s microservices divide the responsibility of the whole company into individual actions.

 

Source: BMC

Traditional Monolithic Architecture

A monolithic architecture is the traditional model for a unified design where the processes, systems, and components are interconnected and interdependent as opposed to being loosely coupled as in microservices architecture. 

 

These dependencies mean that if a component needs to be updated, the processes of the entire system or application would need to be evaluated and updated accordingly as well.

 

Modular architecture such as microservices reduces the risk of updates being executed and impacting another component that was unintended. The self-contained components of microservices allow programs to be more independent and updates can be made more easily.

Monolithic architecture can have the advantage of being less complex with a horizontal business logic approach when compared to modular but of course has the major disadvantage of tight coupling.

 

Amazon’s senior product manager says, “… a lot of startups, and even projects inside of big companies, start out this way (monolith architecture). They take a monolith-first approach, because it’s very quick, to get moving quickly. But over time, as that project matures, as you add more developers on it, as it grows and the code base gets larger and the architecture gets more complex, that monolith is going to add overhead into your process, and that software development lifecycle is going to begin to slow down.”

Microservices vs Monolithic

Source: TechTarget

 

 

Microservices: How it Works & Benefits

Enter microservices, a microservices architecture is made of a suite of independent services. Each service is responsible for a business or technical objective. These services are loosely coupled and are communicated through API.

 

Development teams can focus on a single service and have the flexibility to innovate and add features without compromising or having the need to coordinate much between teams and requiring updates to the entire architecture.

 

Microservices architecture can be more complex to build and maintain and usually requires teams to adopt a DevOps culture of continuous integration and delivery for software development but once implemented correctly can offer many advantages for a growing organization. 

 

Common benefits of a microservice architecture are,

  • Improved Scalability
  • Promotes innovation
  • Faster deployments
  • Enables business agility 
  • Better fault isolation
  • Easier to Troubleshoot and Debug Issues
  • Smaller focused teams
  • Simplifies and coordination between teams
  • Services and Programming Language Agnostic
  • Eliminate vendor or technology lock-in

For implementation, software developers will most likely utilize containers hosted in cloud servers like MS Azure, Amazon AWS, etc. And use management and orchestration tools such as Kubernetes to manage containerized workloads and services, to identify failures, rebalancing services across nodes and facilitate configuration and automation in the growing ecosystem.

Microservices How it Works & Benefits

Image: Microsoft

Microservices can be the building blocks that help organizations meet business and technical goals and allow you to support any application architecture, regardless of scale, load, or complexity.

How Crest Data Systems Can Help

With Crest Data Systems Product Engineering solutions our engineers work to reduce release cycles from weeks to hours. Improve agility and reliability by implementing containers, microservices based architecture, automated testing and CICD.

 

Crest Data Systems has worked with Fortune 500 companies as well as some of the world’s most innovative companies and hottest startups to streamline work processes so teams can perform at their highest level.

 

Contact us to learn more about our Product Engineering solutions and our broad range of managed and professional services that encompass solution implementation, building integrations,enable migration, health checks, and see how we can help you today.

 

Tuan Nguyen
AUTHOR

TUAN NGUYEN

Tuan is a Product Marketing Manager with 8+ years of industry experience in large Enterprise technology companies and start-up. He is passionate about technology marketing and has experience in Cybersecurity, Cloud Security, and Data Center Networking.