Designing Microservices Platforms with NATS: A modern approach to designing and implementing scalable microservices platforms with NATS messaging
- Length: 356 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2021-11-19
- ISBN-10: 1801072213
- ISBN-13: 9781801072212
- Sales Rank: #272047 (See Top 100 Books)
A complete reference for designing and building scalable microservices platforms with NATS messaging technology for inter-service communication with security and observability
Key Features
- Understand the use of a messaging backbone for inter-service communication in microservices architecture
- Design and build a real-world microservices platform with NATS as the messaging backbone using the Go programming language
- Explore security, observability, and best practices for building a microservices platform with NATS
Book Description
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.
What you will learn
- Understand the concepts of microservices architecture
- Get to grips with NATS messaging technology
- Handle transactions and message delivery guarantees with microservices
- Implement a reference architecture for microservices using NATS
- Discover how to improve the platform’s security and observability
- Explore how a NATS microservices platform integrates with an enterprise ecosystem
Who this book is for
This book is for enterprise software architects and developers who want to gain hands-on microservices experience for designing, implementing, and managing complex distributed systems with microservices architecture concepts. Intermediate-level experience in any programming language and software architecture is required to make the most of this book.
Table of Contents
- What is Microservices Architecture?
- Why is Messaging Important in Microservices Architecture?
- What is NATS Messaging?
- How to Use NATS in a Microservices Architecture
- A Reference Architecture for Microservices with NATS
- A Practical Example of Building Microservices with NATS
- Security with NATS in a Microservices Architecture
- Observability with NATS in a Microservices Architecture
- How Microservices and NATS Co-Exist with Integration Platforms
- The Future of Microservices Architecture and NATS
Designing Microservices Platforms with NATS Contributors About the author About the reviewers Preface Who this book is for What this book covers To get the most out of this book Download the example code files Code in Action Download the color images Conventions used Get in touch Share Your Thoughts Section 1: The Basics of Microservices Architecture and NATS Chapter 1: Introduction to the Microservice Architecture The evolution of distributed systems Failure handling Concurrency Security of data Standardizing data Scalability Microservices and containers Container-based deployments What is a microservice architecture? Microservices are small and do one thing well Microservices are autonomous and act as cohesive units Characteristics of the microservice architecture Componentization via services Business domain-driven scope for each service Decentralized governance Decentralized data management Smart endpoints and dumb pipes Infrastructure automation Container-based deployments Design for failure Agile development Evolving architecture Breaking down a monolith into microservices Business functions implemented as separate microservices Each microservice has a datastore Message broker for inter-service communication The web interface is designed as a single-page application (SPA) Advantages of the microservice architecture Build robust, resilient applications Build scalable, available applications for modern businesses Better utilization of computing resources Helps an innovation-driven organization culture Build manageable systems Summary Further reading Chapter 2: Why Is Messaging Important in the Microservice Architecture? Messaging patterns used in distributed systems RPC versus shared resources Synchronous versus asynchronous (client-server versus event-based) Orchestration versus choreography Communication requirements of a microservice architecture Common messaging technologies used in a microservice architecture North-South traffic East-West traffic Summary Chapter 3: What Is NATS Messaging? Technical requirements History of NATS Introduction to NATS Subject-based messaging Publish-subscribe messaging Request-reply messaging Queue groups messaging How does the NATS protocol work? Protocol conventions Protocol messages Setting up the environment Connecting to the NATS server Sending and receiving messages Advanced NATS concepts Clustering the NATS server Monitoring NATS Security with NATS Advantages of NATS Summary Further reading Section 2: Building Microservices with NATS Chapter 4: How to Use NATS in a Microservice Architecture Technical requirements Understanding the challenges of the microservice architecture Identifying the service boundaries Inter-service communication Securing services Monitoring services Organizational structures What is inter-service communication and why is it important? How NATS solves the inter-service communication challenge Advantages of using NATS for inter-service communication Summary Chapter 5: Designing a Microservice Architecture with NATS Understanding the key components of a microservice architecture Inner architecture Understanding how NATS is positioned in the microservice architecture Microservices interact with the NATS server as NATS clients Existing business applications and services interact with the NATS server via the anti-corruption layer Security components interact with the NATS server for implementing advanced security Reference architecture for microservices with NATS Clients Delivery services Edge services Supportive services Core services NATS server Integration platform Existing services Cross-cutting services Summary Further reading Chapter 6: A Practical Example of Microservices with NATS Technical requirements Understanding the use case of a hospital OPD Patient registration process Patient inspection process Temporary treatment and testing Releasing the patient Service composition API composition layer Client-side composition Security for services Defining the solution architecture Clients (Consumers) API management (with WSO2 API Manager 4.0) Microservices in Go NATS server NATS token store Integration (with WSO2 Micro Integrator 4.0) Existing services Cross-cutting functions Components that were skipped Deployment architecture Implementing microservices Registration service Inspection service Treatment service Release service Setting up the NATS server cluster Starting up the three-node NATS server cluster Trying out the sample application Prerequisites Starting the microservices Testing the OPD application Summary Chapter 7: Securing a Microservices Architecture with NATS Technical requirements Understanding security in the context of a microservices architecture Security with OAuth 2.0 Securing external communication Implementing security at each microservice level Implementing security using a sidecar Implementing security using an API gateway Securing ISC Security with TLS Security with authentication Security with authorization Using NATS to secure ISC Implementing TLS with NATS for microservices Implementing basic authentication and authorization with NATS Summary Chapter 8: Observability with NATS in a Microservices Architecture Technical requirements Observability in a microservices context Observability in containerized deployments Best practices for microservices observability Observability features of NATS Logging Monitoring Using NATS observability in a microservices architecture Prometheus Grafana Loki and Promtail Adding the health check API Adding CorrelationID to the requests Adding improved logging for microservices Collecting metrics and exposing them for application monitoring Exporting NATS server metrics Starting microservices Configuring Prometheus Configuring Loki and Promtail Configuring Grafana Summary Section 3: Best Practices and Future Developments Chapter 9: How Microservices and NATS Coexist with Integration Platforms Technical requirements Understanding the brownfield enterprise software system How do integration platforms work in an enterprise software system? Solution architecture of an enterprise software system with an integration platform How do microservices and NATS integrate with the integration platform? Microservices as process APIs Microservices as system APIs Microservices as core systems Microservices and the integration platform How to build an enterprise platform with microservices, NATS, and the integration platform Setting up the sample OPD application with WSO2 integration platform Setting up the NATS server Setting up microservices Setting up WSO2 API Manager 4 Creating API proxies and publishing them on the portal Setting up WSO2 Micro Integrator Setting up observability Summary Chapter 10: Future of the Microservice Architecture and NATS Technical requirements Challenges of the proposed microservice architecture with NATS Message delivery guarantees and error handling Security Deployment and automation What are the new developments in the microservice architecture? Service mesh for interservice communication Saga pattern and managing data Serverless computing and microservices What are the new developments in the NATS messaging technology? JetStream Using NATS to build an observability solution How can a microservice architecture with NATS be improved? Using JetStream for improved message guarantees and stream processing Using the saga pattern to develop applications with transactional requirements Using serverless platforms to build microservices Hybrid deployments to support brownfield enterprises Summary Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Designing Microservices Platforms with NATS: A modern approach to designing and implementing scalable microservices platforms with NATS messaging
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.