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

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.
主站蜘蛛池模板: 新昌县| 鹿泉市| 博白县| 陇川县| 富宁县| 三门峡市| 新绛县| 喀喇沁旗| 永德县| 镇原县| 康马县| 内江市| 开江县| 西安市| 玛纳斯县| 淮阳县| 清流县| 阳原县| 衡阳市| 岳普湖县| 盘山县| 阿合奇县| 龙胜| 云阳县| 乐东| 濉溪县| 屯昌县| 施秉县| 米脂县| 枞阳县| 砀山县| 开远市| 台东县| 东源县| 贞丰县| 台南市| 凌源市| 鄂托克前旗| 清水县| 波密县| 泾源县|