Please enable JavaScript.
Coggle requires JavaScript to display documents.
Microservices The Big Picture (Microservices Elements (Building…
Microservices The Big Picture
What Are Microservices?
Software Development Lifecycle
Agile Development
Requirements
Plan & design
Develop
Test
Release
Monitor
Mentain
What Are Microservices?
Set of practices
Increase speed
Scale
Technology Agnostic
Principles and architectural patterns
MicroService
Micro
Do one thing and it right
Scope of functionalities
Identify sub-domains
Service
Independently deployable component
Interoperability
Message based communication
Service-oriented architecture (SOA)
The microservice architetural stylke is an approach to developing a single application as a suite of small services, each running in its own process and communication with lightweight mechanisms.
Microservices are small, autonomus services that work together.
Microservices Elements
Introduction
Microservice terminology
Designing
Data Store
Temote communication
Monitoring
Building a Monolith
Model
User Interface
Single database
Expose APIs
Multiple instances / Load balancer
Pro / Cons
Pro
Simple to develop
simple to build
simple to test
simple to deploy
Simple to scale
Cons
New team members productivity
Growing Teams
Code harder to understand
No emerging technologies
Scale for bad reasons
Huge database
Building Microservices
Domain
Subdomain
User
Order
Product
Dependencies for these 3 subdomains
They should be Independent
Domain Driven Design
gives us techniques and patterns to solve the dependencies
Duplicate entities that depend on eachother
Sharing database is discouraged and is an antypattern
Organization
Team per subdomain
right-sized teams
independent
responsible
agile and devops
communication
Management
Code
Documentation
Repository
Data Store
User Interface
Data Store
Independent
Different requirements
Relational
NoSQL
Data Synchronization
No distributed transaction
Immediately consistent
Eventual consistency
Patterns
:
Capture data change
Event sourcing
: for a period of time, same product may have different price or description on both subdomains
Publishing Events :check:
AKA
Kafca
RabbitMQ
Capture DataChange: :check:
Debezium
User Interface
Independent teams
own set of components
unique UI
single application
UI Composition
Server Side
Client side
Services
Distrbuted Services
Services
RPC - Remote Procedure Invocation
Request / Reply principle
Can be:
Synchronus
Asynchronus
Technologies: :check:
-REST, SOAP, gRPC
Messaging
Message or event
Broker or channel
Publish
Subscribe
Asynchronuous messaging keeps things Loosely coupled
Technologies for Message Brokers: :check:
Kafka
RabbitMQ
Protocol Format Exchange
Text : XML, JSON, YAML
Binary: gRPC
APIs and Contracts
SOAP, REST, gRPC
You have yo describe your microservice api using: :check:
WSDL, Swagger, IDL (Interface Definition Language)
Distributed Services
Service Registry
is the phonebook for the Microservices
Microservices register their location on startup
Famous Service Registries: :check:
Eureka
zookeeper
Consul
Cross-origin Resource Sharing (CORS)
Same-Origin policy documents can communicate with the documents on the same domain, same protocol, server, port
HTTP Restricts cross-origin :check:
Microservices use different HTTP headers to allow them to communicate cross-origin
Access-Control-Allow-Origin Headers
Pattern:
:check:
Circuit Breaker
Service Available
Network Failure
Heavy load
Domino Effect
Invoke via proxy
Deviate calls
reintroduce traffic
Technologies for Circuit Breaker: :check:
Hystrix
JRugged
Gateway
access individual services
Single entry point
Unified interface
Cross-cutting concerns
API translation
Technologies: :check:
Zuul
Netty
Finagle
Security
Scalability and Availability
Monitoring
Deployment
Revising The Microservices
Security
Authentication And Authorization
Authentication - someone is who he claims to be
Authorization - refers to rules that determine who is allowed to do what
Identity and Access Management
Single Sign-on : Kerberos, OpenID, OAuth 2.0, SAML :check:
Identity access management systems: Okta, Keycloak, Shiro :check:
Access Token:
Store Info about the user
Exchanged between services
JSON Web Token
Cookie
Scalability and Availability
Vertical - More resources (CPU & RAM)
Horizontal - More machines:
Service registry - Load Banalcer (Round-robin, weight, capacity)
Load-Balancing Tools: :check:
Ribbon
Meraki
Availability
Single Point of Failure: :check:
Gateway, Broker, Registry, IAM
:check: - We need to scale those Horizontaly to have multiple instances and clustered to keep in sync
Courses
Rang Dhiman : Microservices Architecture
Dino Esposito: Modern Software Architecture
Are Microservices Right for Your Organization?