Lalit Kale
@atechiethought
Introduction To Microservices
Limerick DotNet Azure User Group (LDNA)
About Me
• 12 years of .NET
• Roles: Software Developer  Sr. Developer  Tech Lead Architect
• Limerick DotNet Azure Meetup Organizer
Limerick DotNet Azure User Group (LDNA)
Limerick DotNet Azure User Group (LDNA)
Sponsors – Thank You!
Why Microservices?
Why Microservices?
• As a business transformational instrument in
• Organizational Restructuring
• Supporting hyper-scale growth
• Scaling business capabilities
• Provides Business Agility and faster pace to delivery
• Unlocks experimentation and learning capabilities on organizational
level which is not at all possible with Monolithic architectures
What are Microservices?
Monolith and Microservices
Monolith Microservices
Martin Fowler on Microservices
• The microservice architectural style is an approach to developing a single
application as a suite of small services, each running in its own process and
communicating with lightweight mechanisms, often HTTP resource API.
• These services are built around business capabilities and independently
deployable by fully automated deployment machinery.
• There is a bare minimum of centralized management of these services,
which may be written in different programming languages and use
different data storage technologies.
Every microservice is different, yet they share some common characteristics.
Microservices
Principles of Microservices
Deployment
Technology
Versions
Languages
Infrastructure
Operations
Developme
nt
Testing
Security
Fail
Predictably
No SPoF
Automated
Recovery
Based on Business
Capability
Single
Responsibility
Hide
‘Implementation’
Independence Independence Independence IsolationIndependence Automation Fail-Safe
What is NOT Microservices?
What is NOT Microservices?
Refactor monolithic application into smaller services??
Monolith
If you force monolith to get Microservices any which way, all you can get is Microlith
Microservice?
Microlith
Monolith
What is NOT Microservices?
What is NOT Microservice?
Microservices Pre-requisites
Conway’s Law
"Any organization that designs a system (defined more broadly here
than just information systems) will inevitably produce a design whose
structure is a copy of the organization's communication structure.“
-Melvin Conway
Conway’s Law
Conway’s Law
Org Structure Architectural Capabilities
Reversing the Conway’s Law
• Two Pizza Teams focused on Business Capability
• You Build it, You Run it!
• Microservices
Designing Microservices
Designing Microservices
• ‘Micro’ is misleading most of implementations
• It is NOT about how many lines of code in your microservice have
• Should be Manageable by a small, self-sufficient team
• Evolutionary design
Designing Microservices
• Service = Business Capability
• Single Responsibility Principle(SRP)
• Find the Seams around Service Boundary.
• DDD – Follow Bounded Context Pattern
• Follow Consumer Driven Contracts
Designing Microservices - Tips
• Ensure independent development and deployment of the service
• Focus more on the scope of the microservice, but not about
making the service smaller
• SOA = Coarse Grain Services while microservice should have a very
few operations/functionalities and simple message format.
• It is often a good practice to start with relatively broad service
boundaries to begin with, refactoring to smaller ones (based on
business requirements) as time goes on.
Microservices Interactions
Microservices Interactions
• Orchestration vs. Choreography
Microservices Interactions
• Understanding Message Queue, Message Bus
• FIFO
• Same system different processes
• Separate queues for separate
• dependent Process
• No sequential preference
• Pub-Sub Mechanism
• Single Message bus for connecting
different applications
Microservices Interactions
• API Gateway
• Event Sourcing
• Eventual Consistency
• Compensating Transaction
Microservices Deployment
Microservices Deployment
• Understanding Isolation
• Importance of Containers Breakthrough
• Infrastructure as code
Operations
• Pet Vs. Cattle Mindset
• Logging & Monitoring
• What to measure?
• Co-relation Id
• Tools: Elastic.io , Splunk, Fluentd, Sensu, Prometheus, Azure Log Analytics,
Diagnostics Log, Auditing
Microservices Scaling
Infrastructure Scaling
VM Scale
Sets
Azure Container
Service
Kubernetes
Docker Swarm
DC/OS
Pivotal Cloud
Foundry
App Service
Azure Functions
Docker
Containers
Web/api/mobile
apps
Service Fabric
Orchestrator
Custom
Programming
Model
Host-Guest
Executable
Elastic &
Declarative
Open source
High-Density
Open source
PaaS
Web/Mobile/
Serverless
Stateful &
Stateless
AFK Scale Cube
Circuit Breaker Pattern
Scaling Service Design - Service Discovery
Client Side Service Discovery
• Azure Load Balancer
• Application Gateway
• Netflix Eureka
Server-side Service Discovery
• Consul
• Etcd
• Zookeeper
Demo
Service Discovery using Consul
Questions and Answers
.
This presentation is shared under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. More information for this license is available at http://creativecommons.org/licenses/by-nc-sa/4.0/
All trademarks are the property of their respective owners. Lalit Kale or Limerick DotNet-Azure User Group or it’s members makes no warranties, express, implied or statutory, as to the information in this presentation.
Limerick DotNet-Azure User Group
https://www.meetup.com/limerick-dotnet/
Twitter: limerickdotnet

Introduction To Microservices

Editor's Notes

  • #4 Please note, this is mandatory slide and Do Not change or exclude
  • #18 Note: Not a true depiction of these org. communications just included for humour and emphasizing the point of Conway’s law
  • #19 Ref: https://www.thoughtworks.com/insights/blog/applying-conways-law-improve-your-software-development
  • #20 Ref: https://www.thoughtworks.com/insights/blog/applying-conways-law-improve-your-software-development
  • #27 Ref: https://ardalis.com/bus-or-queue Ref: https://stackoverflow.com/questions/7793927/message-queue-vs-message-bus-what-are-the-differences
  • #36 Ref: http://microservices.io/patterns/server-side-discovery.html
  • #37 Ref: http://microservices.io/patterns/client-side-discovery.html
  • #38 Ref: http://microservices.io/patterns/server-side-discovery.html
  • #41 This is End slide. As a user group, we wanted to share your contribution with our community, off course, with due credits. Hence, we are sharing this presentation under creative commons Noncommercial-ShareAlike 4.0 international license.