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

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.
主站蜘蛛池模板: 天全县| 盐城市| 太保市| 潜江市| 开原市| 镇沅| 江川县| 杨浦区| 萨嘎县| 阳东县| 左云县| 永兴县| 杭锦旗| 乐平市| 浦北县| 无极县| 农安县| 婺源县| 绵阳市| 屏边| 灌南县| 东兰县| 罗江县| 荆门市| 都兰县| 昌宁县| 黔江区| 图木舒克市| 湟中县| 和平区| 巫山县| 翁源县| 汤阴县| 建德市| 崇礼县| 祁阳县| 盘锦市| 高邑县| 西充县| 新巴尔虎右旗| 漾濞|