According to the CAP theorema, when a distributed system encounters a network partition,the system must choose either Consistency (all changes are instantaneously applied to all nodes) or Availability (Every request receives a non-error response, without the guarantee that it contains the most recent write.), but not both. While in the definitionof ACID, consistency is about obeying constraints, in the CAP theorem context, consistency refers to every read receiveing the most recent write or an error which can only happen when a change has been applied to all nodes.


Below shouws the trade off between consistency and avalaibilty....

Favoring consistency, the customer data would strictly remain under control of the customer microservice. 

The order microservice reaches out to the customer microservice for details like the shipping address. 

However, if the customer service is not reachable, the order service cannot perform its task. 

This might be an acceptable risk, or it might not.

Favoring availability, the dependency on the customer microservice needs to be eliminated by replicating the relevant subset of customer data to the order service. 

By replicating the data, you end up being limited to eventual consistency and implement replica convergence and conflict resolution as a consequence.


3> 2PC,- tries strong consistency at the cost of avaliability...(nosql and message brokers do not support 2pc)

distributed trans model does not fit..