Preface
The microservices architecture has developed into a mainstream approach to building enterprise-grade applications within the past few years. Many organizations, from large to medium to small start-ups, have started utilizing the microservices architecture to build their applications. With more and more people adopting the microservices approach to build applications, some practical challenges of the architecture have been uncovered. Inter-service communication is one challenge that most microservices teams experience when scaling applications to a larger number of instances.
At first, point-to-point inter-service communication was not working well, and the concept of smart endpoints and dumb pipes was proposed as an alternative approach. Instead of connecting microservices in a point-to-point manner, having a messaging layer to decouple the microservices looked like a better solution.
NATS messaging technology was originally developed as the messaging technology to be used in the Cloud Foundry platform. It was built to act as the always-on dial tone for inter-service communication. Its performance and the simple interface it exposed to interact with clients made it popular within the developer community.
In this book, we discuss how NATS messaging can be used to implement inter-service communication within a microservices architecture. We start with a comprehensive introduction to microservices, messaging, and NATS technology. Then we go through the architectural aspects and provide a reference implementation of an application using the Go programming language. We cover the security and observability aspects of the proposed solution and how that can co-exist in an enterprise platform. At the end of the book, we discuss the latest developments in microservices and NATS messaging and explore how these developments can shape our proposed solution.