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

  • Microservices with Clojure
  • Anuj Kumar
  • 209字
  • 2021-06-30 19:24:33

Direct lookup

Although microservices have their own isolated persistence, an application implemented using microservices may need to share data among a set of services to perform tasks. In a monolithic environment, since there is a common database, it is easier to share data and maintain consistency using transactions. In a microservices environment, it is not recommended to provide direct access to the database managed by a service, as shown in the following diagram:

For example, when a user places a new order, the Order Service may need access to the delivery address; that is, the user address from the User Service. Similarly, once the order is placed, the User Service would like to update the total orders placed till date by the user in its database. Since the user database is maintained by the User Service and the Orders Database is maintained by the Orders Service, these two services will get the required details via the APIs exposed by the other service only. They should not be allowed to directly update or access databases maintained by another service. This helps in always maintaining a single copy of the user and order databases that is not accessible to any other microservice directly.

主站蜘蛛池模板: 酒泉市| 沽源县| 获嘉县| 青海省| 武城县| 晋宁县| 江安县| 壤塘县| 江山市| 全南县| 洞口县| 无为县| 长宁县| 同德县| 宁武县| 漳州市| 扶沟县| 瑞昌市| 涟源市| 基隆市| 昆明市| 和林格尔县| 安泽县| 临湘市| 始兴县| 策勒县| 阿拉尔市| 板桥市| 安西县| 宿松县| 枞阳县| 德格县| 渭源县| 栾城县| 茌平县| 聂拉木县| 临西县| 陇川县| 蕉岭县| 苍山县| 东宁县|