Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Designing Microservices Platforms with NATS

You're reading from  Designing Microservices Platforms with NATS

Product type Book
Published in Nov 2021
Publisher Packt
ISBN-13 9781801072212
Pages 356 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Chanaka Fernando Chanaka Fernando
Profile icon Chanaka Fernando

Table of Contents (15) Chapters

Preface 1. Section 1: The Basics of Microservices Architecture and NATS
2. Chapter 1: Introduction to the Microservice Architecture 3. Chapter 2: Why Is Messaging Important in the Microservice Architecture? 4. Chapter 3: What Is NATS Messaging? 5. Section 2: Building Microservices with NATS
6. Chapter 4: How to Use NATS in a Microservice Architecture 7. Chapter 5: Designing a Microservice Architecture with NATS 8. Chapter 6: A Practical Example of Microservices with NATS 9. Chapter 7: Securing a Microservices Architecture with NATS 10. Chapter 8: Observability with NATS in a Microservices Architecture 11. Section 3: Best Practices and Future Developments
12. Chapter 9: How Microservices and NATS Coexist with Integration Platforms 13. Chapter 10: Future of the Microservice Architecture and NATS 14. Other Books You May Enjoy

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.

Who this book is for

This microservices book is for enterprise software architects and developers who design, implement, and manage complex distributed systems with microservices architecture concepts. Intermediate-level experience of any programming language and software architecture is required to make the most of this book. If you are new to the field of microservices architecture and NATS messaging technology, you can use this book as a learning guide to get into those areas.

What this book covers

Chapter 1, Introduction to the Microservices Architecture, provides a comprehensive introduction to the microservices architecture.

Chapter 2, Why Is Messaging Important in a Microservices Architecture?, discusses different messaging technologies and why microservices architectures require messaging.

Chapter 3, What Is NATS Messaging?, explores the NATS messaging technology by covering the concepts with practical examples.

Chapter 4, How to Use NATS in a Microservices Architecture, discusses the possible ways to use NATS messaging in a microservices context.

Chapter 5, Designing a Microservices Architecture with NATS, provides a reference architecture using a real-world application to build a microservices-based application with NATS.

Chapter 6, A Practical Example of Microservices with NATS, provides a reference implementation of an application using the microservices architecture along with NATS.

Chapter 7, Securing a Microservices Architecture with NATS, discusses the security of the overall microservices architecture, including NATS, with examples on securing NATS servers.

Chapter 8, Observability with NATS in a Microservices Architecture, explores various monitoring and troubleshooting requirements and available technologies with an example implementation.

Chapter 9, How Microservices and NATS Co-exist with Integration Platforms, discusses the aspects related to the integration of microservices-based applications with other enterprise systems.

Chapter 10, Future of the Microservices Architecture and NATS, explores the new developments in the microservices and NATS domains.

To get the most out of this book

This book is written in such a way that you will get the best learning experience by reading the chapters in order. The book includes commands, code examples, and step-by-step instructions as and when necessary. Following these instructions will help immensely in understanding the concepts. The book also provides several exercises so that you can improve your understanding and apply the knowledge to real-world applications. Try to complete the exercises while reading the book.

In addition to the this software, you need the CFSSL tool to create certificates to try out the examples in Chapter 7, Securing a Microservices Architecture with NATS. This tool can be downloaded from here: https://github.com/cloudflare/cfssl.

All the examples in this book were tested using macOS. Most of the examples should work with both Windows and Linux operating systems.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book's GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

You may benefit from following the author on Twitter (https://twitter.com/chanakaudaya), Medium (https://chanakaudaya.medium.com), and GitHub (https://github.com/chanakaudaya), or by adding them as a connection on LinkedIn (https://linkedin.com/in/chanakaudaya).

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Designing-Microservices-Platforms-with-NATS/. If there's an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in Action

The Code in Action videos for this book can be viewed at http://bit.ly/2OQfDum.

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801072212_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The request message is published to the patient.profile subject and the subscribers are listening on the same subject."

A block of code is set as follows:

func main() {
// Initialize Tracing
initTracing()
}

Any command-line input or output is written as follows:

$ nats-server --config node.conf --log nats.log

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: "You could observe the +OK message coming from the server as a response to the PUB command."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you've read Designing Microservices Platforms with NATS, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

lock icon The rest of the chapter is locked
Next Chapter arrow right
You have been reading a chapter from
Designing Microservices Platforms with NATS
Published in: Nov 2021 Publisher: Packt ISBN-13: 9781801072212
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}