Distributed Systems with Microservices
Going to microservices checklist ✅
Volume: the volume of activities outgrow the current technology stack
New features: better new technologies for certain new features (Using python for example for a report/analytics microservice)
Engineering team growth: lines of communication increased, the source code is becoming bigger, the cognitive load of an engineer is increasing which slows down the process of developing and maintaining source code (more on that later)
Technical debt: debt from previous build decision, now it's becoming difficult to make changes
Distributed system for distributed team: promoting end-to-end ownership for small set of teams with different responsibilities where each team is responsible for it own development and deployment line (frequent small releases by each team rather than a 1 big deployment release), and they communicate through defined contracts and documentation
Challenges of microservices that you should consider
Domain knowledge
Maintaining contracts
Distributed system challenges
Operational challenges
Observability
Increase points of failure
Designing phase 🎨
Implement most meaningful separation using bounded context
Design functions inside capability
Implement service contracts
Standardize the development, automate, and deployment processes
Implementing a microservice
Communication
Synchronous communication
Single Receiver
HTTP REST
gRPC
Multiple Receivers
Web-hooks
ACID distributed Transactions in microservices : https://developers.redhat.com/blog/2018/10/01/patterns-for-distributed-transactions-within-a-microservices-architecture
API Gateway
Use cases
Authentication and authorization
Service discovery integration
Response caching
Retry policies, circuit breaker, and QoS
Rate limiting and throttling
Load balancing
Logging, tracing, correlation
Headers, query strings, and claims transformation
IP allow listing
Refs
Last updated