The next level is communication among microservices. When microservices communicate among themselves, a checklist should be followed. This checklist helps to ensure that if any service fails, then the failure is contained and it doesn't spread through the entire system:
- Data should be transported in a serialized format, such as JSON or protobuf
- Error codes should be used carefully and actions should be taken accordingly on them.
- APIs should be simple, effective, and the contract should be clear
- A service discovery mechanism should be implemented to find other services easily
- Decentralized interactions over centralized orchestrators should be preferred
- APIs should be versioned
- Circuit breakers help to stop the error propagating ...