Transcript
Page 1: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Introduction to Microservices

Shailendra Chauhan

Microsoft MVP, Technical Consultant and Corporate Trainer

Page 2: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Introduction to Microservices

• Microservices Principles

• Monolithic vs. N-Layer vs. SOA vs. Microservices

• Microservices Architecture

• When to use Microservices Architecture

• Challenges of Microservices

• Tools/Platform For Building Microservices

• Microservices API Gateways

• Design Patterns for Microservices

Agenda

Page 3: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Microservice is a small unit that has only one responsibility or single logicwhich solve a specific problem.

• Microservices are the evolution of service-oriented architecture.

• Microservices are small and independent services that work together.

• A style of engineering to build highly automated, independent and evolvingsoftware.

• Each Microservice can be deployed independently.

• A Microservice itself persist its own data or external state.

• All services don't need to share the same technology stack, libraries, orframeworks.

Introduction to Microservices

Page 4: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Microservices Principles

Page 5: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Modelled around business domain : Separate system capability intodifferent domains and each domain will focus on one thing and itsassociated logic.

• Culture of Automation : Follow the culture of automation by designing it forcontinues integration and continuous delivery.

• Hide implementation details : Hiding the internal details reduce thecoupling and helps to do changes and improvement without affecting theoverall architecture.

• Decentralization : There is no centralized database, usually each service isdesigned to manage its own database.

Microservices Principles Contd..

Page 6: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Deploy Independently : Each service can be deployed independently.

• Failure Isolation : The impact of a failure is less in microservice architecturecompares to monolithic type as it will only affect that particular service andits associates. Other services can keep running.

• Highly Observable : The services should collect as much information toanalyze what is happening within each of them like log events and stats.

Microservices Principles Contd..

Page 7: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Monolithic vs. N-Layer vs. SOA vs. Microservices

Monolithic: Single Unit Multi Units: N-Layer/SOA Smaller Units: Microservices

Page 8: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Microservices Architecture

Client API Gateway

Service 1

Service 2

Service n

Microservices

Page 9: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Large applications that require a high release velocity.

• Complex applications that need to be highly scalable.

• Applications with rich domains or many subdomains.

• An organization that consists of small development teams.

When to use Microservices Architecture

Page 10: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Language independent and framework independent.

• Independently develop, deploy, redeploy, version and scale component services in seconds without compromising the integrity of an application

• Better fault isolation keeps other services to work even on failure.

• Zero downtime upgrades.

• Services can be of from different servers or even from different datacenters.

• Reliable and self-healing.

• Supports continuous integration and delivery.

• Easy to integrate with third parties.

Advantages of Microservices

Page 11: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Complexity - A microservices application is more complex as compared tothe equivalent monolithic application.

• Development and testing - Building and testing a service that relies on otherservices need domains understanding and refactoring them can be difficult.

• Lack of governance - The decentralized approach to building microserviceshas advantages, but it also lead to so many problems like maintenancebecause of many different languages and frameworks.

• Network congestion and latency - The use of many small, services can resultinto additional latency because of interservice communication and a longchain of service dependencies. So design APIs carefully and useasynchronous communication patterns.

Challenges of Microservices

Page 12: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

• Data Integrity - Each microservice is responsible for its own datapersistence. As a result, data consistency can be a challenge.

• Management - To be successful with microservices requires a matureDevOps culture. Correlated logging across services can be challenging for asingle user operation.

• Versioning - Be careful while updating a service. It must not break servicesthat depend on it. So without careful design, you might have problemswith backward or forward compatibility.

• Skillset - Microservices are highly distributed systems. So need a skilled andexperience team to implement it.

Challenges of Microservices Contd..

Page 13: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Tools/IDE:Getting started with Microservices

Page 14: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Development Frameworks

Page 15: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Development Tools

www.visualstudio.microsoft.com/

Visual Studio VS Code

www.code.visualstudio.com/

Docker

www.code.docker.com/

Page 16: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Microservices API Gateways

Azure API Management Ocelot API Gateway Traefik (traffic)

Page 17: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Design Patterns for Microservices

Decomposition Patterns

• Decompose by Business Capability

• Decompose by Subdomain

• Strangler Pattern

Integration Patterns

• API Gateway Pattern

• Aggregator Pattern

• Client-Side UI Composition Pattern

Database Patterns

• Database per Service

• Shared Database per Service

• CQRS Pattern

• Saga Pattern

Communication Patterns

• Request/Response Pattern

• Messaging Pattern

• Event Driven Pattern

Deployment Patterns

• Multiple Service Instances per Host

• Service Instance per Host

• Serverless Deployment

• Service Deployment Platform

Page 18: Microservices Tutorial for Beginners | All you need to Getting Started | Dot Net Tricks

For Microservices Online Training : +91-999 123 502

Design Patterns for Microservices

Observability Patterns

• Log Aggregation

• Performance Metrics

• Distributed Tracing

• Health Check

Cross-Cutting Concern Patterns

• Externalized Configuration

• Service Discovery Pattern

• Circuit Breaker Pattern


Top Related