Microservices For The Enterprise Agility And Scalability 2

Transcription

MicroservicesFor the Enterprise Agility and Scalability

Table of contentsIntroduction3Traditional Monolithic ArchitecturePatterns Vs Modern Microservice4Advantages of a Microservices Architecture6Patterns on Microservice8Technology and Tooling10Raising On Agility14Conclusion14Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.32

IntroductionMicroservices is anarchitectural type thatstructures an application as acluster of small autonomousservices to develop modernapplications.It allows teams to focus onnarrower domains and smallerunits, aiding enterprise agilityand scalability to sustain thesurging market demands.Microservices have made themark in the softwarearchitecture market, providingadvantages such as improvedfault tolerance that keepslarger applications fromgetting affected by failures ofsmaller modules.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.3

Traditional Monolithic Architecture Patterns vs ModernMicroserviceMonolithic architecture pattern hastraditionally been followed in mostorganizations. In a monolith approach,the complete application is developedas a single large module which shouldbe deployed every time, even on minorchanges. In contrast, in the case ofmicroservices architecture, we need todeploy only the module which isaffected by the changes.technology, but microservice istechnology agnostic. We can developevery individual module in theapplication with different technologies.The biggest pain point of the monolithicapplication is on every change cycle,the complete application should beverified, whereas, in case of themicroservice we need to verify only theaffected module.Microservice architecture is aningenious way to create softwarequickly while keeping risks to aminimum. However, while beginningwith the transition, the future-focusedbusinesses must identify andacknowledge their applicationrequirements to ensure agility,scalability, efficiency, and success.In monolithic, the complete applicationshould be developed using one specificMicroservice allows to scale everyindividual module to the level that isneeded for the business to perform butin case of monolithic, it is possible toonly scale the whole am depicts a simple application that follows the monolithic approachProprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.4

AuthenticationWeb Application API oardServiceServiceRegistryResourcesServiceDiagram depicts the same application in microservice approach“With larger, monolithic systems, there are feweropportunities for people to step up and ownsomething. With microservices, on the other hand, wehave multiple autonomous codebases that will havetheir own independent lifecycles. Helping people stepup by having them take ownership of individualservices before accepting more responsibility can bea great way to help them achieve their own careergoals, and at the same time lightens the load onwhoever is in charge!”- Sam Newman, Building MicroservicesProprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.5

Advantages of a Microservices ArchitectureMicroservices architecture brings a lot of advantages to modern applications. Let usdiscuss some of those briefly belowTechnology AgnosticsAgilityEasy DeploymentCloud NativeScalabilityBetter Fault IsolationMicroservice architecture patternprovides freedom to develop eachmodule in the application with differenttechnology which suits that module.Microservice allows deploying only thechanges that reduce the deploymenteffort of deploying the wholeapplication every time.Microservice architecture allows toscale any individual module to the levelof performance that is needed by thebusiness. For example, in an air ticketbooking application, the flight searchmodule is heavily used by thecustomers. Microservice architectureallows to develop the flight searchmodule as a separate module andscale it to the level of performanceneeded to satisfy the business need.Microservice pattern allows the team tofocus only on the module they areresponsible for and deliver much faster.Microservices are more cloud native. Itis easy to setup in any public or privatecloud as it is mostly packed ascontainers and can be deployed easily.In case of any failure in any module,only the module specific functionalitywill not be available to the users, butusers should continue to use theapplication with other functionalitieswhich was not affected. For example, inthe ecommerce application where theproduct review service is down, the usersshould be able to continue using theapplication’s other functionalities likesearching for the product, getting theproduct list, purchasing the product, etc.,& users could not be able to see onlythe product review due to which therewon’t be a huge impact on the businessin case of failure in any modules.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.6

The global microservices architecture market sizewas valued at 2,073 million in 2018, and isprojected to reach 8,073 million by 2026,registering a CAGR of 18.6% from 2019 to 2026.Global MicroservicesArchitecture MarketOpportunities andForecast,Global MicroservicesArchitecture Marketis Expected to reachGrowing at a CAGR of18.6% (2019-2026)Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.7

Patterns on MicroserviceMicroservice architecture provides various patterns for developing high performing andscalable enterprise applications.Decomposition PatternsDecomposition patterns providevarious approaches on how theapplication should be broken intomultiple microservices based on thebusiness requirement such asdecompose by business capability,decompose by subdomain, selfcontained service, & service per team.Integration PatternsIntegration patterns suggest how themicroservice communication shouldhappen inside the application and fromthe presentation layer and help usprotect the microservices from any kindof vulnerabilities. In ACL digital, weanalyze the customer requirement andbased on that, we apply the rightintegration pattern for the smoothperformance of the application. Thevarious integration patterns are APIgateway pattern, aggregator pattern,client-side UI composition pattern, etc.Refactoring Monolithicto MicroserviceThere are patterns that allow theexisting monolithic application torefactor to multiple microservices.Some of the approaches for refactoringare strangler application,anti-corruption layer, etc.Database PatternsAs the microservices are moreindependent, it is very crucial to decidehow the database should be organizedfor microservices. The databasepatterns suggest various ways in whichwe can solve the databaserequirement for the microservices. Thevarious database patterns aredatabase per service, shared databaseper service, command queryresponsibility segregation (CQRS), andfinally, the saga pattern for maintainingthe atomicity of the transaction.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.8

Observability PatternsOne of the primary disadvantages ofmicroservices is that they aredistributed and autonomous, so it isvery difficult to address the commonfunctionality. Observability patternssuggest the various approaches likecentralized log aggregation, centralizedmetrics aggregation, distributedtracing, health check, etc. to solve thisissue.Concern PatternsWhen it comes to Microservices, thereare various cross-cutting concerns likeapplication configuration, serviceidentity, service reliability, etc. All theseconcerns can be addressedrespectively by using externalconfiguration, service discovery, circuitbreaker pattern, etc.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.9

Technology and ToolingVarious tools and technologies areavailable to implement and deploy anapplication using microservicearchitecture. We suggest you some ofthe best tools & technologies based onour experience in building cutting-edgeenterprise applications catering todiverse customer requirements. You willbe reading about some of them here.Docker SwarmIn case of microservices, containerorchestration is the key requirement ofteams aiming for rich performance andscalability. We suggest the below toolsfor container orchestrationDocker swarm is anotheropen-source containerorchestration platform usedextensively in orchestrating thedocker containers due to itseasy-to-use, high security andscalability features.KubernetesCI/CDContainer OrchestrationKubernetes (aka K8s) is theopen-source container orchestrationplatform used for automated softwaredeployment, scaling, & management. Itwas originally developed by Google, butCloud Native Computing Foundationmaintains the project now.Setting up the CI/CD pipeline forthe microservice basedapplications allows each team tobuild and deploy servicesindependently with no disruption ordependencies.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.10

JenkinsJenkins is the leading open-sourceautomation server that helps automatevarious SDLC processes, such asbuilding the source code to artifacts,testing, and deployment. It supportsmultiple build automation tools such asApache Ant, Apache Maven, MS Build,etc. Jenkins also supports varioussource control tools such as Git, CVS,Subversion, etc., allowing to run the shellscripts and Windows batch commands.GitLabIt’s the DevOps platform developed byGitLab Inc. GitLab allows to develop,secure, and operate software in a singleapplication. It was originally developed inRuby programming language & somemodules are rewritten in the Goprogramming language.Service DiscoveryIn microservice architecture, the wholeapplication is decomposed into multiplemicroservices so it is imperative that thecommunication between themicroservices is seamless. Serviceregistry and discovery are essential todiscover every microservice for smoothcommunication. There are various toolsavailable, but we recommend usingEureka!Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.11

Circuit BreakerAs the application is broken into multiple smaller microservices, most of the requestsneed communication to multiple microservices to process the response, but when oneof the services is down, it may result in the application getting stalled on request. Toaddress this issue, various circuit breaker tools are available that help stop theapplication from getting stalled by canceling the request for service that is notavailable and responding to the caller with the available information. The circuitbreakers that we recommend are Netflix Hystrix, and Spring Cloud circuit breaker.API GatewayAs the application is broken into multiple smaller microservices, it is very challenging tocall multiple services to provide the response, the API Gateway provides a single-entrypoint for all clients. The API gateway also helps in providing API analytics, APImonetization, API documentation, API limiting, Developer portal, API proxy, APIaggregation, etc. There are various frameworks and platforms available for APIgateway and we recommend using Kong API Gateway, Tyk API Gateway, and Ocelot.External ConfigurationA service normally calls other services, and the service in turn calls databases. Theendpoint URL or configuration properties might differ for each environment like Dev, QA,UAT, and Production. A shift in any of those properties might demand a re-build andre-deploy of the service, so it is necessary to avoid code modification for anyconfiguration changes.The ideal approach is to externalize all the configurations, including endpoint URLs andcredentials, so the application should load them either at startup or on trigger.Spring Cloud config server allows to externalize the properties to GitHub and loadthem as the environment properties. These can be accessed by the application eitherat startup or can be refreshed without a server restart by just triggers.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.12

Alternatively, Azure AppConfiguration acts as centralizedstorage of configuration values andprovides many additional featuresto make configurationmanagement easier. Azure KeyVault is the service from Azureallows storing microservicesconfiguration centrally. While AzureKey Vault may seem like areplacement for Azure AppConfiguration, it’s an addition to it.Distributed LoggingIn case of a microservice application, itconsists of multiple instances of aservice running on multiple machines,so the requests will be distributedacross multiple service instances. Everyindividual service instance generates alog file in a standardized format. So howwe trace the failure through logs whenit is distributed across multiple servicesfor any request is the key challenge.ELK StackThe ELK stands for threeopen-source projects–Elasticsearch, Logstash, & Kibana,which can be used to setup thecentralized logging & error tracing.Elasticsearch is a full-text searchand analytics engine. Logstash is alog aggregator that collects thelogs from multiple processes andstores the log into a centralized logstore which is, Elasticsearch. Andfinally, Kibana provides a userinterface, allowing users with thedashboard to visualize, search, andanalyze the log data throughvarious charts and graphs.These are independent toolsintegrated by Elastic and itprovides an end-to-end loganalysis solution.To address this issue, we first need acentralized logging service thataggregates logs from each serviceinstance so that the users can searchand analyze the logs and alsoconfigure alerts triggered when thereare certain errors spotted in the logs.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.13

Raising On AgilityAdopting scalable, agile, friendly, cloud native, containerized Microservices can helpenterprise transform their legacy monolithic to shifts in software development, tools,techniques, and frameworks. By having smaller independent modules, any changes inyour application can be rapidly developed and deployed with minimal effort.Using an agile process like Scrum helps the time bound development deliver in a shotspan of time and this is the perfect fit for the microservice based applicationdevelopment.ConclusionSatisfying the needs of any competitive enterprise is the never‐ending process ofadding new features while also maintaining existing functionality. Primary challengefor enterprises using Monolithic applications is that the cost of maintaining Monolithichas increased to the point that it no longer suffice skyrocketing enterpriserequirements. It is very difficult to modernize the monolith application.Moving forward, enterprises need an architecture that allows them to build andsustain the demanding competitiveness and efficiency that they seek for theminimum of the next 10 years.Microservices is the hot iron that addresses the problems we are facing with otherarchitecture. In ACL, we have built many successful projects and platform using theMicroservices architectural style, which allows our customers to stay ahead and thrivein the dynamic business landscape. Moving forward, this will be the default style forbuilding enterprise applications.Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.14

References https://sematext.com/guides/elk-stack/ -architecture-market#: :text et,18.6%25%20from%202019%20to%202026.ACL Digital is a design-led Digital Experience, Product Innovation, Engineering and Enterprise ITofferings leader. From strategy, to design, implementation and management we help accelerateinnovation and transform businesses. ACL Digital is a part of ALTEN group, a leader in technologyconsulting and engineering services.business@acldigital.com www.acldigital.comUSA UK France IndiaProprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital.All other company and product names may be trademarks of the respective companies with which they are associated.

-Sam Newman, Building Microservices. Proprietary content. No content of this document can be reproduced without the prior written agreement of ACL Digital. 6 Advantages of a Microservices Architecture Microservices architecture brings a lot of advantages to modern applications. Let us