{"id":46,"date":"2021-04-07T18:47:00","date_gmt":"2021-04-07T18:47:00","guid":{"rendered":"https:\/\/www.ivanjurina.com\/?p=46"},"modified":"2025-01-01T18:48:36","modified_gmt":"2025-01-01T18:48:36","slug":"microservices-distilled","status":"publish","type":"post","link":"https:\/\/www.ivanjurina.com\/index.php\/2021\/04\/07\/microservices-distilled\/","title":{"rendered":"Microservices distilled"},"content":{"rendered":"\n<p id=\"viewer-foo\">My knowledge of microservices summarized \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"viewer-96l8u\">Microservices<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>approach <\/strong>to software development<\/li>\n\n\n\n<li>microservices architecture <strong>consists of a collection<\/strong> of <strong>small<\/strong>, <strong>autonomous services<\/strong>.<\/li>\n\n\n\n<li><strong>each service<\/strong>\n<ol class=\"wp-block-list\">\n<li>self-contained and should<strong> implement<\/strong> a <strong>single business capability<\/strong>.<\/li>\n\n\n\n<li><strong>separate codebase<\/strong> &#8211; can be managed by a small development team.<\/li>\n\n\n\n<li>can be <strong>deployed independently<\/strong>.<\/li>\n\n\n\n<li><strong>responsible <\/strong>for <strong>persisting <\/strong>their <strong>own data<\/strong><\/li>\n\n\n\n<li>communicate with each other by using well-defined APIs.<\/li>\n\n\n\n<li>don&#8217;t need to share the same technology stack, libraries, or frameworks.<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>team can <strong>update <\/strong>an existing <strong>service without rebuilding<\/strong> and <strong>redeploying <\/strong>the <strong>entire application<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"viewer-78fej\">Management (Orchestration)<\/h3>\n\n\n\n<p id=\"viewer-dcnqg\">This component is <strong>responsible <\/strong>for<strong> placing services on nodes, identifying failures<\/strong>, rebalancing services across nodes, and so forth. Typically this component is an off-the-shelf technology such as Kubernetes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"viewer-15j1\">Gateway<\/h3>\n\n\n\n<p id=\"viewer-fvjcp\"><strong>Entry point <\/strong>for clients. Instead of calling services directly, clients call the API gateway, which forwards the call to the appropriate services on the back end.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>decouples clients from services. Services can be versioned or refactored without needing to update all of the clients.<\/li>\n\n\n\n<li>can perform other cross-cutting functions such as <strong>authentication, logging, SSL termination, and load balancing.<\/strong><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"viewer-1lepc\">Advantages<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Agility &#8211; <\/strong>microservices are<strong> deployed independently<\/strong>, it&#8217;s<strong> easier to manage bug fixes<\/strong> and feature releases. You can <strong>update a service without redeploying the entire application<\/strong><\/li>\n\n\n\n<li><strong>Small, focused teams.<\/strong> A microservice should be small enough that a single feature team can build, test, and deploy it. Small team sizes promote greater agility.<\/li>\n\n\n\n<li><strong>Small code base.<\/strong> In a monolithic application, there is a tendency over time for code dependencies to become tangled. Adding a new feature requires touching code in a lot of places. By not sharing code or data stores, a microservices architecture minimizes dependencies, and that makes it easier to add new features.<\/li>\n\n\n\n<li><strong>Fault isolation. <\/strong>If an <strong>individual microservice becomes unavailable, it won&#8217;t disrupt the entire application,<\/strong> as long as any upstream microservices are designed to handle faults correctly.<\/li>\n\n\n\n<li><strong>Scalability<\/strong>. <strong>Services <\/strong>can be <strong>scaled independently,<\/strong> letting you scale out subsystems t<strong>hat require more resources<\/strong>, without scaling out the entire application.<\/li>\n\n\n\n<li><strong>Data isolation. <\/strong>It is much <strong>easier to perform schema updates<\/strong>, because only a single microservice is affected.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"viewer-eo232\">Challenges<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Complexity<\/strong>. A microservices application has<strong> more moving parts <\/strong>than the equivalent monolithic application. Each service is simpler, but t<strong>he entire system as a whole is more complex.<\/strong><\/li>\n\n\n\n<li><strong>Lack of governance<\/strong>. You may end up with so many <strong>different languages and frameworks that the application becomes hard to maintain<\/strong>. It may be useful to put some project-wide standards in place.<\/li>\n\n\n\n<li><strong>Network congestion and latency. <\/strong>The use of many small, granular services can result in more interservice communication. Also, <strong>if the chain of service dependencies gets too long (service A calls B, which calls C&#8230;), the additional latency can become a problem.<\/strong><\/li>\n\n\n\n<li><strong>Data integrity. <\/strong>With each microservice responsible for its own data persistence. As a result, data consistency can be a challenge.<\/li>\n\n\n\n<li><strong>Management<\/strong>. To be successful with microservices requires a mature DevOps culture.<\/li>\n\n\n\n<li><strong>Versioning<\/strong>. <strong>Updates to a service must not break services that depend on it.<\/strong><\/li>\n\n\n\n<li><strong>Skill set.<\/strong> Evaluate whether the team has the skills and experience to be successful.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My knowledge of microservices summarized \ud83d\ude42 Microservices Management (Orchestration) This component is responsible for placing services on nodes, identifying failures, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":1,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":47,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/posts\/46\/revisions\/47"}],"wp:attachment":[{"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ivanjurina.com\/index.php\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}