{"id":247,"date":"2022-02-14T19:30:57","date_gmt":"2022-02-14T19:30:57","guid":{"rendered":"https:\/\/liangqi.org\/?p=247"},"modified":"2022-02-14T19:43:14","modified_gmt":"2022-02-14T19:43:14","slug":"what-makes-it-so-hard-to-migrate-to-micro-service","status":"publish","type":"post","link":"https:\/\/liangqi.org\/?p=247","title":{"rendered":"What makes it so hard to migrate to Micro service"},"content":{"rendered":"\n<p>We have been tried for so many years but since we didn&#8217;t admit we failed officially there is no formal conclusion what went wrong? Or what really made it so hard.<\/p>\n\n\n\n<p>By reading this book <a href=\"https:\/\/amzn.to\/34I6Plh\">Microservices patterns<\/a> maybe there are couple of main reasons<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The user interaction is very hard to change.<br><\/strong><br>Distribute the data to different micro services would cause that it would be more complex to complete one complex tasks. For example, when a customer want to  create a subscription we potentially need to create an account, create a subscription, even doing payment, invoice and etc. Since we are B2B business it make it very hard to change the expectation from customer. It needs to be synchronized in one REST API call. The microservice is very efficient if we can do it asynchronously. For example when customer create an order we can create an order immediately with &#8220;pending&#8221; status and then doing the validation etc. There are some other way to do it like caching data which would not work for data change\/create.<br>Imaging how fast can be faster than put a bunch of SQL in one transaction. and use database transaction to control atonic. <br><\/li><li><strong>Distributed Transaction.<br><\/strong><br>Distributed transaction would not work and the Saga mode is eventually consistence. If the customer expectation is synchronous API it would make one service waiting for another depended services to complete which would reduce the service availability and the performance would not be good.<br><\/li><li><strong>Query data from different micro services<br><\/strong><br>We didn&#8217;t have GraphQL when we started the Microservice project which make it harder to support the same query. And even with GraphQL we would see the performance degradation by joining result and run separate queries in different data services. Even technically I believe the flexibility pays off the little bit performance hit. And we can scale out much more easily and would has less chance the system got overloaded and performance was degraded in some extreme scenario. In that perspective, the performance not necessary worse. But in the normal scenario customers may experience a little bit performance hit. And if one major customer complaint a lot and claim to leave, the project can see as a failure..<\/li><\/ul>\n\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-2039424354293049\"\n     crossorigin=\"anonymous\"><\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have been tried for so many years but since we didn&#8217;t admit we failed officially there is no formal conclusion what went wrong? Or what really made it so hard. By reading this book Microservices patterns maybe there are couple of main reasons The user interaction is very hard to change.Distribute the data to different micro services would cause that it would be more complex to complete one complex tasks. For example, when a customer want to create a subscription we potentially need to create an account, create a subscription, even doing payment, invoice and etc. Since we are B2B business it make it very hard to change the expectation from customer. It needs to be synchronized in one REST API call. The microservice is very efficient if we can do it asynchronously. For example when customer create an order we can create an order immediately with &#8220;pending&#8221; status and then doing the validation etc. There are some other way to do it like caching data which would not work for data change\/create.Imaging how fast can be faster than put a bunch of SQL in one transaction. and use database transaction to control atonic. Distributed Transaction.Distributed transaction would not work and the Saga mode is eventually consistence. If the customer expectation is synchronous API it would make one service waiting for another depended services to complete which would reduce the service availability and the performance would not be good. Query data from different micro servicesWe didn&#8217;t have GraphQL when we started the Microservice project which make it harder to support the same query. And even with GraphQL we would see the performance degradation by joining result and run separate queries in different data services. Even technically I believe the flexibility pays off the little bit performance hit. And we can scale out much more easily and would has less chance the system got overloaded and performance was degraded in some extreme scenario. In that perspective, the performance not necessary worse. But in the normal scenario customers may experience a little bit performance hit. And if one major customer complaint a lot and claim to leave, the project can see as a failure..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,16],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-design","category-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/liangqi.org\/?p=247\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey\" \/>\n<meta property=\"og:description\" content=\"We have been tried for so many years but since we didn&#8217;t admit we failed officially there is no formal conclusion what went wrong? Or what really made it so hard. By reading this book Microservices patterns maybe there are couple of main reasons The user interaction is very hard to change.Distribute the data to different micro services would cause that it would be more complex to complete one complex tasks. For example, when a customer want to create a subscription we potentially need to create an account, create a subscription, even doing payment, invoice and etc. Since we are B2B business it make it very hard to change the expectation from customer. It needs to be synchronized in one REST API call. The microservice is very efficient if we can do it asynchronously. For example when customer create an order we can create an order immediately with &#8220;pending&#8221; status and then doing the validation etc. There are some other way to do it like caching data which would not work for data change\/create.Imaging how fast can be faster than put a bunch of SQL in one transaction. and use database transaction to control atonic. Distributed Transaction.Distributed transaction would not work and the Saga mode is eventually consistence. If the customer expectation is synchronous API it would make one service waiting for another depended services to complete which would reduce the service availability and the performance would not be good. Query data from different micro servicesWe didn&#8217;t have GraphQL when we started the Microservice project which make it harder to support the same query. And even with GraphQL we would see the performance degradation by joining result and run separate queries in different data services. Even technically I believe the flexibility pays off the little bit performance hit. And we can scale out much more easily and would has less chance the system got overloaded and performance was degraded in some extreme scenario. In that perspective, the performance not necessary worse. But in the normal scenario customers may experience a little bit performance hit. And if one major customer complaint a lot and claim to leave, the project can see as a failure..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/liangqi.org\/?p=247\" \/>\n<meta property=\"og:site_name\" content=\"Liangqi\u2018s Technical Journey\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-14T19:30:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-14T19:43:14+00:00\" \/>\n<meta name=\"author\" content=\"liangqi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"liangqi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/liangqi.org\/?p=247#article\",\"isPartOf\":{\"@id\":\"https:\/\/liangqi.org\/?p=247\"},\"author\":{\"name\":\"liangqi\",\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3\"},\"headline\":\"What makes it so hard to migrate to Micro service\",\"datePublished\":\"2022-02-14T19:30:57+00:00\",\"dateModified\":\"2022-02-14T19:43:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/liangqi.org\/?p=247\"},\"wordCount\":381,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3\"},\"articleSection\":[\"Design\",\"\u6280\u672f\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/liangqi.org\/?p=247#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/liangqi.org\/?p=247\",\"url\":\"https:\/\/liangqi.org\/?p=247\",\"name\":\"What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey\",\"isPartOf\":{\"@id\":\"https:\/\/liangqi.org\/#website\"},\"datePublished\":\"2022-02-14T19:30:57+00:00\",\"dateModified\":\"2022-02-14T19:43:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/liangqi.org\/?p=247#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/liangqi.org\/?p=247\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/liangqi.org\/?p=247#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/liangqi.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What makes it so hard to migrate to Micro service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/liangqi.org\/#website\",\"url\":\"https:\/\/liangqi.org\/\",\"name\":\"Liangqi\u2018s Technical Journey\",\"description\":\"Chasing Excellence; Enjoy life.\",\"publisher\":{\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/liangqi.org\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3\",\"name\":\"liangqi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/liangqi.org\/wp-content\/uploads\/2022\/01\/P1100089-3-scaled.jpg\",\"contentUrl\":\"https:\/\/liangqi.org\/wp-content\/uploads\/2022\/01\/P1100089-3-scaled.jpg\",\"width\":2560,\"height\":1920,\"caption\":\"liangqi\"},\"logo\":{\"@id\":\"https:\/\/liangqi.org\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/liangqi.org\"],\"url\":\"https:\/\/liangqi.org\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/liangqi.org\/?p=247","og_locale":"en_US","og_type":"article","og_title":"What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey","og_description":"We have been tried for so many years but since we didn&#8217;t admit we failed officially there is no formal conclusion what went wrong? Or what really made it so hard. By reading this book Microservices patterns maybe there are couple of main reasons The user interaction is very hard to change.Distribute the data to different micro services would cause that it would be more complex to complete one complex tasks. For example, when a customer want to create a subscription we potentially need to create an account, create a subscription, even doing payment, invoice and etc. Since we are B2B business it make it very hard to change the expectation from customer. It needs to be synchronized in one REST API call. The microservice is very efficient if we can do it asynchronously. For example when customer create an order we can create an order immediately with &#8220;pending&#8221; status and then doing the validation etc. There are some other way to do it like caching data which would not work for data change\/create.Imaging how fast can be faster than put a bunch of SQL in one transaction. and use database transaction to control atonic. Distributed Transaction.Distributed transaction would not work and the Saga mode is eventually consistence. If the customer expectation is synchronous API it would make one service waiting for another depended services to complete which would reduce the service availability and the performance would not be good. Query data from different micro servicesWe didn&#8217;t have GraphQL when we started the Microservice project which make it harder to support the same query. And even with GraphQL we would see the performance degradation by joining result and run separate queries in different data services. Even technically I believe the flexibility pays off the little bit performance hit. And we can scale out much more easily and would has less chance the system got overloaded and performance was degraded in some extreme scenario. In that perspective, the performance not necessary worse. But in the normal scenario customers may experience a little bit performance hit. And if one major customer complaint a lot and claim to leave, the project can see as a failure..","og_url":"https:\/\/liangqi.org\/?p=247","og_site_name":"Liangqi\u2018s Technical Journey","article_published_time":"2022-02-14T19:30:57+00:00","article_modified_time":"2022-02-14T19:43:14+00:00","author":"liangqi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"liangqi","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/liangqi.org\/?p=247#article","isPartOf":{"@id":"https:\/\/liangqi.org\/?p=247"},"author":{"name":"liangqi","@id":"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3"},"headline":"What makes it so hard to migrate to Micro service","datePublished":"2022-02-14T19:30:57+00:00","dateModified":"2022-02-14T19:43:14+00:00","mainEntityOfPage":{"@id":"https:\/\/liangqi.org\/?p=247"},"wordCount":381,"commentCount":0,"publisher":{"@id":"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3"},"articleSection":["Design","\u6280\u672f"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/liangqi.org\/?p=247#respond"]}]},{"@type":"WebPage","@id":"https:\/\/liangqi.org\/?p=247","url":"https:\/\/liangqi.org\/?p=247","name":"What makes it so hard to migrate to Micro service - Liangqi\u2018s Technical Journey","isPartOf":{"@id":"https:\/\/liangqi.org\/#website"},"datePublished":"2022-02-14T19:30:57+00:00","dateModified":"2022-02-14T19:43:14+00:00","breadcrumb":{"@id":"https:\/\/liangqi.org\/?p=247#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/liangqi.org\/?p=247"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/liangqi.org\/?p=247#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/liangqi.org\/"},{"@type":"ListItem","position":2,"name":"What makes it so hard to migrate to Micro service"}]},{"@type":"WebSite","@id":"https:\/\/liangqi.org\/#website","url":"https:\/\/liangqi.org\/","name":"Liangqi\u2018s Technical Journey","description":"Chasing Excellence; Enjoy life.","publisher":{"@id":"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/liangqi.org\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/liangqi.org\/#\/schema\/person\/105c89d9b783fda67b62e3ce113d6cd3","name":"liangqi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/liangqi.org\/#\/schema\/person\/image\/","url":"https:\/\/liangqi.org\/wp-content\/uploads\/2022\/01\/P1100089-3-scaled.jpg","contentUrl":"https:\/\/liangqi.org\/wp-content\/uploads\/2022\/01\/P1100089-3-scaled.jpg","width":2560,"height":1920,"caption":"liangqi"},"logo":{"@id":"https:\/\/liangqi.org\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/liangqi.org"],"url":"https:\/\/liangqi.org\/?author=1"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liangqi.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=247"}],"version-history":[{"count":3,"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/liangqi.org\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/liangqi.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liangqi.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liangqi.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}