{"id":49136,"date":"2017-06-05T13:54:23","date_gmt":"2017-06-05T08:24:23","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=49136"},"modified":"2017-06-05T16:47:51","modified_gmt":"2017-06-05T11:17:51","slug":"an-overview-of-microservice-architecture-part-i","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/an-overview-of-microservice-architecture-part-i\/","title":{"rendered":"An Overview of Microservice Architecture &#8211; Part I"},"content":{"rendered":"<p>Companies want to bid farewell to legacy architecture and digitize their business models, products and infrastructure. While some advanced companies are leveraging two-speed IT, <a title=\"DevOps as a service\" href=\"http:\/\/www.tothenew.com\/devops-automation-consulting\">DevOps<\/a> and Cloud, some others are still trying to figure out a way to build disruptive web and mobile products faster.<\/p>\n<p><span style=\"font-weight: 400;\">Moreover, growing consumer demands have increased the need to build large scale and complex applications meeting the requirements of end users. Traditional product development teams used to work on a single monolithic deployment artifact. Monolithic architectural style puts all its functionality into a single process and scales by replicating the monolith on multiple servers.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, it was challenging to continuously manage one large monolith. <a title=\"Agile Delivery Approach\" href=\"http:\/\/www.tothenew.com\/agile-delivery-approach\">Agile software teams<\/a> weren&#8217;t able to leverage Agile principles in a real way. They found the monolith too complex to understand and debug. They were also challenged to implement new features, updates and releases. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, monolithic architecture also impacted startup time of applications. In one of the <\/span><a href=\"https:\/\/plainoldobjects.com\/2015\/05\/13\/monstrous-monoliths-how-bad-can-it-get\/\"><span style=\"font-weight: 400;\">surveys<\/span><\/a><span style=\"font-weight: 400;\">, developers reported startup times as long as 12 minutes. Apple suggests to aim for a total app launch time of under 400ms and you must do it in less than 20 seconds or the system will kill your app.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Continuous deployment was another pain point with most monolithic architecture. Development teams need to push changes to production multiple times a day and with so many releases being shipped, it is extremely difficult to redeploy entire monolith again and again just to update a small part of it. Moreover, as the impact of the change is difficult to understand, it would require an extensive testing effort every time there is a need to update or deploy. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Furthermore, monolithic applications are less reliable as modules run within the same process. The breakdown in any of the modules will impact entire process and ultimately hamper the user experience. For development teams, a larger challenge was to identify the bugs from various identical instances and make the application available at all times. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">With monolithic applications, it is also very difficult to adopt new framework and language. As it is difficult to change and rewrite code, it is not possible to introduce a new framework to improve specific aspects of the application. Monolithic applications hence present a huge barrier to adopting new technologies.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Clearly, monolithic applications are a tough nut to crack. They are difficult to understand and scale with time. <\/span><\/p>\n<p><b>Microservice Architecture &#8211; A shift to resolve the complexity <\/b><\/p>\n<p><b>What are microservices?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u201cA loosely coupled service oriented architecture with bounded contexts to make sure you break your problem into the right chunks\u201d \u00a0&#8211; Adrian Cockcroft<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u201cAn approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms\u201d \u2013 Martin Fowler<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With the focus on developing applications faster and cut down on the development costs, microservices are quickly gaining traction among software development teams. Agile teams find this architectural style a key enabler for improving the product delivery process.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Microservice architecture divides the single application into a small set of services, each running on its own but communicating with each other through APIs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A service implements some of the features or functionality such as customer management, partner management and so on. Each of these services\u00a0is mini-applications having their own hexagonal architecture. Such an architecture comprises of business logic. Out of these services, there will be some that would expose an API that\u2019s consumed by some other microservices or by app\u2019s clients whereas some others might just implement a web UI. At runtime, each instance is often a cloud VM or a Docker container.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Additionally, microservice architecture doesn&#8217;t just put each element of functionality into a separate service but also scales by distributing these set of small services across various servers and replicating them as and when needed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Organizations such as Netflix and Amazon have started leveraging this new style of developing applications for some time now. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The concept of microservices is considered as a variant of the existing service-oriented architecture (SOA) architectural style that structures an application as a group of loosely coupled services. Software development teams that are interested in leveraging\u00a0<\/span><span style=\"font-weight: 400;\">microservice architecture<\/span><span style=\"font-weight: 400;\"> should ensure that the services are fine-grained and the protocols are lightweight.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Some of the design characteristics of <\/span><span style=\"font-weight: 400;\">microservice architecture<\/span><span style=\"font-weight: 400;\"> include:<\/span><\/p>\n<ul>\n<li><b><b>Business Oriented<\/b><\/b><\/li>\n<li><b><b>Adaptable<\/b><\/b><\/li>\n<li><b><b>Autonomous<\/b><\/b><\/li>\n<li><b><b>Loosely Coupled<\/b><\/b><\/li>\n<li><b><b>Composable<\/b><\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Unlike monolithic architecture, microservices are project-agnostic providing business capabilities instead of functionality specific to a particular project on hand. This makes them reusable thereby reducing costs. Moreover, scaling up of individual services is much easier with<\/span><span style=\"font-weight: 400;\"> microservice architecture <\/span><span style=\"font-weight: 400;\">than monolithic architecture. This is mainly because each service could be individually developed, replaced and scaled as needed. In monolithic architecture, it is not possible to scale in real time as all the functionalities are bundled together in one single artifact.<\/span><\/p>\n<p><b>Eight Benefits of Microservices<\/b><\/p>\n<p><span style=\"font-weight: 400;\">After understanding microservices and differences between microservices and monolithic architecture; let us also look at the top benefits of microservices<\/span><\/p>\n<p><b><b>1. Separate components &#8211; <\/b><\/b>The<b><b> <\/b><span style=\"font-weight: 400;\">Primary benefit of the <\/span><span style=\"font-weight: 400;\">microservice architecture<\/span><span style=\"font-weight: 400;\"> is its loosely coupled components. These components can easily be developed, replaced and scaled individually.<\/span><\/b><\/p>\n<p><strong>2.<\/strong>\u00a0<b style=\"font-weight: bold;\">Increased availability<\/b> <b style=\"font-weight: bold;\">and resilience<\/b><span style=\"font-weight: 400;\"> &#8211; Microservices improve fault isolation. As complex applications are broken into separate service components and deployed on multiple servers, failing of one of the services or modules will not impact the entire application. A single service fault can easily be replaced with another service (simple to build resilience around the small set of services) increasing the application\u2019s availability. \u00a0\u00a0<\/span><\/p>\n<p><strong>3.<\/strong>\u00a0<b style=\"font-weight: bold;\">Easy to change technology stack &#8211; <\/b><span style=\"font-weight: 400;\">With microservices, software development teams can try a new stack on specific service to avail larger benefits at the application level. There is no long-term commitment to one particular stack as there are no dependency concerns. For example, recommendation micro-services can use python due to its machine-learning libraries against which event-processing <a title=\"Java Microservices\" href=\"http:\/\/www.tothenew.com\/java-development-services\">micro-services may use Java<\/a> due to the multithreading properties of jvm.<\/span><\/p>\n<p><strong>4.<\/strong>\u00a0<b style=\"font-weight: bold;\">Easy to understand even in distributed environment &#8211; <\/b><span style=\"font-weight: 400;\">Understanding how an application is developed is important when there is a change of hand in development teams. In a distributed development project when some of the team members are geographically dispersed, <\/span><span style=\"font-weight: 400;\">microservice architecture<\/span><span style=\"font-weight: 400;\"> make it easier for dev teams to understand the entire functionality of a service as it is not built into one single package.<\/span><\/p>\n<p><strong>5.<\/strong>\u00a0<b style=\"font-weight: bold;\">Organized around business capabilities &#8211; <\/b><span style=\"font-weight: 400;\">Microservices are not organized around technical capabilities of a particular product, but rather business capabilities. As the end goal is user experience and customer satisfaction, the teams leveraging microservices are not divided into UI teams, database teams and so on. In fact, there are cross-functional teams that work towards fulfilment of one single functionality. Here\u2019s a diagrammatic representation for quick understanding.\u00a0<\/span><\/p>\n<p><b><span style=\"font-weight: 400;\">Here\u2019s a diagrammatic representation for quick understanding:<\/span><\/b><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-49144 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/team-ms.png\" alt=\"team ms\" width=\"531\" height=\"579\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/team-ms.png 531w, \/blog\/wp-ttn-blog\/uploads\/2017\/06\/team-ms-275x300.png 275w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/p>\n<p><strong>6.\u00a0<\/strong><b style=\"font-weight: bold;\">Re-usability of services &#8211; <\/b><span style=\"font-weight: 400;\">As microservices are organized around business capabilities and not a specific project or product requirement, they are project agnostic. This enables technology teams to reuse services and reduce costs.<\/span><\/p>\n<p><strong>7.<\/strong>\u00a0<b style=\"font-weight: bold;\">Decentralized data management &#8211; <\/b><span style=\"font-weight: 400;\">Large scale and complex enterprise applications are normally three-tier. <\/span><a style=\"font-weight: bold;\" href=\"http:\/\/martinfowler.com\/\"><span style=\"font-weight: 400;\">Martin Fowler<\/span><\/a><span style=\"font-weight: 400;\">, in his microservices <\/span><a style=\"font-weight: bold;\" href=\"http:\/\/martinfowler.com\/articles\/microservices.html\"><span style=\"font-weight: 400;\">article<\/span><\/a><span style=\"font-weight: 400;\">, describes that microservices let each service manage its own database, either different instances of the same database technology or entirely different database systems. \u00a0As he mentioned, this approach is called Polyglot Persistence. <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here&#8217;s a diagrammatic representation for better understanding:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-49146\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/ms-teams-2.png\" alt=\"ms teams 2\" width=\"541\" height=\"358\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/ms-teams-2.png 541w, \/blog\/wp-ttn-blog\/uploads\/2017\/06\/ms-teams-2-300x198.png 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/p>\n<p><strong><span style=\"font-size: 1rem;\">8.\u00a0<\/span><\/strong><b style=\"font-size: 1rem;\">Easy to Deploy &#8211; <\/b><span style=\"font-weight: 400;\">While technology teams have to deploy an entire application again because of small change in the code, with microservices this deployment becomes easy. The scope of deployment is smaller and only the service that has a problem needs to be deployed again.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With more and more product companies now resorting to iterative development, it is crucial to have an underlying architecture which is robust, scalable and easily adaptable to real-time business needs. Microservices are surely the game changer. They not only improve the experience of development teams about building and understanding application but also improve the overall <a title=\"User Experience Design\" href=\"http:\/\/www.tothenew.com\/experience-design\">user experience<\/a> of end users. Being able to improve fault isolation, even when one of the services fail, the application is still available to users which ensure a break free experience.<\/span><\/p>\n<p>Learn more about building microservice architecture, <a title=\"microservice best practices\" href=\"http:\/\/www.tothenew.com\/blog\/how-to-build-a-robust-microservice-architecture-continuous-delivery-and-other-best-practices\/\">setting up continuous delivery and other best practices<\/a> in our second blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Companies want to bid farewell to legacy architecture and digitize their business models, products and infrastructure. While some advanced companies are leveraging two-speed IT, DevOps and Cloud, some others are still trying to figure out a way to build disruptive web and mobile products faster. Moreover, growing consumer demands have increased the need to build [&hellip;]<\/p>\n","protected":false},"author":885,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":11},"categories":[1993,2348,3917,1994,1],"tags":[4596,1916,1892,4584,3979,4595],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/49136"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/885"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=49136"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/49136\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=49136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=49136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=49136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}