Node.js: Microservices

Node.js: Microservices

3h 39mAdvanced2023-08-08

Authors

Daniel Khan

Daniel Khan

Technology Lead, Developer, Application Architect

Course details

In this fast-paced era of distributed systems, mastering microservices—not just deploying services, but truly understanding the patterns and principles that drive them— is essential for developers. And in organizations large and small, Node.js is often the platform of choice for building microservices architectures. In this course, Daniel Khan shows you how to use Node.js to create a microservice architecture from scratch and tackles the all-too-common challenge of transforming a monolithic app into a flexible, modular system composed of individual services. Throughout the course, Daniel explores crucial concepts like service discovery, resilience, and decoupling. Check out this course to gain practical knowledge of microservices that you can apply to your day-to-day work immediately.

Skills covered

Node.jsSoftware ArchitectureJavaScript FrameworksWeb DevelopmentOpen SourceSoftware DevelopmentOne-Off

Concepts

Introduction

  • Understanding how microservices are built and used
  • What you should know

Prepare Your Development Environment

  • Installing Git, Node.js, and Docker
  • Getting the exercise files from GitHub
  • Setting up Visual Studio Code, ESLint, and Prettier
  • Launching MongoDB, Redis, and Jaeger in Docker
  • Installing MongoDB Compass

Planning Your Microservice Migration

  • Setting up and exploring your sample application
  • Understanding the sample apps code
  • Getting insights with OpenTelemetry and Jaeger
  • Setting your mission

Your First Service - The Catalog Service

  • What's your goal for this chapter
  • Creating the service
  • Designing a REST API for the catalog service
  • Adding business logic and database access
  • Creating your first REST endpoint
  • Completing the API
  • Testing REST endpoints

Creating a Service Registry

  • What's your goal for this chapter
  • Setting up the registry
  • Registering services
  • Creating and testing the registration route
  • Unregistering services
  • Querying the registry
  • Removing expired services
  • Registering on service on start
  • Adding heartbeat and unregistering on shutdown

Using Services

  • What's your goal for this chapter
  • Creating the service client
  • Using the catalog service
  • Testing the catalog service
  • Sanitizing data
  • Creating the CartService
  • Service monitoring with OpenTelemetry and Jaeger

Authenticating APIs

  • API authentication with JWT
  • Creating the user service
  • Add JWT tokens to the user service
  • Make the front end use JWT authentication
  • Using bearer headers
  • Protecting endpoints with JWT

Adding Fault Tolerance and Resilience

  • What's your goal for this chapter
  • Chaos testing
  • Adding caching to reduce load and bridge outages
  • Using queues for decoupling
  • Installing up RabbitMQ
  • Setting up the order service
  • Producing orders
  • Consuming orders

Conclusion

  • Next steps
80,000 Toman