Data Consistency Across Microservices

前端 未结 6 549
滥情空心
滥情空心 2021-01-30 02:41

While each microservice generally will have its own data - certain entities are required to be consistent across multiple services.

For such data consistency requiremen

6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 02:59

    Theoretical Limitations

    One important caveat to remember is the CAP theorem:

    In the presence of a partition, one is then left with two options: consistency or availability. When choosing consistency over availability, the system will return an error or a time-out if particular information cannot be guaranteed to be up to date due to network partitioning.

    So by "requiring" that certain entities are consistent across multiple services you increase the probability that you will have to deal with timeout issues.

    Akka Distributed Data

    Akka has a distributed data module to share information within a cluster:

    All data entries are spread to all nodes, or nodes with a certain role, in the cluster via direct replication and gossip based dissemination. You have fine grained control of the consistency level for reads and writes.

提交回复
热议问题