What this book covers
Chapter 1, Introduction to Microservices, provides an introduction to microservices architecture, exploring its core principles and defining microservices as small, independent units focused on specific functionalities. This chapter also contrasts microservices with traditional monolithic architecture, highlighting the pros and cons of each approach and setting the stage for the rest of the book.
Chapter 2, Diving into Microservices Internals, delves deeper into the internal workings of microservices. It covers microservice communication techniques, including REST, GraphQL, and Remote Procedure Call (RPC), and explains both synchronous and asynchronous communication methodologies. The chapter also explores popular communication patterns such as API gateways and message queues, providing a theoretical foundation that is essential for practical implementation.
Chapter 3, What Do You Need Before Getting Started?, focuses on the essential concepts of JavaScript and Node.js that you need to understand before building microservices. This chapter covers JavaScript engine internals, asynchronous programming, the Node.js runtime environment, and the crucial role of threading and runtime management in building effective microservices.
Chapter 4, Stack Development Technologies, introduces the essential tools and technologies required to develop and manage microservices with JavaScript. This includes a deep dive into Node.js and various frameworks, choosing the right IDE, and the installation and use of Docker and Git. The chapter also covers Postman, a key tool for testing APIs and interacting with microservices during development.
Chapter 5, Basic CRUD Microservices, takes a practical approach by guiding you through the development of your first microservice using Express.js. This chapter covers the tools required, the internal architecture of microservices, and the step-by-step process of creating and testing a basic CRUD (Create, Read/Retrieve, Update, Delete) microservice, preparing you for more complex implementations.
Chapter 6, Synchronous Microservices, explores the creation and orchestration of synchronous communication between microservices. This chapter focuses on building a second microservice using NestJS and establishing communication between services.
Chapter 7, Asynchronous Microservices, delves into the world of asynchronous communication, a crucial aspect of building scalable systems. The chapter covers the implementation of Apache Kafka for asynchronous messaging, setting up the infrastructure for Kafka with NestJS, and building an asynchronous transaction service. It also breaks down Kafka’s core concepts and explains how to incorporate asynchronous communication into your microservices architecture.
Chapter 8, Real-Time Data Streaming Using Microservices, explores the power of real-time data streaming within a microservices ecosystem. This chapter covers the concept of streaming, its benefits, and how to implement stream processing microservices using Node.js. It also demonstrates how to integrate these services with Apache Kafka to build a real-time data pipeline.
Chapter 9, Securing Microservices, focuses on the fundamental aspects of securing microservices by implementing robust authentication mechanisms. It covers the use of JSON Web Tokens (JWT) for stateless authentication, discusses centralized and decentralized approaches to security, and demonstrates how to build a dedicated authentication microservice. Additionally, best practices for ensuring your microservices' confidentiality, integrity, and availability are provided, offering a solid foundation for secure microservice architectures.
Chapter 10, Monitoring Microservices, focuses on equipping your microservices with robust observability and monitoring practices. This chapter covers the importance of logging and monitoring in microservice architectures, ensuring that you can effectively track the health and performance of your system. It introduces essential observability concepts such as logs, metrics, and traces and explores centralized logging with the ELK Stack (Elasticsearch, Logstash, and Kibana). By the end of this chapter, you’ll have a strong foundation for implementing logging and monitoring strategies to keep your microservices resilient and responsive.
Chapter 11, Microservices Architecture, provides a deep dive into advanced architectural patterns for microservices. This chapter explores the API gateway, event-sourcing, and Command Query Responsibility Segregation (CQRS) patterns to separate reads and writes.
Chapter 12, Testing Microservices, emphasizes the importance of testing in maintaining microservices’ stability and reliability. This chapter covers essential testing strategies, including unit tests and integration tests, ensuring that your microservices can withstand any demand and work seamlessly together.
Chapter 13, A CI/CD Pipeline for Your Microservices, unveils the process of automating microservices development through Continuous Integration (CI) and Continuous Delivery (CD). This chapter covers the essentials of CI/CD processes, working with GitHub Actions, building a robust pipeline that streamlines the transition from development to production and deploying your application to Azure Cloud.