Microservices Using ASP.net Core Web API
Microservices Using ASP.net Core Web API
Duration: 3 Months
Course Fees: ₹10,000 INR or $125 USD
Demo Sessions:
🗓 7th, 8th, and 9th July 2025
6:30 AM to 8:00 AM IST
Topics to be Covered:
• What applications are and how they are structured into different layers.
• Types of applications (web, mobile, desktop) and their real-world examples.
• Monolithic architecture, its layered structure, benefits, and challenges, illustrated with an e-
commerce example.
• Microservices architecture, how it works, its advantages, and its challenges, again explained
with practical e-commerce scenarios.
• Real-world case studies from companies like Netflix, Amazon, and Uber, showing why
organizations transition from monolithic systems to microservices.
Topics to be Covered:
• Single Responsibility Principle (SRP)
• Independent Deployment
• Decentralized Data Management
• Loose Coupling and High Cohesion
• Event-Driven Communication
• Fault Isolation and Scalability
• Technology Diversity
Topics to be Covered:
• Difference Between .NET Core and .NET Framework
• What is [Link] Core Web API?
• Creating a New [Link] Core Web API Project
• Understanding Models, DTOs, DbContext, Controllers
• Testing APIs using Postman, Swagger and Fiddler.
Topics to be Covered:
• What Is Clean Architecture?
• Why is Clean Architecture Important?
• Understanding the Layers of Clean Architecture
• Real-time Example: Product Management System using Clean Architecture in [Link] Core
Web API
• Benefits of Clean Architecture in [Link] Core Web API
Topics to be Covered:
• What Is Domain-Driven Design (DDD)?
• Why is Domain-Driven Design Important?
• Understanding the Layers of Domain-Driven Design
• Real-time Example using Domain-Driven Design in [Link] Core Web API
• Benefits of Domain-Driven Design in [Link] Core Web API
Topics to be Covered:
• User Registration & Authentication: Support user signup, login, password reset, and multi-
factor authentication (MFA).
• User Profile Management: CRUD operations for user profiles including name, email, address,
phone number.
• Role & Permission Management: Support roles like Admin, Customer, Vendor, with role-
based authorization.
• Address Book: Manage multiple shipping/billing addresses per user.
• Session Management & Security: JWT or OAuth2 token-based authentication, refresh
tokens, secure password hashing.
• User Activity Tracking: Track user logins, last seen, and other security events.
• Account Verification: Email verification and phone number verification via OTP.
• Social Login Integration: Support for Google, Facebook, or other OAuth providers.
• API for User Data: Secure APIs for other microservices (e.g., Order Microservice) to retrieve
user details when needed.
Topics to be Covered:
• Order Placement: Handle creation of new orders with validation of cart items, quantities, and
user details.
• Order Tracking: Maintain order status lifecycle (Placed, Confirmed, Packed, Shipped,
Delivered, Cancelled, Returned).
• Order History: Allow users to view their past orders.
• Order Validation: Verify product availability and prices before order confirmation.
• Cart Management: Maintain user's current shopping cart and support CRUD for cart items.
• Order Cancellation & Returns: Support order cancellation before shipment and returns
management.
• Integration with Payment Microservice: Update order payment status and trigger workflows
accordingly.
• Integration with Notification Microservice: Send order confirmation, shipment, and delivery
notifications.
• Invoice Generation: Generate and store order invoices.
• API for Orders: APIs for placing, updating, retrieving orders, and for internal communication
with other microservices.
Chapter 9: Creating the Payment Microservice
In this chapter, students will build a Payment Microservice, simulating payment gateways such as cash,
card, and UPI. They will learn about payment flows, handle payment status updates, and integrate the
Payment service with the Order service. The chapter will also cover how to secure payment endpoints
using API keys and authentication.
Topics to be Covered:
• Payment Gateway Integration: Support multiple payment methods (Credit/Debit Cards, Net
Banking, UPI, Wallets).
• Payment Processing: Handle payment authorization, capture, refund, and failure.
• Transaction Management: Store payment transaction details with statuses.
• Secure Payment Data: Ensure PCI compliance, encryption of sensitive data.
• Refund Processing: Handle partial and full refunds.
• Payment Status Updates: Notify Order Microservice of payment success/failure.
• Retry Mechanism: Retry failed payment attempts or offer alternative payment methods.
• API Endpoints: APIs for initiating payments, checking status, refunds, and reports.
Topics to be Covered:
• Multi-Channel Notification: Support notifications via Email, SMS, Push notifications, and
possibly in-app notifications.
• Template Management: Manage reusable templates for order confirmations, shipment
updates, payment receipts, promotional messages.
• Event-Driven Architecture: Listen for events from other microservices (Order placed,
Payment success, Shipment dispatched).
• Notification Scheduling: Schedule notifications for future delivery (e.g., reminders,
promotions).
• Retry & Failure Handling: Retry failed notification attempts and log failures.
• User Preferences: Allow users to opt-in/out of notification types and channels.
• API Endpoints: APIs to send notifications, manage templates, and get notification history.
Topics to be Covered:
• Need for inter-service communication in microservices
• Synchronous communication: HTTP REST APIs, gRPC overview, pros and cons
• Asynchronous communication: Messaging basics (RabbitMQ, Kafka) and event-driven
architecture
• Designing APIs for internal vs. external consumption
• Basic error handling and HTTP status codes
• Timeouts and cancellation handling in service calls
• Best practices for service-to-service communication in [Link] Core Web API
Hands-on Lab:
• Implement RESTful HTTP communication between Product and Order microservices
• Integrate RabbitMQ for asynchronous messaging between Order and Notification
microservices
• Test synchronous and asynchronous communication flows end-to-end with Postman and logs
Topics to be Covered:
• Challenges of data management in microservices (distributed transactions, consistency)
• Why shared databases are an anti-pattern in microservices
• Database per microservice approach: schema isolation and independent scaling
• Data consistency challenges: eventual vs. strong consistency
• Patterns for data consistency overview:
1. Saga Pattern (concept, choreography vs orchestration)
2. Two-Phase Commit (2PC) overview and limitations
3. Event Sourcing fundamentals
4. Command Query Responsibility Segregation (CQRS) overview
• Handling distributed transactions and compensating actions
• Query patterns: API Composition and CQRS
• Real-time example: Handling distributed order and payment data
Hands-on Lab:
• Implement Saga pattern (conceptual) using messaging to coordinate distributed transactions
• Develop compensating actions for rollback scenarios
• Create sample API Composition endpoints aggregating data from User, Order, and Product
microservices
Topics to be Covered:
• What is an API Gateway? Why is it important in microservices architecture?
• Common features: Routing, aggregation, authentication, rate limiting, load balancing.
• Popular API Gateway implementations (Ocelot, YARP, Kong) in [Link] Core ecosystem
• Setting up Ocelot API Gateway in [Link] Core.
• Service Discovery concepts: Client-side vs. Server-side discovery patterns.
• Service Registry & Discovery (Eureka, Consul, custom solutions): How microservices find each
other.
• Edge vs. internal API Gateway scenarios.
• Securing microservices via the gateway.
Hands-on/Lab:
• Set up and configure Ocelot API Gateway to route requests to Product and Order microservices
based on paths and headers.
• Implement JWT-based centralized authentication at the API Gateway level.
• Register microservices with a service registry like Consul or Eureka and configure service
discovery in API Gateway.
• Create simple request aggregation APIs at the gateway that combine data from multiple
services.
• Test gateway routing, authentication, and aggregation flows using Postman.
Chapter 14: Rate Limiting / Throttling
Protecting microservices from overload and abuse by implementing API rate limiting and throttling
strategies.
Topics to be Covered:
• Why rate limiting and throttling are important in microservices
• Common scenarios: load spikes, denial of service (DoS) prevention, fair usage policies
• Types of rate limiting: fixed window, sliding window, token bucket, leaky bucket algorithms
• Rate limiting at different layers: API Gateway, microservice middleware, client-side
• Implementing rate limiting with Ocelot API Gateway in [Link] Core
• Using middleware for throttling inside microservices
• Configuring limits by IP, user, API key, or route
• Handling rate limit exceeded responses (HTTP 429) and client notifications
• Monitoring and logging rate limit events
• Best practices to balance protection and user experience
Hands-on Lab:
• Configure Ocelot to enforce rate limiting policies for APIs
• Implement middleware-based throttling in [Link] Core microservices
• Test rate limiting under simulated load scenarios using Postman or load testing tools
Topics to be Covered:
• Security challenges in microservices architecture
• Authentication vs Authorization
• Authentication strategies:
1. JWT token-based authentication (with IdentityServer4 or [Link] Core Identity)
2. OAuth2 and OpenID Connect basics
• Authorization approaches: Role-based (RBAC), Policy-based, Claims-based.
• Secure inter-service communication: API keys, mutual TLS, token propagation.
• Protecting APIs behind the API Gateway.
• Handling secrets: Configuration management, Key Vaults, environment variables.
• Best practices: Rate limiting, IP filtering, logging, auditing.
Hands-on/Lab:
• Implement JWT authentication for User microservice and secure other microservices with token
validation.
• Propagate JWT tokens through API Gateway to backend services.
• Set up role-based authorization (RBAC) for Admin, Customer, and Vendor roles.
• Secure inter-service communication using API keys or mutual TLS.
• Use HTTPS for all inter-service calls.
• Test authentication and authorization flows with Postman, including negative test cases.
Topics to be Covered:
• Why caching is essential in microservices.
• Caching strategies: Client-side, server-side, distributed caching.
• Cache invalidation patterns and challenges.
• Setting up distributed cache with Redis in [Link] Core.
• Caching at API Gateway vs. microservice level.
• Cache aside, read-through, and write-through strategies.
• Avoiding common pitfalls: Stale data, cache stampede, consistency.
• Real-world examples: Caching product catalog, user sessions, token validation.
Hands-on/Lab:
• Integrate Redis distributed cache with the Product microservice for frequently accessed data
such as product listings.
• Implement response caching at the API Gateway (Ocelot) for GET endpoints to reduce load on
microservices.
• Design and implement cache expiration policies and TTL (time-to-live).
• Handle cache invalidation scenarios to prevent stale data.
• Measure and compare API response times with and without caching.
Topics to be Covered:
• Introduction to Remote Procedure Call (RPC) and why gRPC for Microservices
• Overview of gRPC and Protocol Buffers
• Defining Service Contracts Using .proto Files
• Advantages of gRPC: Performance, contract-first design, streaming capabilities, and use cases
• Setting Up and Implementing gRPC Services in [Link] Core
• Types of gRPC Calls: Unary, client streaming, server streaming, and bidirectional streaming
(including synchronous and asynchronous streaming)
• Interoperability with Other Languages/Platforms
• Versioning and Backward Compatibility in gRPC Contracts
• Securing gRPC Communication: TLS and authentication
• gRPC vs. REST: Performance, payload size, streaming, and when to use each
Hands-on/Lab:
• Create a simple gRPC service and client in [Link] Core for microservice communication.
• Implement unary and streaming RPC calls (client streaming, server streaming, bidirectional
streaming) between Order and Inventory microservices.
• Compare the performance of gRPC calls against REST APIs for common microservice
interactions.
• Secure gRPC services using TLS and implement authentication.
Topics to be Covered:
• Principles of Event-Driven Architecture (EDA)
• Benefits of EDA: Scalability, responsiveness, resilience
• Core Concepts: Events, producers, consumers, topics, and queues
• Event Brokers and Messaging Platforms Overview: RabbitMQ, Apache Kafka
• Designing Events and Event Schemas
• Handling Event Versioning and Schema Evolution
• Event Processing Patterns: Competing consumers, publish-subscribe, and basics of event
sourcing
• Asynchronous Processing, Event Publishing, and Subscription
• Implementing Event-Driven Communication in [Link] Core Microservices
• Eventual Consistency and Designing Idempotent Event Handlers
• Error Handling and Dead-Letter Queues
• Use Cases: Order placed, payment received, stock updated, notification sent
Hands-on/Lab:
• Implement an OrderPlaced event in the Order microservice and publish it to RabbitMQ.
• Create consumers in Notification and Inventory microservices to process the event
asynchronously.
• Design idempotent event handlers and handle potential duplicates.
• Simulate event replay and test event-driven workflows end-to-end.
Topics to be Covered:
• Introduction to MassTransit and its advantages over raw message brokers
• Overview of MassTransit framework and key features
• Supported transports (RabbitMQ, Azure Service Bus, etc.)
• Setting up MassTransit in [Link] Core microservices
• Key concepts: messages, consumers, Sagas, state machines, message contracts
• Implementing Sagas for long-running workflows and distributed transactions (e.g., Order
fulfillment, Payment, Inventory)
• Message routing, retries, and fault handling
• Scheduled messages and delayed delivery
• Integrating with [Link] Core Dependency Injection and configuration
• Monitoring, logging, and diagnostics/tracing in MassTransit workflows
Hands-on Lab:
• Set up MassTransit with RabbitMQ in [Link] Core microservices
• Build a Saga workflow involving Order, Payment, and Inventory microservices
• Implement request-response and publish-subscribe messaging patterns
• Use MassTransit monitoring and diagnostics tools to track message flow and troubleshoot
issues
Topics to be Covered:
• Introduction to CQRS: rationale, benefits, and challenges
• Separating commands (writes) and queries (reads)
• Roles of Command Handlers and Query Handlers
• Event Sourcing fundamentals: capturing all state changes as an immutable event log
• Benefits and challenges of Event Sourcing including auditability and complexity
• Implementing Event Stores in .NET (using EventStoreDB, MediatR, or custom solutions)
• Techniques for rebuilding application state from event logs and snapshots
• Designing read and write models for scalability and performance
• Handling eventual consistency and synchronization between models
• Best practices: event schema changes, event versioning, safe event replay
• Real-world use cases: order state transitions, audit logging, complex business workflows
Hands-on Lab:
• Implement CQRS in Order microservice by separating command and query models
• Add event sourcing to capture all state changes as events and rebuild state
• Use MediatR or EventStoreDB to manage event streams
• Handle eventual consistency between read and write models
• Test command handling, event persistence, and state rebuilding
Topics to be Covered:
• Introduction to GraphQL and comparison with REST APIs
• Understanding GraphQL schema: queries, mutations, and subscriptions
• Benefits of using GraphQL in microservices architecture
• Designing GraphQL schemas for multiple microservices
• Querying and aggregating data from multiple services using GraphQL
• Implementing GraphQL server with [Link] Core (e.g., using HotChocolate or [Link])
• Handling GraphQL subscriptions for real-time updates
• Security considerations in GraphQL APIs (authorization, query complexity)
• Performance optimization: batching, caching, and persisted queries
• Versioning and evolution of GraphQL schemas
• Integrating GraphQL with existing microservices and APIs
• Testing and debugging GraphQL endpoints
Hands-on Lab:
• Add a GraphQL server using libraries like HotChocolate or [Link].
• Define GraphQL schema types (queries, mutations, subscriptions) that aggregate data from
multiple microservices (e.g., Product, Order, User).
• Implement resolvers to fetch data from existing REST/gRPC microservices or databases.
• Create queries that support filtering, sorting, and pagination.
• Implement mutations for creating and updating resources through GraphQL.
• Add real-time subscriptions to receive updates (e.g., order status changes).
• Secure the GraphQL endpoint using authentication and authorization policies.
• Optimize performance with batching and caching techniques.
• Test GraphQL queries, mutations, and subscriptions using tools like GraphiQL or Postman.
• Document the GraphQL API and schema using introspection and playground features.
Hands-on Lab:
• Implement retry policies with exponential backoff and jitter using Polly
• Add circuit breaker and fallback policies for critical microservice calls
• Combine multiple Polly policies in service calls
• Use Chaos Engineering tools to inject faults and observe system behavior
• Test system resilience and fallback scenarios
Topics to be Covered:
• What is Observability and why it matters in microservices
• Pillars of Observability: Logging, Metrics, and Tracing
• Centralized logging with Serilog and integration with ELK Stack
• Distributed tracing fundamentals and challenges in microservices
• Implementing OpenTelemetry instrumentation in [Link] Core
• Visualizing traces with Jaeger
• Collecting and monitoring metrics using Prometheus
• Creating dashboards and alerts in Grafana
• Correlating logs, traces, and metrics for root cause analysis
• Monitoring microservices health and performance in real-time
• Best practices for observability-driven development
Hands-on Lab:
• Integrate Serilog for centralized logging and configure structured log output.
• Instrument microservices with OpenTelemetry SDK to collect distributed traces.
• Visualize traces using Jaeger and correlate logs with trace IDs.
• Collect metrics using Prometheus and create Grafana dashboards.
• Set up alerts for service health and performance anomalies.
Topics to be Covered:
• Importance of API versioning in microservices architecture
• API versioning strategies: URI versioning, query parameters, headers, content negotiation
• Designing backward-compatible APIs and handling breaking changes
• Deprecation policies and communicating changes to API consumers
• Implementing API versioning in [Link] Core Web API
• Versioning considerations for gRPC services and message contracts
• Managing multiple active versions in production environments
• Testing and validating API versions
• Automating documentation with Swagger/OpenAPI for versioned APIs
• Strategies for smooth client migration and minimizing downtime during upgrades
Hands-on Lab:
• Implement URI-based and header-based API versioning in [Link] Core Web API.
• Design backward-compatible API changes and version deprecation strategies.
• Configure Swagger/OpenAPI documentation to support multiple API versions.
• Version gRPC service contracts with protobuf file changes.
• Test multiple versions of the same API running side by side and client compatibility.
Topics to be Covered:
• Introduction to containerization and its benefits over traditional virtualization
• Docker architecture: Docker Engine, Docker Hub, Docker CLI
• Understanding Docker images and containers
• Writing Dockerfiles for [Link] Core microservices
• Building and tagging Docker images
• Running containers locally and managing container lifecycle
• Networking basics in Docker containers
• Using Docker Compose for multi-container applications
• Defining services, networks, and volumes in [Link]
• Building a complete microservices solution with Docker Compose
• Best practices for Dockerfile creation and image optimization
• Debugging and troubleshooting Docker containers
Hands-on Lab:
• Write Dockerfiles for [Link] Core microservices and build Docker images.
• Run microservices as containers locally using docker run.
• Create a [Link] to orchestrate multi-container microservice environments.
• Manage networks, volumes, and environment variables in Docker Compose.
• Debug and troubleshoot containerized microservices.
Topics to be Covered:
• Overview of Kubernetes and container orchestration fundamentals
• Kubernetes architecture: Master node, worker nodes, API Server, Scheduler, Controller
Manager
• Key Kubernetes objects: Pods, Deployments, ReplicaSets, Services, ConfigMaps, Secrets
• Deploying [Link] Core microservices to Kubernetes clusters
• Writing Kubernetes YAML manifests for deployments and services
• Managing deployments: rolling updates, rollbacks, and scaling
• Service discovery and load balancing in Kubernetes
• Using kubectl CLI for cluster management and troubleshooting
• Configuring persistent storage for microservices
• Namespaces and resource quotas for multi-tenant cluster management
• Introduction to Helm charts for Kubernetes application packaging
• Monitoring Kubernetes clusters with built-in tools
Hands-on Lab:
• Deploy microservices to a local Kubernetes cluster (e.g., Minikube or Docker Desktop).
• Write Kubernetes manifests (Deployment, Service, ConfigMap, Secret) for microservices.
• Use kubectl commands to manage pods, deployments, and services.
• Perform rolling updates, rollbacks, and horizontal pod autoscaling.
• Configure persistent storage and namespaces for multi-tenant management.
• Package microservices as Helm charts and deploy via Helm.
Topics to be Covered:
• Importance of load balancing in microservices architecture
• Types of load balancing: client-side, server-side, and DNS-based
• Layer 4 (Transport) vs Layer 7 (Application) load balancing
• Load balancing algorithms: round-robin, least connections, IP hash, weighted load balancing
• Load balancing in Kubernetes using Services of type LoadBalancer and Ingress controllers
• Implementing load balancing with cloud providers (AWS ELB, Azure Load Balancer)
• Traffic routing strategies: blue-green deployment, canary releases, and A/B testing
• Health checks and failover mechanisms in load balancers
• Configuring load balancing for stateful vs stateless microservices
• Performance considerations and scaling with load balancing
Hands-on Lab:
• Configure Kubernetes Service of type LoadBalancer and Ingress controller to expose
microservices.
• Implement different load balancing algorithms (round-robin, least connections) using Ingress
rules or cloud load balancers.
• Set up health probes and readiness/liveness checks for pod monitoring.
• Simulate traffic routing strategies like blue-green deployments and canary releases.
• Monitor load balancer performance and failover behavior.
Topics to be Covered:
• What is a Service Mesh and why it matters in microservices
• Core features of service meshes: traffic routing, load balancing, retries, circuit breaking
• Security features: mutual TLS (mTLS) for secure service-to-service communication
• Observability: metrics, distributed tracing, and logging integration
• Policy enforcement: access control, rate limiting, and quota management
• Popular Service Mesh tools overview: Istio, Linkerd, Consul Connect
• Architecture components: control plane and data plane
• Integrating a Service Mesh with Kubernetes-based microservices
• Use cases and benefits for microservice deployments
• Challenges and considerations when adopting Service Mesh
Hands-on Lab:
• Deploy a sample microservices application on Kubernetes with Istio or Linkerd
• Configure mTLS between services for secure communication
• Set up traffic routing rules and fault injection policies
• Collect and analyze telemetry data (metrics and traces) via service mesh dashboards
Topics to be Covered:
• Introduction to Continuous Integration (CI) and Continuous Deployment/Delivery (CD)
• Benefits of CI/CD in microservices environments
• Overview of CI/CD tools and platforms with focus on GitHub Actions
• Setting up GitHub repositories and workflows for [Link] Core microservices
• Automating build and test processes in CI pipelines
• Configuring multi-stage pipelines for build, test, and deployment
• Managing secrets and environment variables securely in CI/CD pipelines
• Deployment strategies: rolling updates, blue-green deployments, canary releases
• Integrating automated tests (unit, integration, end-to-end) into pipelines
• Monitoring and alerting on pipeline status and deployment health
• Troubleshooting common CI/CD pipeline issues
• Best practices for scaling CI/CD across multiple microservices
Hands-on Lab:
• Set up a GitHub repository for your [Link] Core microservices solution.
• Create a GitHub Actions workflow file (.github/workflows/[Link]) to automate the build
process: restore dependencies, build the project, and run unit tests.
• Extend the workflow to include deployment stages for different environments (e.g., staging and
production) using Docker containers or Kubernetes manifests.
• Configure secure storage and usage of secrets and environment variables in GitHub Actions.
• Automate integration and end-to-end tests as part of the pipeline.
• Implement multi-stage pipelines with approval gates for deployment.
• Monitor pipeline runs, troubleshoot failed jobs, and set up notifications.
• Test rolling deployments and rollback mechanisms through the pipeline.
Topics to be Covered:
• Introduction to Microservices Testing Challenges
• Unit Testing
• Integration Testing
• End-to-End (E2E) Testing
• Test Data Management
• Performance and Load Testing
Hands-on Lab:
• Create unit tests for domain models and service layers using xUnit and Moq.
• Develop integration tests for API controllers using [Link] Core TestServer and in-memory
databases.
• Write end-to-end API tests for an order placement workflow across multiple services using
Postman.
• Test asynchronous message handling in the Notification microservice with MassTransit in-
memory transport.
Note: If we missed any topics, if any new features are introduced, or if you want to learn any concepts
not available in this Microservices using [Link] Core Web API Syllabus, please let us know, and that
will also be included in this course. If you have any questions, please contact us.