Please enable JavaScript.
Coggle requires JavaScript to display documents.
2 Microservices Best Practices - Coggle Diagram
2 Microservices Best Practices
Principles
Decompose by Business Capability
Domain Driven Design (DDD)
Build for Failure
Distributed Systems Thinking
Network partitions, latency, or the fallacies of distributed computing
Data Consistency
Eventual consistency, transactions, and compensating operations
communication mechanisms
synchronous or asynchronous
REST APIs, messaging protocols, or event-driven architectures
timeouts, circuit breakers, and bulkheads to prevent failures from cascading through your system
Independent & Autonomous Services-
Separately deployed services
deployment strategies
canary deployments, blue-green deployments, or rolling updates
API Evolution
Versioning
Automate Everything
testing, deployment, and monitoring
Security
Authentication and authorization mechanisms,
the data is protected both in transit and at rest.
access tokens, service-to-service authentication,
and encrypted connections
Accessed typically through an API gateway for Identity mgmt
Cross-cutting concerns
Monitor and Log Effectively
Zipkin
correlating logs across services, aggregating logs and implementing health checks
Independent & Autonomous Services
Single-purpose
loose coupling, high cohesion
Scalable
load balancing, failover, and horizontal scaling
Service Taxonomy (Classification)
Functional Service
Orchestration Service
(Data Aggregators across multiple services)
Infrastructure Services
Aggregation services
Gateway Services
(for Identity mgmt)
Decentralization
(compare to the ESB)
Pattern
Circuit-breaker
Implements a fault-tolerant mechanism for microservices, preventing cascading failures by
automatically detecting and isolating faulty services.
Saga
Manages distributed transactions
across multiple microservices, ensuring data consistency while maintaining the autonomy of your services.
Sidecar Pattern
Attaches additional components to your microservices
, providing modular functionality without altering the core service itself.
CQRS (Command Query Responsibility Segregation)
Separates the read and write operations in a microservice
, improving performance, scalability, and maintainability.