{"id":19286,"date":"2018-12-05T09:00:05","date_gmt":"2018-12-05T00:00:05","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=19286"},"modified":"2018-11-29T13:33:12","modified_gmt":"2018-11-29T04:33:12","slug":"saga-in-microservices","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2018\/12\/05\/saga-in-microservices\/","title":{"rendered":"\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306b\u304a\u3051\u308b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3010Saga\u3011"},"content":{"rendered":"
\u3053\u308c\u306f TECHSCORE Advent Calendar 2018<\/a> \u306e5\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n \u4e16\u306e\u4e2d\u304c\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306e\u8a71\u984c\u3067\u6ea2\u308c\u3066\u3044\u308b\u4e2d\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306f\u3069\u3046\u3084\u3063\u3066\u5b9f\u73fe\u3055\u308c\u3066\u3044\u308b\u306e\u304b\u4e0d\u601d\u8b70\u3060\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n \u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u3067\u306f\u8907\u6570\u306eAPI\u3067\u306e\u3084\u308a\u53d6\u308a\u3068\u306a\u308b\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u4f7f\u3063\u3066\u3044\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u3088\u3046\u306a\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\uff08BEGIN-COMMIT\uff09\u304c\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n \u89e3\u6c7a\u7b56\u306e\u4e00\u3064\u306bSaga\u30d1\u30bf\u30fc\u30f3<\/strong>\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n Saga\u30d1\u30bf\u30fc\u30f3\u3068\u306f\u3001\u8907\u6570\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u307e\u305f\u304c\u308b\u30d3\u30b8\u30cd\u30b9\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092Saga\u3068\u3057\u3066\u5b9f\u88c5\u3057\u307e\u3059\u3002Saga\u306f\u4e00\u9023\u306e\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n \u305f\u3068\u3048\u3070\u4e0b\u8a18\u306e\u56f3\u306e\u3088\u3046\u306a\u69cb\u6210\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n \u3053\u306e\u3068\u304d\u3001Service A \u306b\u304a\u3051\u308bSaga A\u306e\u6210\u529f\u3068\u5931\u6557\u3092\u6b21\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n \u4ee5\u4e0b\u306eSaga\u306f\u3059\u3079\u3066\u306e\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304c\u6210\u529f\u3057\u3066\u308b\u306e\u3067\u3001Saga A\u3082\u6210\u529f\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n \u6b21\u306b\u3001Transaction Z\u304c\u5931\u6557\u3057\u305f\u5834\u5408\u3067\u3059\u3002<\/p>\n \u3053\u306e\u5834\u5408\u3001Transaction Z\u304c\u5931\u6557\u3057\u305f\u305f\u3081\u3001\u88dc\u511f\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\uff08Compensation Transaction\uff09\u3092\u3059\u3067\u306b\u30b3\u30df\u30c3\u30c8\u6e08\u307f\u306eTransaction Y\u3001Transaction X\u306b\u5bfe\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002Saga A\u3068\u3057\u3066\u306f\u5931\u6557\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n \u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u8003\u3048\u65b9\u3067\u3059\u306d\u3002<\/p>\n Saga\u306e\u5b9f\u73fe\u65b9\u6cd5\u3068\u3057\u30662\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n Choreography \u3067\u306f\u3001\u5404\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306f\u3001\u4ed6\u306e\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30c8\u30ea\u30ac\u30fc\u3068\u306a\u308b\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u884c\u3057\u307e\u3059\u3002\u3053\u306e\u65b9\u6cd5\u3067\u306f\u3001\u5404\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\uff08Service X\u3001Y\u3001Z\uff09\u306f\u81ea\u8eab\u306e\u767a\u884c\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u304a\u3088\u3073\u81ea\u8eab\u306e\u30c8\u30ea\u30ac\u30fc\u3068\u306a\u308b\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u304c\u8cac\u52d9\u306e\u7bc4\u56f2\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n Orchestration \u3067\u306f\u3001Service A\u3067\u751f\u6210\u3057\u305f\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30bf\u30fc\u304c\u3001\u5b9f\u884c\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30b3\u30de\u30f3\u30c9\u3092\u5404\u30b5\u30fc\u30d3\u30b9\uff08Service X\u3001Y\u3001Z\uff09\u306b\u901a\u77e5\u3057\u307e\u3059\u3002\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30bf\u30fc\u306f\u5b9f\u884c\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3064\u3044\u3066\u77e5\u8b58\u3092\u6301\u3064\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n \u521d\u898b\u3067\u306fChoreography\u306e\u307b\u3046\u304cOrchestration\u3088\u308a\u3082\u8cac\u52d9\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u3001\u4ed6\u306e\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u8abf\u6574\u3082\u4e0d\u8981\u306a\u305f\u3081\u826f\u3055\u305d\u3046\u306b\u307f\u3048\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u305e\u308c\u826f\u3057\u60aa\u3057\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n Choreography\u306f\u3001\u81ea\u8eab\u306e\u30c8\u30ea\u30ac\u30fc\u3068\u306a\u308b\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u306e\u8cac\u52d9\u304c\u5927\u304d\u304f\u3001\u8907\u6570\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u5faa\u74b0\u53c2\u7167\u3059\u308b\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3060\u3068\u30a4\u30d9\u30f3\u30c8\u306e\u6271\u3044\u304c\u975e\u5e38\u306b\u96e3\u3057\u304f\u306a\u308a\u307e\u3059\u3002\u30b7\u30f3\u30d7\u30eb\u306aSaga\u306e\u5834\u5408\u306f\u5341\u5206\u306b\u6709\u52b9\u306a\u65b9\u6cd5\u306a\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n Orchestration\u306f\u3001\u95a2\u4fc2\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3064\u3044\u3066\u306f\u7ba1\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u5404\u30b5\u30fc\u30d3\u30b9\u9593\u3067\u4e92\u3044\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u51e6\u7406\u3068\u3057\u3066\u306f\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001Saga\u304c\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30bf\u30fc\u306b\u9589\u3058\u308b\u305f\u3081\u3001Saga\u5916\u90e8\u306e\u3053\u3068\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u3001Saga\u9593\u306e\u72ec\u7acb\u6027\u306b\u3064\u3044\u3066\u306f\u8003\u616e\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n \u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306b\u304a\u3051\u308b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067Saga\u304c\u4f7f\u3048\u305d\u3046\u306a\u6c17\u304c\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u5c0e\u5165\u3059\u308b\u306b\u306f\u307e\u3060\u307e\u3060\u58c1\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n Saga\u3092\u5165\u308a\u53e3\u306b\u4ed6\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u30d1\u30bf\u30fc\u30f3\u3082\u5b66\u7fd2\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n GOTO 2015 \u2022 Applying the Saga Pattern \u2022 Caitie McCaffrey<\/a> *\u52d5\u753b Microservices Pattern - Chris Richardson<\/a> \u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u5bfe\u30b3\u30ec\u30aa\u30b0\u30e9\u30d5\u30a3\u30fc\uff1a\u5b9a\u7fa9\u306b\u95a2\u3059\u308b\u8ad6\u4e89<\/a> saga\u3092\u4f7f\u7528\u3057\u305f\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306e\u30c7\u30fc\u30bf\u4e00\u8cab\u6027<\/a> Saga: How to implement complex business transactions without two phase commit.<\/a> \u3053\u308c\u306f TECHSCORE Advent Calendar 2018 \u306e5\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n \u306f\u3058\u3081\u306b<\/p>\n \u4e16\u306e\u4e2d\u304c\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306e\u8a71\u984c\u3067\u6ea2\u308c\u3066\u3044\u308b\u4e2d\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306f\u3069\u3046\u3084\u3063\u3066\u5b9f\u73fe\u3055\u308c\u3066\u3044\u308b\u306e\u304b\u4e0d\u601d\u8b70\u3060\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002\u306f\u3058\u3081\u306b<\/h2>\n
Saga\u30d1\u30bf\u30fc\u30f3<\/h2>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
<\/a><\/p>\n
Saga \u306e\u5b9f\u73fe\u65b9\u6cd5<\/h2>\n
\n
Choreography<\/span><\/h3>\n
<\/a><\/p>\n
Orchestration<\/span><\/h3>\n
<\/a><\/p>\n
Choreography vs Orchestration<\/span><\/h3>\n
\u307e\u3068\u3081<\/h2>\n
\n
\u53c2\u8003<\/h2>\n
\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3<\/h3>\n
\nGOTO 2015 \u2022 Applying the Saga Pattern \u2022 Caitie McCaffrey<\/a> *\u30b9\u30e9\u30a4\u30c9
\n\u3068\u3066\u3082\u308f\u304b\u308a\u3084\u3059\u304fSaga\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u8a71\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\u66f8\u7c4d<\/h3>\n
\n\u672c\u8a18\u4e8b\u3067\u611f\u3058\u305f\u5c0e\u5165\u306b\u969b\u3057\u3066\u306e\u58c1\u306e\u5bfe\u5fdc\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002
\nSaga\u30d1\u30bf\u30fc\u30f3\u306e\u4ed6\u306b\u3082\u6709\u7528\u306a\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306e\u305f\u3081\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u591a\u304f\u3042\u308a\u307e\u3059\u3002<\/p>\n\u8a18\u4e8b<\/h3>\n
\nOrchestration\u3068Choreography\u306b\u3064\u3044\u3066\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n
\nACID Is So Yesterday: Maintaining Data Consistency with Sagas<\/a>
\n\u3044\u305a\u308c\u3082Saga\u3067\u306eACID\u306b\u304a\u3051\u308b\u72ec\u7acb\u6027\uff08Isolation\uff09\u306e\u6b20\u843d\u306b\u3064\u3044\u3066\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n
\nBPMN (Business Process Model and Notation) \u3068\u3044\u3046\u30e2\u30c7\u30eb\u56f3\u3067Saga\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":41,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[308,18],"tags":[141,298],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/19286"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=19286"}],"version-history":[{"count":17,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/19286\/revisions"}],"predecessor-version":[{"id":20795,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/19286\/revisions\/20795"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=19286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=19286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=19286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}