Building Microservices with Node.js

Book description

Venture into microservices with Node.js, uncovering step-by-step roadmaps, insightful demonstrations, and cutting-edge techniques to build robust web applications

Key Features

  • Explore microservices architecture and implement it using Node.js for robust web applications
  • Follow clear, practical examples and real-world use cases to apply your knowledge and build your skills
  • Excel in the world of software development and tackle complex challenges with confidence
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

– Immerse yourself in the world of microservices with this guide to migration from a monolithic architecture to microservices.

– With this book, you’ll acquire a deep understanding of microservices architecture and apply it confidently in your web application projects.

– As you progress, you’ll be guided through the process of creating a simple application and incorporating the Node.js framework into it, along with its commonly used libraries.

– You’ll learn how the framework operates, how to configure it, and how to develop handlers for the web framework and explore how to deploy your application to a production server.

– Get to grips with the intricacies of JavaScript and Node.js and find out how to approach microservices in Node.js, implement them effectively, and integrate RESTful APIs.

– Gain insights into service-to-service authentication and authorization and learn how to work with databases and caching, as well as with monitoring and logging in microservices with Node.js.

– By the end of this microservices book, you’ll be able to develop a web app using the Node.js framework, configure it, extend it using libraries available for this framework, and launch it using best practices.

What you will learn

  • Design domain-oriented microservices using domain-driven design (DDD)
  • Understand collaboration techniques for inter-microservice communication and learn how to design an API gateway
  • Automate microservice integration and deployment
  • Split a monolith safely into microservices and understand how to test microservices effectively
  • Use and implement microservices in Kubernetes and Docker environments
  • Get to grips with best practices for maintaining microservices at scale

Who this book is for

– This book is for backend developers, full-stack developers, software architects, and frontend developers who want to venture into the world of backend development and extend their capabilities. – A fundamental understanding of the JavaScript ecosystem will be helpful but not necessary, as this book will cover the essentials of backend development, JavaScript programming, and Node.js.

Table of contents

  1. Building Microservices with Node.js
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1: Understanding Microservices and Node.js
  7. Chapter 1: Introducing Microservices
    1. Introduction to the microservices and decentralized architecture concepts
      1. Microservices architecture
      2. Decentralized architecture
    2. Service boundaries and loose coupling
      1. Service boundaries
      2. Loose coupling
    3. Independent development and deployment and polyglot architecture
      1. Independent development and deployment
      2. Polyglot architecture
    4. Scalability and resilience and independent data management
      1. Scalability and resilience
      2. Independent data management
    5. APIs and communication and CI
      1. APIs and communication
      2. CI
    6. Summary
    7. Quiz time
  8. Chapter 2: Exploring the Core Principles of Microservices
    1. Overview of the core principles of microservices
    2. Understanding the fundamentals and identifying business capabilities
    3. Defining service contracts and decentralized decision making
      1. Service contracts in microservices
      2. Decentralized decision making in microservices
    4. Prioritizing autonomy and ownership and designing for resilience
      1. Prioritizing autonomy and ownership
      2. Designing for resilience
    5. Implementing communication strategies and ensuring scalability
      1. Implementing communication strategies
      2. Ensuring scalability
    6. Implementing observability and continuously learning and improving
      1. Implementing observability
      2. Continuous learning and improving
    7. Summary
    8. Quiz time
  9. Chapter 3: Understanding Node.js Fundamentals: Building Blocks and Key Concepts
    1. Asynchronous and non-blocking communication and event-driven architecture
      1. Asynchronous and non-blocking communication
      2. Event-driven architecture
    2. The JavaScript ecosystem and server-side development
      1. The JavaScript ecosystem
      2. Server-side development with Node.js
    3. Command-line applications and scalability and performance
      1. Command-line applications
      2. Scalability and performance
    4. Cross-platform compatibility and community and support
      1. Cross-platform compatibility
      2. Community and support
    5. Microservices and serverless architectures and their integration through APIs
      1. What is microservices architecture?
      2. What is a serverless architecture?
      3. Integration through APIs
      4. Integration in microservices and serverless architectures
    6. Summary
    7. Quiz time
  10. Chapter 4: Leveraging the JavaScript and Node.js Ecosystem for Microservices Development
    1. Vast package management and developer productivity
      1. Vast package management
      2. Developer productivity
    2. Community support and collaboration, and rapid innovation and updates
      1. Community support and collaboration
      2. Rapid innovation and updates
    3. Versatility and full stack development, and cross-platform compatibility
      1. Versatility and full stack development
      2. Cross-platform compatibility
    4. Integration and interoperability and support for modern web standards
      1. Integration and interoperability
      2. Support for modern web standards
    5. Enterprise adoption and industry maturity and ecosystem growth and innovation
      1. Enterprise adoption and industry maturity
      2. What is ecosystem growth and innovation?
    6. Summary
    7. Quiz time
  11. Part 2: Building and Integrating Microservices with Node.js
  12. Chapter 5: Knowing the Infrastructure of Microservices in Node.js
    1. Service discovery and API gateways
      1. Service discovery
      2. API gateways
    2. Load balancing and service orchestration
      1. Load balancing
      2. Service orchestration
    3. Containerization and orchestration and centralized logging and monitoring
      1. Containerization and orchestration
      2. Centralized logging and monitoring
    4. Distributed tracing and event-driven communication
      1. Distributed tracing
      2. Event-driven communication
    5. Database integration and continuous integration and deployment
      1. Database integration
      2. CI/CD
    6. Summary
    7. Quiz time
  13. Chapter 6: Designing Microservices Architecture in Node.js
    1. Things to consider before creating your microservice
    2. Communication protocol and design APIs
      1. Communication protocol
      2. API design
    3. Decentralized data management and data consistency
    4. Authentication and authorization and error handling and fault tolerance
      1. Authentication and authorization
      2. Error handling and fault tolerance
    5. Monitoring and tracing requests and containerization technologies
      1. Monitoring and tracing requests
      2. Containerization technologies
    6. Summary
    7. Quiz time
  14. Chapter 7: Integrating Microservices in Node.js Applications
    1. Synchronous HTTP/REST communication and asynchronous messaging
      1. Synchronous HTTP/REST communication
      2. Asynchronous messaging
    2. EDA and API gateways
      1. EDA
      2. API gateways
    3. Service mesh and caching
      1. Service mesh
      2. Caching
    4. Distributed tracing and database integration
      1. Distributed tracing
      2. Database integration
    5. Monitoring and observability and error handling and resilience
      1. Monitoring and observability
      2. Error handling and resilience
    6. Summary
    7. Quiz time
  15. Chapter 8: Debugging Microservices in Node.js
    1. Logging and debugging tools
      1. Logging in microservices
      2. Debugging tools
    2. Debugging in containers and error handling
      1. Debugging in containers
      2. Error handling
    3. Unit testing and remote debugging
      1. Unit testing
      2. Remote debugging
    4. Instrumentation and tracing and environment and configuration
      1. Instrumentation and tracing
      2. Environment and configuration
    5. Reproducing and isolating issues and debugging tools and libraries
      1. Reproduce and isolate issues
      2. Debugging tools and libraries
    6. Summary
    7. Quiz time
  16. Part 3: Data Management in Microservices Using Node.js
  17. Chapter 9: Database Manipulation in Microservices with Node.js
    1. Choosing the right database and database connections
      1. Choosing the right database
      2. Database connections in microservices
    2. Data models and schemas and CRUD operations
      1. Data models and schemas
      2. CRUD operations
    3. Transactions and data validation
      1. Transactions in microservices
      2. Data validation and sanitization
    4. Error handling and optimizations
      1. Error handling in microservices
      2. Optimizations in microservices
    5. Testing
    6. Summary
    7. Quiz time
  18. Chapter 10: API Communication and Data Contracts in Microservices
    1. Defining API contracts and RESTful API design
      1. Defining API contracts
      2. RESTful API design
    2. REST API libraries and API versioning
      1. REST API libraries
      2. API versioning
    3. Authentication and authorization and data validation
      1. Authentication and authorization
      2. Data validation
    4. Error handling and API documentation
      1. Error handling
      2. API documentation
    5. API testing and API gateway
      1. API testing
      2. API gateway
    6. Summary
    7. Quiz time
  19. Chapter 11: Caching and Asynchronous Messaging in Microservices
    1. Client-side caching and edge caching
      1. Client-side caching
      2. Edge caching
    2. Microservice-level caching and database query caching
      1. Microservice-level caching
      2. Database query caching
    3. Message queues and publish-subscribe
      1. Message queues
      2. Publish-subscribe (Pub/Sub)
    4. Event-driven architecture
    5. Summary
    6. Quiz time
  20. Chapter 12: Ensuring Data Security with the Saga Pattern, Encryption, and Security Measures
    1. Compensating actions and Saga orchestration
      1. Compensating actions
      2. Saga orchestration
    2. Event-driven communication and Sagas with state
      1. Event-driven communication
      2. Sagas with state
    3. Transport layer security (TLS) and data encryption at rest
      1. TLS
      2. Data encryption at rest
    4. Encryption algorithms and key management
      1. Encryption algorithms
      2. Key management
    5. Authentication, authorization, input validation, secure coding practices, and API rate limiting
      1. Authentication
      2. Authorization
      3. Input validation
      4. Secure coding practices
      5. API rate limiting
    6. Summary
    7. Quiz time
  21. Part 4: Monitoring and Logging in Microservices with Node.js
  22. Chapter 13: Monitoring Microservices in Node.js
    1. Structured logging and log levels
    2. Contextual information and centralized log management
      1. Contextual information in logs
      2. Centralized log management
    3. Application-level metrics, distributed tracing, and health checks
      1. Application-level metrics
      2. Distributed tracing
      3. Health checks
    4. Threshold-based alerts and anomaly detection
      1. Threshold-based alerts
      2. Anomaly detection
    5. Request tracing, request context propagation, and logging frameworks
      1. Request tracing
      2. Request context propagation
      3. Logging frameworks
    6. Summary
    7. Quiz time
  23. Chapter 14: Logging in Microservices with Node.js
    1. Choosing a logging framework and defining log levels
      1. Choosing a logging library
      2. Log levels
    2. Structured logging, log transport, and storage
      1. Structured logging
      2. Log transport and storage
    3. Log filtering, sampling, error handling, and exception logging
    4. Context propagation, monitoring, and analyzing logs
      1. Context propagation
      2. Monitoring
      3. Log analysis
    5. Summary
    6. Quiz time
  24. Chapter 15: Interpreting Monitoring Data in Microservices
    1. Metrics analysis
    2. Log analysis
    3. Alerting and thresholds
    4. Visualization and dashboards
    5. Correlation and context
    6. Summary
    7. Quiz time
  25. Chapter 16: Analyzing Log Data in Microservices with Node.js
    1. Log levels and severities
    2. Request tracing, contextual information, and event sequencing and order
      1. Request tracing
      2. Contextual information
      3. Event sequencing and order
      4. Advantages and considerations of request tracing, contextual information, and event sequencing and order
    3. Log format, structured logging, and log filtering and search
      1. Log format
      2. Structured logging
      3. Log filtering and search
      4. Advantages and considerations of log format, structured logging, and log filtering and search
    4. Log aggregation, centralized log management, visualization, and log analysis tools
      1. Log aggregation
      2. Centralized log management
      3. Visualization
      4. Log analysis tools
      5. Advantages and considerations of log aggregation, centralized log management, visualization, and log analysis tools
    5. Correlation of log data with metrics and monitoring data
    6. Summary
    7. Quiz time
    8. Final words
  26. Index
    1. Why subscribe?
  27. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Building Microservices with Node.js
  • Author(s): Daniel Kapexhiu
  • Release date: May 2024
  • Publisher(s): Packt Publishing
  • ISBN: 9781838985936