{"id":88,"date":"2022-09-01T20:13:00","date_gmt":"2022-09-01T19:13:00","guid":{"rendered":"https:\/\/sanjayk7r.com\/?p=88"},"modified":"2024-03-03T20:24:11","modified_gmt":"2024-03-03T20:24:11","slug":"to-microservice-or-not","status":"publish","type":"post","link":"https:\/\/sanjayk7r.com\/index.php\/2022\/09\/01\/to-microservice-or-not\/","title":{"rendered":"To Microservice or not"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"390\" src=\"https:\/\/sanjayk7r.com\/wp-content\/uploads\/2024\/03\/containers.webp\" alt=\"\" class=\"wp-image-89\" srcset=\"https:\/\/sanjayk7r.com\/wp-content\/uploads\/2024\/03\/containers.webp 740w, https:\/\/sanjayk7r.com\/wp-content\/uploads\/2024\/03\/containers-300x158.webp 300w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/><figcaption class=\"wp-element-caption\">Photo by Teng Yuhong | Unsplash<\/figcaption><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The first law of distributed systems is, don\u2019t distribute! <\/p>\n<cite>M. Fowler<\/cite><\/blockquote>\n\n\n\n<p>If you still feel the need to consider moving to a distributed architecture then microservices is a good alternative to a monolith.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"viewer-fv9vb\">Robust and Stable<\/h5>\n\n\n\n<p id=\"viewer-d529c\">Microservices encourages a design where components are highly cohesive and have low coupling. This is an implicitly stable design.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"viewer-52drs\">Scalable<\/h5>\n\n\n\n<p id=\"viewer-2ad1m\">A monolith needs to be scaled as one entity, in a microservices architecture, every service and its underlying database can be scaled independently.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"viewer-cbj30\">Ease of deployment<\/h5>\n\n\n\n<p id=\"viewer-45nmr\">Modifying a monolith in production is like changing the wheels of a car as its moving. Deploying changes in a microservices architecture is more like a tire change at a F1 pitstop.<\/p>\n\n\n\n<p id=\"viewer-86rfo\">Teams can quickly make changes, fix bugs without stepping on each other teams toes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"viewer-1vtfm\">Why are organisations adopting Microservices?<\/h3>\n\n\n\n<p id=\"viewer-e0afr\">Here is a quote from Sam Newman that pins this down.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&#8230;the single biggest reason that organisations adopt microservices is to allow for more developers to work on the same system without getting in each others way<\/p>\n<cite>Sam Newman<\/cite><\/blockquote>\n\n\n\n<figure class=\"wp-block-embed is-type-photo is-provider-giphy wp-block-embed-giphy\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/giphy.com\/gifs\/car-today-sport-yIxLCtwz63eKY\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media1.giphy.com\/media\/yIxLCtwz63eKY\/giphy.gif\" alt=\"Formula 1 Car GIF - Find &amp; Share on GIPHY\" width=\"400\" height=\"230\" \/><\/a>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"viewer-9qo1m\">Should you use Microservices?<\/h3>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"viewer-fh8mb\">Are you a small team?<\/h5>\n\n\n\n<p id=\"viewer-7rs4v\">There is a vast ecosystem of great open source tooling that can help you setup your own microservice architecture. However, if you are a small team, its probably not a good idea to \u201croll your own\u201d.<\/p>\n\n\n\n<p id=\"viewer-2o22j\">We made this mistake. Our log aggregation SaaS was initially built with a self assembled stack that was really a distributed monolith. We spent weeks on plumbing and reliability rather than on features that delivered actual business value. Juggling all the moving parts in our stack took a lot of effort.<\/p>\n\n\n\n<p id=\"viewer-637t6\">Small teams should really invest time on the business value of their software and use managed services by AWS, GCP or Azure to take care of the microservices infrastructure.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-photo is-provider-giphy wp-block-embed-giphy\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/giphy.com\/gifs\/season-10-the-simpsons-10x21-xT5LMAvRY92qUXj7dC\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media1.giphy.com\/media\/xT5LMAvRY92qUXj7dC\/giphy.gif\" alt=\"Homer Simpson Episode 21 GIF - Find &amp; Share on GIPHY\" width=\"480\" height=\"366\" \/><\/a>\n<\/div><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"viewer-cusfa\">Are you a large team?<\/h5>\n\n\n\n<p id=\"viewer-97d0g\">If you are a large team and having difficulties or even teething pains with your monolith, then it would be a good idea to consider incremental steps towards microservices. One of the best analogies, I\u2019ve heard here is to think of microservices as a volume dial. Changes should be introduced step by step and not 0 to 10.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-photo is-provider-giphy wp-block-embed-giphy\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/giphy.com\/gifs\/maudit-lol-maudit-11-5MGFEJS7FIxK8\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media1.giphy.com\/media\/5MGFEJS7FIxK8\/giphy.gif\" alt=\"Rob Reiner Lol GIF by Maudit - Find &amp; Share on GIPHY\" width=\"500\" height=\"235\" \/><\/a>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The first law of distributed systems is, don\u2019t distribute! M. Fowler If you still feel the need to consider moving to a distributed architecture then microservices is a good alternative to a monolith. Robust and Stable Microservices encourages a design where components are highly cohesive and have low coupling. This is an implicitly stable design. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":89,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/posts\/88"}],"collection":[{"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":1,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/posts\/88\/revisions\/90"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/media\/89"}],"wp:attachment":[{"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanjayk7r.com\/index.php\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}