SlideShare una empresa de Scribd logo
1 de 60
GOING MICROSERVICES
WITH .NETDavid Revoledo
@deirevoledo
Contamos con el apoyo de:
About me !
David Revoledo | @deirevoledo
• Working with Microsoft technologies pretty much all my career.
• Speaker
• .Net, AzureTrainer and Consultant.
• Open Source active contributor (Azure event hub, service bus SDK’s
and a Few Plugins).
• Focused onAsp. NET Core / Azure
• Software Architect at DGENIX
19/12/2018
19/12/2018
Agenda
1. Microservices Introduction
2. Starting Microservices with .NET
3. Conclusion
4. Q&A
19/12/2018
19/12/2018
Microservices?
Let’s start saying is a very bad name.
• Serverless ?
• NoSQL ?
• Data Lake ?
19/12/2018
What is a Microservices Architecture?
“a microservices architecture as a service-oriented architecture
composed of loosely coupled elements that have bounded
contexts. “
?
19/12/2018
But what is the difference with a Layer/Tier (Coding)
Architecture
19/12/2018
What microservices are not
• When a solutions need to be deployed complete to provide a “new
version” of a product.
• When a component failing is causing a complete system failure.
19/12/2018
Microservices is “Multi Process Applications”
19/12/2018
Common characteristics
• Componentization via Services by Domain “bounded context”.
• Organized around business capabilities.
• Decentralized Data Management.
• Infrastructure Automation.
• Design for Failure.
• Aggressive monitoring.
19/12/2018
Benefits
• Allows to create pieces of software in loosely coupled services kind.
• Allow to release features/fixes continuously (better Time To Market)
• Allows to evolve the company technology stack.
• Allows to migrate a services changing nothing if the contract does not change.
• Because MS is built with failures in mind, we are building resilience.
• Because MS is built with automation in mind, we are saving time/money in the future.
• Because MS is built with monitoring in mind, we have a better control how what is happening.
• We don’t have to marry with a technology/framework (devs engagement)
• Let us built software with business first with a service scope instead of a technical layers.
19/12/2018
There ain't no such thing as a free lunch
• Inter Process Communication.
• Async Calling by Messaging.
• Eventual Consistency.
• Duplicated data.
• Process failures.
19/12/2018
CAP Theorem
19/12/2018
19/12/2018
Microservices Architecture Is Not a Silver Bullet
• As is not just a technical decision, it require a mindset change of the
complete team including the client.
• Business boundaries need to be identified.
• Is the solution being too simply, probably MS will bring more complexity
than flexibility.
• You need to be mature with Devops. Practices.
19/12/2018
Let’s start MS with NET
19/12/2018
Structure
• DDD / CRQS Microservices
• Messaging communication between services
• Api Gateway
• Retries.
• Containers.
19/12/2018
Api Gateway
• How do the clients of a Microservices-based application access the
individual services?
19/12/2018
19/12/2018
Api Gateway
• Coupling: Without the API Gateway pattern the client apps are coupled to the
internal microservices.
• Too many round-trips: A single page/screen in the client app might require
several calls to multiple services.
• Security issues: Without a gateway, all the microservices must be exposed to
the "external world“. The smaller is the attack surface, the more secure your
application can be.
• Cross-cutting concerns: Each publicly published microservice must handle
concerns such as authorization, SSL, etc. In many situations those concerns
could be handled in a single tier so the internal microservices are simplified.
19/12/2018
Use an API Gateway
REST
Product info service
REST
Recommendation service
AMQP
Review service
API
gateway
View Controller
Model
Traditional server-side
web application
View Controller
Model
Browser/native app
Single entry
point
Client
specific API Protocol
translation
19/12/2018
Variation: Backends for frontends
Web application
Mobile app
3rd party applications
Web app
API
gateway
Mobile API
gateway
Public API
gateway
REST
Catalog service
REST
Recommendation service
gRPC
Review service
19/12/2018
Ocelot Api Gateway
• Routing
• Request Aggregation
• Service Discovery with Consul &
Eureka
• Service Fabric
• WebSockets
• Authentication
• Authorization
• Rate Limiting
• Caching
• Retry policies / QoS
• Load Balancing
• Logging / Tracing / Correlation
• Headers / Query String / Claims
Transformation
• Custom Middleware / Delegating Handlers
• Configuration / Administration REST API
• Platform / Cloud Agnostic
• Etc.
19/12/2018
Ocelot ASP.NET Core configuration.
dotnet add package Ocelot
19/12/2018
Ocelot ASP.NET Core configuration.
19/12/2018
Ocelot Load balancing.
19/12/2018
Ocelot Auth.
19/12/2018
Ocelot Rate Limits.
19/12/2018
Ocelot
• Is a code level gateway useful also to run multiple services in a single
docker container image.
19/12/2018
Options.
For others features not supported by Ocelot or a better infrastructure
throughput consider infrastructure solutions like.
• Azure Application Gateway.
• Azure Api Management.
• Others
19/12/2018
Messaging between Microservices “Breaking RPC”
• Async communication between microservices
• Event driven design
• Easy to add a sub-action for an event/command without change the
communication in the producer
19/12/2018
Messaging in Microservices
The more nodes there are, more work load Messaging will improve
performance, resilience and resources usages.
• If there is a network outage / issue with the code with an RCP call the
operations will break down and client need to execute it again.
• With RPC, threads are allocated with load, the more nodes there are
more accumulated memory you have. (Gen2 Garbage collector problem).
• Instead of using threads and memory the work going through durable
disk saved messages.
19/12/2018
19/12/2018
Using RabbitMQ
19/12/2018
Using RabbitMQ
19/12/2018
Using Messaging
Using messages we are doing workload by an async call that is not waiting for the
response of an external process (RPC).
Using other Messaging providers like Azure Service Bus we have others features
Like:
• Automatic duplicated detection.
• Transactions.
• Pub/Sub scenarios.
• Sessions / Ordered messages.
19/12/2018
CQRS + DDD
• Not all microservices need same level of complexity but for those who are
not trivial, and the business is complex enough, CQRS + DDD is the perfect
combination
• DDD let us focus on bounded context, perfect to structure our
microservices
• CQRS let us divide Command and Event models, perfect to use messaging,
rcp calls.
19/12/2018
Drive Domain Design
• Being Aligned with the business’ model, strategies, and processes.
• Being isolated from other domains and layers in the business.
• A Common Set of Terms and Definitions Used by the Entire Team
• Keeping Track Is Made Easier
• Better Code
• Agility Is a Standard
• Get a Good Software Architecture
• Stay Focused on the Solution
• Purely Flexible
19/12/2018
MediatR
Is the most popular framework to implement domain events
implementations under CQRS fashion.
19/12/2018
MediatR
MediatR acting as an internal process message broker has two kinds of
messages it dispatches:
• Request/response messages, dispatched to a single handler
• Notification messages, dispatched to multiple handlers
19/12/2018
MediatR
• Request/response messages, dispatched to a single handler
19/12/2018
MediatR
• Notification messages, dispatched to multiple handlers
19/12/2018
MediatR Installing in ASP.NET Core
dotnet add package MediatR
dotnet add package MediatR.Extensions.Microsoft.DependencyInjection
19/12/2018
That’s it start using MediatR and IRequests Handler
19/12/2018
MediatR + Messaging
Combining MediatR + Async Messaging is an excellent choise
For an Event Driven solution that works with high throughput
for high Work Load without data lost in a microservices architecture.
19/12/2018
Retry Strategy
19/12/2018
Retry Strategy
As we can deal with multiple distributed nodes things can fail and WILL fail.
Retry is an important deal to consider in a Microservices architecture.
• Retry Pattern
• Circuit Breaker
• Exponential Retry.
19/12/2018
Polly
19/12/2018
Containers
Contrary to how VMs work, with Docker we don’t need to constantly set up
clean environments in the hopes of avoiding conflicts.
With Docker, we know that there will be no conflicts. Docker guarantees that
application microservices will run in their own environments that are
completely separate from the operating system.
Docker becomes the facto technology for applications containerization.
19/12/2018
Containers
Docker allow us to configure the environment of an app an include all the OS
dependencies and configuration insolated of the OS it runs.
With docker we can run containers dependencies for our nodes (Microservices)
create the whole environment where they run.
Also configure the required software like Databases, Rabbit, otc.
There are tons of images in Docker Hub
- Rabbit
- Redis
- SQL Server
19/12/2018
Docker ASP.NET Core Configuration.
Just a file
19/12/2018
Docker Visual Studio integration.
19/12/2018
19/12/2018
Docker Benefit
• Faster start time. A Docker container starts in a matter of seconds
because a container is just an operating system process. A VM with a
complete OS can take minutes to load.
• Faster deployment. There’s no need to set up a new environment; with
Docker, web development team members only need to download a Docker
image to run it on a different server.
• Easier management and scaling of containers, as you can destroy and run
containers faster than you can destroy and run virtual machines.
• Better usage of computing resources as you can run more containers than
virtual machines on a single server.
• Support for various operating systems: you can get Docker for Windows,
Mac, Debian, and other OSs.
19/12/2018
Conclusion.
Microservices is an evolution of SOA, actually is not something new.
It’s a more aggressive solution that require the complete team ready to
implement it. Implementing MS is not just a technical decision.
19/12/2018
Conclusion.
19/12/2018
Conclusion.
You Build it, Test it, Deploy it.
19/12/2018
More Information.
https://dotnet.microsoft.com/download/thank-you/microservices-architecture-ebook
¡MUCHAS GRACIAS!
Follow me:
@deirevoledo
davidrevoledo@d-genix.com

Más contenido relacionado

La actualidad más candente

Extending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryExtending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryKenny Bastani
 
Back your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryBack your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryKenny Bastani
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entityToni Jara
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Kai Wähner
 
Connecting All Abstractions with Istio
Connecting All Abstractions with IstioConnecting All Abstractions with Istio
Connecting All Abstractions with IstioVMware Tanzu
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Binary Studio
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoVMware Tanzu
 
Build12 factorappusingmp
Build12 factorappusingmpBuild12 factorappusingmp
Build12 factorappusingmpEmily Jiang
 
Cloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud ServicesCloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud ServicesChris Sterling
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3Dmitry Skaredov
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudRamnivas Laddad
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudVMware Tanzu
 
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at JavanturaHands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at JavanturaJamie Coleman
 
CF SUMMIT: Partnerships, Business and Cloud Foundry
CF SUMMIT: Partnerships, Business and Cloud FoundryCF SUMMIT: Partnerships, Business and Cloud Foundry
CF SUMMIT: Partnerships, Business and Cloud FoundryNima Badiey
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applicationsKasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applicationsLibbySchulze
 

La actualidad más candente (20)

Extending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryExtending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud Foundry
 
Back your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud FoundryBack your app with MySQL and Redis on Cloud Foundry
Back your app with MySQL and Redis on Cloud Foundry
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
 
Connecting All Abstractions with Istio
Connecting All Abstractions with IstioConnecting All Abstractions with Istio
Connecting All Abstractions with Istio
 
Serverless Spring
Serverless SpringServerless Spring
Serverless Spring
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand Rao
 
Build12 factorappusingmp
Build12 factorappusingmpBuild12 factorappusingmp
Build12 factorappusingmp
 
Cloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud ServicesCloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud Services
 
Azure privatelink
Azure privatelinkAzure privatelink
Azure privatelink
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring Cloud
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
 
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at JavanturaHands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
CF SUMMIT: Partnerships, Business and Cloud Foundry
CF SUMMIT: Partnerships, Business and Cloud FoundryCF SUMMIT: Partnerships, Business and Cloud Foundry
CF SUMMIT: Partnerships, Business and Cloud Foundry
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applicationsKasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
 

Similar a Going MicroServices with Net

Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Walid Shaari
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 IntroductionShapeBlue
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS
 
Serverless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment OpportunitiesServerless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment OpportunitiesUnderscore VC
 
Major Cloud Platforms Players - Year 2015
Major Cloud Platforms Players - Year 2015Major Cloud Platforms Players - Year 2015
Major Cloud Platforms Players - Year 2015Krishna-Kumar
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud ComputingUOS
 
Aws based digital_transformation_platform
Aws based digital_transformation_platformAws based digital_transformation_platform
Aws based digital_transformation_platformSlobodan Sipcic
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerSakari Hoisko
 
Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker, Inc.
 
#dbhouseparty - Should I be building Microservices?
#dbhouseparty - Should I be building Microservices?#dbhouseparty - Should I be building Microservices?
#dbhouseparty - Should I be building Microservices?Tammy Bednar
 
Microservices Patterns with GoldenGate
Microservices Patterns with GoldenGateMicroservices Patterns with GoldenGate
Microservices Patterns with GoldenGateJeffrey T. Pollock
 
Microservices, Containers, and Beyond
Microservices, Containers, and BeyondMicroservices, Containers, and Beyond
Microservices, Containers, and BeyondLakmal Warusawithana
 
[WSO2Con Asia 2018] Microservices, Containers, and Beyond
[WSO2Con Asia 2018] Microservices, Containers, and Beyond[WSO2Con Asia 2018] Microservices, Containers, and Beyond
[WSO2Con Asia 2018] Microservices, Containers, and BeyondWSO2
 
Exploring a simpler, more portable, less overhead solution to deploy Elastics...
Exploring a simpler, more portable, less overhead solution to deploy Elastics...Exploring a simpler, more portable, less overhead solution to deploy Elastics...
Exploring a simpler, more portable, less overhead solution to deploy Elastics...LetsConnect
 
Building Cloud-Native Applications with a Container-Native SQL Database in th...
Building Cloud-Native Applications with a Container-Native SQL Database in th...Building Cloud-Native Applications with a Container-Native SQL Database in th...
Building Cloud-Native Applications with a Container-Native SQL Database in th...NuoDB
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfMongoDB
 

Similar a Going MicroServices with Net (20)

Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 Introduction
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
 
Serverless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment OpportunitiesServerless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment Opportunities
 
Major Cloud Platforms Players - Year 2015
Major Cloud Platforms Players - Year 2015Major Cloud Platforms Players - Year 2015
Major Cloud Platforms Players - Year 2015
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Aws based digital_transformation_platform
Aws based digital_transformation_platformAws based digital_transformation_platform
Aws based digital_transformation_platform
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
 
Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
 
#dbhouseparty - Should I be building Microservices?
#dbhouseparty - Should I be building Microservices?#dbhouseparty - Should I be building Microservices?
#dbhouseparty - Should I be building Microservices?
 
Microservices Patterns with GoldenGate
Microservices Patterns with GoldenGateMicroservices Patterns with GoldenGate
Microservices Patterns with GoldenGate
 
Microservices, Containers, and Beyond
Microservices, Containers, and BeyondMicroservices, Containers, and Beyond
Microservices, Containers, and Beyond
 
[WSO2Con Asia 2018] Microservices, Containers, and Beyond
[WSO2Con Asia 2018] Microservices, Containers, and Beyond[WSO2Con Asia 2018] Microservices, Containers, and Beyond
[WSO2Con Asia 2018] Microservices, Containers, and Beyond
 
Exploring a simpler, more portable, less overhead solution to deploy Elastics...
Exploring a simpler, more portable, less overhead solution to deploy Elastics...Exploring a simpler, more portable, less overhead solution to deploy Elastics...
Exploring a simpler, more portable, less overhead solution to deploy Elastics...
 
Building Cloud-Native Applications with a Container-Native SQL Database in th...
Building Cloud-Native Applications with a Container-Native SQL Database in th...Building Cloud-Native Applications with a Container-Native SQL Database in th...
Building Cloud-Native Applications with a Container-Native SQL Database in th...
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdf
 
Coud computing
Coud computingCoud computing
Coud computing
 
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
 
Ravi namboori ppt
Ravi namboori pptRavi namboori ppt
Ravi namboori ppt
 

Último

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Último (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Going MicroServices with Net

  • 1. GOING MICROSERVICES WITH .NETDavid Revoledo @deirevoledo
  • 2. Contamos con el apoyo de:
  • 3. About me ! David Revoledo | @deirevoledo • Working with Microsoft technologies pretty much all my career. • Speaker • .Net, AzureTrainer and Consultant. • Open Source active contributor (Azure event hub, service bus SDK’s and a Few Plugins). • Focused onAsp. NET Core / Azure • Software Architect at DGENIX 19/12/2018
  • 4. 19/12/2018 Agenda 1. Microservices Introduction 2. Starting Microservices with .NET 3. Conclusion 4. Q&A
  • 6. 19/12/2018 Microservices? Let’s start saying is a very bad name. • Serverless ? • NoSQL ? • Data Lake ?
  • 7. 19/12/2018 What is a Microservices Architecture? “a microservices architecture as a service-oriented architecture composed of loosely coupled elements that have bounded contexts. “ ?
  • 8. 19/12/2018 But what is the difference with a Layer/Tier (Coding) Architecture
  • 9. 19/12/2018 What microservices are not • When a solutions need to be deployed complete to provide a “new version” of a product. • When a component failing is causing a complete system failure.
  • 10. 19/12/2018 Microservices is “Multi Process Applications”
  • 11. 19/12/2018 Common characteristics • Componentization via Services by Domain “bounded context”. • Organized around business capabilities. • Decentralized Data Management. • Infrastructure Automation. • Design for Failure. • Aggressive monitoring.
  • 12. 19/12/2018 Benefits • Allows to create pieces of software in loosely coupled services kind. • Allow to release features/fixes continuously (better Time To Market) • Allows to evolve the company technology stack. • Allows to migrate a services changing nothing if the contract does not change. • Because MS is built with failures in mind, we are building resilience. • Because MS is built with automation in mind, we are saving time/money in the future. • Because MS is built with monitoring in mind, we have a better control how what is happening. • We don’t have to marry with a technology/framework (devs engagement) • Let us built software with business first with a service scope instead of a technical layers.
  • 13. 19/12/2018 There ain't no such thing as a free lunch • Inter Process Communication. • Async Calling by Messaging. • Eventual Consistency. • Duplicated data. • Process failures.
  • 16. 19/12/2018 Microservices Architecture Is Not a Silver Bullet • As is not just a technical decision, it require a mindset change of the complete team including the client. • Business boundaries need to be identified. • Is the solution being too simply, probably MS will bring more complexity than flexibility. • You need to be mature with Devops. Practices.
  • 18. 19/12/2018 Structure • DDD / CRQS Microservices • Messaging communication between services • Api Gateway • Retries. • Containers.
  • 19. 19/12/2018 Api Gateway • How do the clients of a Microservices-based application access the individual services?
  • 21. 19/12/2018 Api Gateway • Coupling: Without the API Gateway pattern the client apps are coupled to the internal microservices. • Too many round-trips: A single page/screen in the client app might require several calls to multiple services. • Security issues: Without a gateway, all the microservices must be exposed to the "external world“. The smaller is the attack surface, the more secure your application can be. • Cross-cutting concerns: Each publicly published microservice must handle concerns such as authorization, SSL, etc. In many situations those concerns could be handled in a single tier so the internal microservices are simplified.
  • 22. 19/12/2018 Use an API Gateway REST Product info service REST Recommendation service AMQP Review service API gateway View Controller Model Traditional server-side web application View Controller Model Browser/native app Single entry point Client specific API Protocol translation
  • 23. 19/12/2018 Variation: Backends for frontends Web application Mobile app 3rd party applications Web app API gateway Mobile API gateway Public API gateway REST Catalog service REST Recommendation service gRPC Review service
  • 24. 19/12/2018 Ocelot Api Gateway • Routing • Request Aggregation • Service Discovery with Consul & Eureka • Service Fabric • WebSockets • Authentication • Authorization • Rate Limiting • Caching • Retry policies / QoS • Load Balancing • Logging / Tracing / Correlation • Headers / Query String / Claims Transformation • Custom Middleware / Delegating Handlers • Configuration / Administration REST API • Platform / Cloud Agnostic • Etc.
  • 25. 19/12/2018 Ocelot ASP.NET Core configuration. dotnet add package Ocelot
  • 30. 19/12/2018 Ocelot • Is a code level gateway useful also to run multiple services in a single docker container image.
  • 31. 19/12/2018 Options. For others features not supported by Ocelot or a better infrastructure throughput consider infrastructure solutions like. • Azure Application Gateway. • Azure Api Management. • Others
  • 32. 19/12/2018 Messaging between Microservices “Breaking RPC” • Async communication between microservices • Event driven design • Easy to add a sub-action for an event/command without change the communication in the producer
  • 33. 19/12/2018 Messaging in Microservices The more nodes there are, more work load Messaging will improve performance, resilience and resources usages. • If there is a network outage / issue with the code with an RCP call the operations will break down and client need to execute it again. • With RPC, threads are allocated with load, the more nodes there are more accumulated memory you have. (Gen2 Garbage collector problem). • Instead of using threads and memory the work going through durable disk saved messages.
  • 37. 19/12/2018 Using Messaging Using messages we are doing workload by an async call that is not waiting for the response of an external process (RPC). Using other Messaging providers like Azure Service Bus we have others features Like: • Automatic duplicated detection. • Transactions. • Pub/Sub scenarios. • Sessions / Ordered messages.
  • 38. 19/12/2018 CQRS + DDD • Not all microservices need same level of complexity but for those who are not trivial, and the business is complex enough, CQRS + DDD is the perfect combination • DDD let us focus on bounded context, perfect to structure our microservices • CQRS let us divide Command and Event models, perfect to use messaging, rcp calls.
  • 39. 19/12/2018 Drive Domain Design • Being Aligned with the business’ model, strategies, and processes. • Being isolated from other domains and layers in the business. • A Common Set of Terms and Definitions Used by the Entire Team • Keeping Track Is Made Easier • Better Code • Agility Is a Standard • Get a Good Software Architecture • Stay Focused on the Solution • Purely Flexible
  • 40. 19/12/2018 MediatR Is the most popular framework to implement domain events implementations under CQRS fashion.
  • 41. 19/12/2018 MediatR MediatR acting as an internal process message broker has two kinds of messages it dispatches: • Request/response messages, dispatched to a single handler • Notification messages, dispatched to multiple handlers
  • 42. 19/12/2018 MediatR • Request/response messages, dispatched to a single handler
  • 43. 19/12/2018 MediatR • Notification messages, dispatched to multiple handlers
  • 44. 19/12/2018 MediatR Installing in ASP.NET Core dotnet add package MediatR dotnet add package MediatR.Extensions.Microsoft.DependencyInjection
  • 45. 19/12/2018 That’s it start using MediatR and IRequests Handler
  • 46. 19/12/2018 MediatR + Messaging Combining MediatR + Async Messaging is an excellent choise For an Event Driven solution that works with high throughput for high Work Load without data lost in a microservices architecture.
  • 48. 19/12/2018 Retry Strategy As we can deal with multiple distributed nodes things can fail and WILL fail. Retry is an important deal to consider in a Microservices architecture. • Retry Pattern • Circuit Breaker • Exponential Retry.
  • 50. 19/12/2018 Containers Contrary to how VMs work, with Docker we don’t need to constantly set up clean environments in the hopes of avoiding conflicts. With Docker, we know that there will be no conflicts. Docker guarantees that application microservices will run in their own environments that are completely separate from the operating system. Docker becomes the facto technology for applications containerization.
  • 51. 19/12/2018 Containers Docker allow us to configure the environment of an app an include all the OS dependencies and configuration insolated of the OS it runs. With docker we can run containers dependencies for our nodes (Microservices) create the whole environment where they run. Also configure the required software like Databases, Rabbit, otc. There are tons of images in Docker Hub - Rabbit - Redis - SQL Server
  • 52. 19/12/2018 Docker ASP.NET Core Configuration. Just a file
  • 55. 19/12/2018 Docker Benefit • Faster start time. A Docker container starts in a matter of seconds because a container is just an operating system process. A VM with a complete OS can take minutes to load. • Faster deployment. There’s no need to set up a new environment; with Docker, web development team members only need to download a Docker image to run it on a different server. • Easier management and scaling of containers, as you can destroy and run containers faster than you can destroy and run virtual machines. • Better usage of computing resources as you can run more containers than virtual machines on a single server. • Support for various operating systems: you can get Docker for Windows, Mac, Debian, and other OSs.
  • 56. 19/12/2018 Conclusion. Microservices is an evolution of SOA, actually is not something new. It’s a more aggressive solution that require the complete team ready to implement it. Implementing MS is not just a technical decision.