官术网_书友最值得收藏!

Data storing and sharing

Another problem is data storing and sharing. An effective microservice needs to be independent of other microservices, and ideally, should not share a database. What does this mean for our hotel booking app?

Again, that raises a lot of questions such as the following:

  • Do we use the same users' IDs across all databases, or do we have independent IDs in each service and keep it as a hidden implementation detail?
  • Once a user is added to the system, do we replicate some of her information in other services databases via strategies like data pumping, or is that overkill?
  • How do we deal with data removal?

These are hard questions to answer, and there are many different ways to solve those problems, as we'll learn throughout the book.

Avoiding data duplication as much as possible while keeping microservices in isolation is one of the biggest challenges in designing microservices-based applications.
主站蜘蛛池模板: 青川县| 沙坪坝区| 铁力市| 苍山县| 神农架林区| 云林县| 平凉市| 通许县| 新源县| 永济市| 通化市| 绥芬河市| 乌恰县| 中方县| 高平市| 湟中县| 太白县| 连山| 南宫市| 夹江县| 河南省| 洛阳市| 留坝县| 理塘县| 阿克陶县| 赤城县| 玛多县| 平度市| 达拉特旗| 滦平县| 手游| 民丰县| 治多县| 安新县| 固原市| 凭祥市| 开封县| 凌海市| 赣州市| 屯门区| 台山市|