Book Image

Designing Microservices Platforms with NATS

By : Chanaka Fernando
5 (1)
Book Image

Designing Microservices Platforms with NATS

5 (1)
By: Chanaka Fernando

Overview of this book

Building a scalable microservices platform that caters to business demands is critical to the success of that platform. In a microservices architecture, inter-service communication becomes a bottleneck when the platform scales. This book provides a reference architecture along with a practical example of how to implement it for building microservices-based platforms with NATS as the messaging backbone for inter-service communication. In Designing Microservices Platforms with NATS, you’ll learn how to build a scalable and manageable microservices platform with NATS. The book starts by introducing concepts relating to microservices architecture, inter-service communication, messaging backbones, and the basics of NATS messaging. You’ll be introduced to a reference architecture that uses these concepts to build a scalable microservices platform and guided through its implementation. Later, the book touches on important aspects of platform securing and monitoring with the help of the reference implementation. Finally, the book concludes with a chapter on best practices to follow when integrating with existing platforms and the future direction of microservices architecture and NATS messaging as a whole. By the end of this microservices book, you’ll have developed the skills to design and implement microservices platforms with NATS.
Table of Contents (15 chapters)
1
Section 1: The Basics of Microservices Architecture and NATS
5
Section 2: Building Microservices with NATS
11
Section 3: Best Practices and Future Developments

Advantages of the microservice architecture

The microservice architecture provides many advantages over its predecessors. Most of these advantages relate to the evolution of the technology landscape. Understanding the evolution of distributed systems helped the microservice architecture become a better approach for building complex distributed systems for the modern era. The following list points out the advantages of the microservice architecture:

  • Ability to build robust applications
  • Supports the scalability demands of modern businesses
  • Better utilization of computing resources
  • Helps with innovation with reduced time to market and frequent releases
  • Builds systems that are easy to support and maintain

There are several other advantages related to the microservice architecture, but we will start with the aforementioned list and explore more as we continue with this book.

Build robust, resilient applications

The challenge with distributed systems has always been their robustness and their resiliency to failure. The microservice architecture helps organizations tackle this problem by designing applications that are ready for failure and with well-defined scopes. The concept of fail-fast and recovery allows microservice-based applications to identify failures quickly and fix those issues instantly. At the same time, due to the componentized architecture, the failure of one component won't bring down the entire application. Instead, a portion of it and most of the users might not even notice the failure if they don't use that function. This provides a better experience for users.

Build scalable, available applications for modern businesses

The microservice architecture has evolved with the need for scalability in large-scale digital-native organizations, which are required to run thousands of instances of applications and hundreds of different applications. Hence, scalability and availability across wider geographical areas have always been advantages of the microservice architecture. Characteristics such as single responsibility, a modularized architecture, and decentralized data management allow the applications to scale across different data centers and regions without many complications.

Better utilization of computing resources

The popularity of cloud vendors has had a huge impact on the infrastructure costs that are incurred by enterprise software platforms. There were many situations where software systems were utilizing only a fraction of the overall computing infrastructure maintained by these organizations. These reasons paved the way for containers becoming popular and microservices followed the path that was opened up by containers.

Microservices allowed the application to be decomposed into independent units. Each unit can decide on the resources required for it to function. Containers allowed each microservice to define the required levels of resources and collectively, it provided a mechanism to utilize the computing resources in a much better way than the previous monolithic application-driven model.

Helps an innovation-driven organization culture

Modern business organizations are driven by innovations, so having a software architecture that supports that culture helps these organizations excel. The microservice architecture allows teams to innovate and release frequently by choosing the best technology and approach that suits a given business requirement. This urges other teams to also innovate and create an innovation-driven culture within the IT organization.

Build manageable systems

One of the challenges with large monolithic systems was the concept of Subject-Matter Experts (SMEs) and center of excellence (CoE) teams, which had control over such applications. Even the Chief Technical Officer (CTO) would kneel in front of them due to their lack of knowledge regarding those systems. These systems were brittle and the failure of such an application could cause entire organizations to pause their operations. With a defined yet small scope for each microservice and individuals rotating around different teams, microservice-driven applications became much more open to the entire team and no one team had the power to control the system.