International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
![]()
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
Hariom Sharma1, Dr. Nagaraj Bhat2
1Student, Department of Electronics and Communication engineering, RVCE, Bengaluru, Karnataka, India
2Assistant Professor, Department of Electronics and Communication engineering, RVCE, Bengaluru, Karnataka, India ***
Abstract - Web based application or desktop based application has quite distinctive requirements as that of mobile based applications moreover with the evolution in technologies and tools, and the constant shift in end users' requirements, the overall process to serve both mobile and work station based applications using same back end micro services has also complicated over times. Amidst individual teams working on their corresponding interfaces of front end application, it requires anexclusivenarrowingat theback end to detail the development if it fails to meet the requirement of the application. So this complexity is a kind ofloopholefurther any misalignment and error can cause atrocious experience for the end users. This paper focuses on overcoming these challenges and improve the user experience.
Key Words: API, API gateway, Monolithic, Request, Response .
Earlier most of the application were targeted to meet requirementofdesktopwebUI.Tomeettherequirementof webuserinterfacebackendserviceswasmadeinparallel.As thetechnologyevolvedbackendservicesareusedtoserve bothweb andmobileusers.Buttherequirementsofdesktop userinterfacearedifferentfromtherequirementofmobile userinterfaceasscreensize,performance,anddisplaydiffer. Any changes done in the backend services to meet the requirementofauserinterfacewillimpacttheworkingof otherUIandduetothisconflictingrequirementthereare separateteamsfordifferentinterfacesworkingonashared backend which results in unnecessary use of resources, efforts and money. To get rid of this tight coupling, additional layer for different user interface is developed between backend and frontend which act as a gateway betweenfrontendandbackend.
Aneffectivewayistoidentifythebusinessboundariesfirst thenseparatetheAPIgatewayonthisbasisandutilizean API gateway per client. As allocation of multiple API gateways,oneperclientwillhelptofulfilldemandsofeach client.Thisprocedureiscalledthe“back endforfront end” or BFF pattern. Decoupling of frontend and backend eliminatesthechancesofconflictingupgraderequirements and helps to improve performance, reliability and consistency
[1]gavedetailedanalysisondecisionsmodelsforchoosing patterns and approaches when it comes to selecting microservicesarchitecture.Detailedanalysisondecisionin microservicesmodelspatternselectionandstrategieswas done. It also identified that there is still a lack in terms of havinganaptdecisionmodelsthatcanbeusedtoleverage patterns and strategies as employable comprehension to haverelevantdesigninmicroservicesbasedsystems.They furthernarroweddowntofourdecisionmodelwhichcould beusedbasedupontherequirements.
[2] gave detailed analysis on DevOps, cloud and virtualization as an important factors in the microservice ecosystemandgaveanalysisontheroleofthesefactors.It alsocoveredtheareasinwhichresearchonmicroservicesto be conducted. It also explored the relationship of microservices with Service Oriented Architecture and Domain driven design which are highly used to develop microservices. It also identified that to overcome the hardwarelimitationcontainerizationasaneffectivemethod apartfromspeedingupthedeliveryprocess.
[3]gaveadatadrivenapproachtocomparemicroservices and monolithic architectures. There are many reports, researchpapersandstudieswhichcontradictsoneanother when it comes to making a comparison between microservicesarchitectureandmonolithicarchitecture.Soa detailedcomparisonisbeingdiscussedandkeyperformance isbeinganalyzed.Whilecomparingtheloadtestingscenario both architectures performed almost equally well. And in concurrencytestingscenariosmonolithicshowedenhanced performance in terms of latency. Additionally examining microservices applications built with distinct services discovery techs such as Eureka and Consul showed that applicationsbuiltwithConsulhavebetterthroughput.
[4]highlightedAPIgatewayastheoneofkey componentfor theworkingofapplication.ItgavedetailedanalysisonAPI gatewaymanagementforamicroservicebasedarchitecture. ItalsogaveanalysisonthecommonfunctionsAPIgateway bypasses which is needed in the microservices and also summarized the certain interior implementation and interface of the system as the exclusive entrance for microservices.
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
They further wind up by giving a latest resolution for the obstructions in managing API gateway, flow control and reverseproxyfunction,APIgatewaygivesresolutiontothe issue of how a client can be designated to an exclusive serviceandhenceenhancingthedevelopmentcompetence.
[5] highlighted the evolution of cloud computing in information technology domain and a lot has has been changedandimprovedwhenitcomestofollowstandards, rules and regulations. They gave analysis about how microservicesarchitectureisthepreferredandaptchoice foron demandmemory,horizontallyandverticallyscalable, flexible,elastic,andrapidlyevolvingcloudapplications.They followedsystematicmappingstudyformicroservicestofind outthecurrenttrendsrelatedtomicroservices.
SomeofthedrawbacksofasingleAPIgatewayare: ď‚·
It'snotaneffectiveandefficientapproachofhavinga single API gateway that handles the requests and responds to all microservices for various user interface. Because this has a tendency to make API gatewayserviceinflatedovertimewhichinturncan makeitinflexibleormonolithic.
ď‚·
Single API gateway acts as single point of entry and failureinitwillbringtheentiresystemdown.
ď‚·
A single API Gateway also impacts the speed and reliability of the system since all the device users requestgoestosameAPIgatewayandresponsealso comesfromthesamegateway
ď‚·
Oneofthemostprincipaldrawbacksisthatwhenan APIgatewayisimplemented,thenthatparticulartieris beingcoupledwiththeinternalmicroservices.Andthis might lead to some challenging difficulties for the applicationwithpassageoftime.
ď‚·
AlongwithAPIGatewayanadditionalnetworkcallalso occurs which in turn can cause increased response time.But,thisadditionalcallhaslessimplicationsthan havingaclientinterfaceasthisclientinterfacedirectly callsmicroservices.
ď‚·
APIGatewaymustbescaledoutproperlyifnotthenit canactasabottlenecktoderailtheprogressmadein caseitfailstomeetapplication’s requirements.
ď‚·
In microservices based applications, the user interface usuallyconnectswithmultiplemicroservices.Andthistype of interaction can become complex if having many microservices.Thesemicroservicescouldbeinvokedwhich inturnmakesinteractionmorecomplex.Sotheremightbe a need to process scissoring concerns in an exclusive or inter medialplace.ThisiscorrectplacetouseAPIgateway. APIgatewayservesasanalternateproxybetweenbackend microservices and client applications. The requests initiating from the client apps to the corresponding microservicesarebeingredirectedbyAPIgatewayandat thesametimeitmanagesthescissoringfeatures(reliability, safety,loggingandcaching).
Byaggregationofnumerousmicroservices,delayorlagcan alsobereduced.Thismethodissuitableforexclusiveclient systems.
There are possibilities of having development obstructionincaseAPIGatewayisbeingdevelopedby anexclusiveteam.
To improve and enhance user experience, BFF plays an important role. Regardless of the platform the frontend applicationisrunningon,itgivesseamlessuserinteraction whichisonethemainadvantagesofBFFpattern.Itconsists of multiple backends to address the requirements of differentfrontenduserinterface,likedesktop,browser,and native mobileapps.Itenhancestheoverallperformanceof thesystemasthebrowserresourcesareutilizedefficiently. Itallowsusertohaveaseamlessinteractionasthereare welldefinedAPI’sforspecificuses.
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
expenses,production,performance,cache,memory,security etc).Comparingthesetwoworkinglanguage:
Itishighlyappropriatewhenthereisalimitationin termsofCPU.
Java has been in the industry for quite so long now and it comes with huge potential for mathematical computationandothers.It hasquitedevelopedIDE and remote debugging features has its own advantages. ď‚·
Asimplesolutiontothisistocreateaintermediatelayerfor alltypesofuserinterfaceanddependingontheneedsofthe user interface write the logic in the BFF layer. It can be optimizedregularlyasperourrequirementsaseverytypeof interfaceisconnectedtoaspecificBFFlayer.Itisfasterthan a single API gateway which is shared by all kinds of interfaces. It allows interface team flexibility in terms of languageselectionwhileimplementingtheBFFlayerforany interface
The user interface layer contains the essential logic to suitably organize the data coming from the backend microservicesasthedatadeliveredbybackendmaynotbe structured or filtered as per the requirement of user interface.Implementingthislogicintheuserinterfacelayer has a damaging effect on system’s performance as it consumesalotofbrowser’sresourcesandeventuallyaffects performanceofsystem.
BFF layer doesn’t run on browser’s server so the logic executed in the BFF layer doesn’t take up browser’s resources.Totakeadvantageofthis,thelogicimplemented inuserinterfacelayerpreviouslyismovedtoBFFlayer.So, whentheuserinterfacecallsanAPItoretrievethedata,the callfirstgoestotheintermediatelayerandtheintermediate layerinvokestherelevantbackendmicroservices.Thedata transferredbythebackendmicroservicesispassedtoBFF layer where data is formatted or filtered as per the requirementoftheuserinterface.BFFlayerformobileand webUIusersaredifferentandallthe layersareconnected tosamebackendservices.
Implementationisdecidedbasedonseveralfactors.Thereis not an absolute solution for this. Generally either Java or NodeJsisbeingpreferred.Mostlyit'sbasedonthetechnical stack ofthe organization, skill setof employees,andwhat enhancements are being focused on like(development
Java runsasanexclusiveprocessbasedonthreads. Thisthreadisresponsibleformanagingeachrequest.
Itishighlyappropriatewhenthereisalimitationin termsofIO.
Itprovidesfeaturesthatminimizescomplexityandat thesametimeenhancesdevelopmentspeed.
NodeJsworksononeprincipalthreadwhichinturn utilizes background threads for tasks. Here the principal/headthreadisresponsibleforchangingall your data so it cut short the issues like threading, locks&consistencyofdata
Because of the asynchronous performance of NodeJs it is beingsaidthatitisquitefasterbutJavaisalsonotbehind. Bothasynchronousandnon blockingthingscanbedoneata time with the spring reactor after choosing the correct server(TomcatNIOorotherserversdevelopedontopofthe NIOconnector).
Fig 3 :AverageresponsetimeindifferentUIs
International Research Journal of Engineering and Technology (IRJET)
e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
Figure 3showsdifferentuserinterfaceaverageresponse time before and after the implementation of BFF when frontend calls to backend services. For android users averageresponsetimeis3secondsbeforeBFFlayerwas introducedinthesystemanditimprovedby1secondafter theimplementationofBFF.Similarlyforiosusersaverage response time improved by 750 milliseconds and for desktop web users it improved from 5 seconds to 3.75 seconds before and after the implementation of BFF respectively.
Fig 5 :BFFAnti patternFanOut ď‚·
Fuse:Anyfailureinthemicroservicesthatrespondsto requests of multiple BFFs can bring down the whole system.Fig 6showsfailureinthemicroserviceswhich will impact all the users who want to access microservices.
Fig 4 :SuccessfulrequestsfordifferentUIs
Figure 4 shows total number of successful requests when 10000requestsaremadetobackendservicesforeachuser interface before and after the implementation of BFF. For androidusers thenumberofsuccessfulrequestsincreased from7645to8324beforeandafterimplementationofBFF. Similarlyforiosuserstotal numberofsuccessfulrequests increased from 7913 to 8637 and for desktop web users successfulrequestsincreasedtoaroundfrom7362to8012.
ItisevidentthataBFFlayerhasmanyadvantagesbutit’s important to know about the challenges before implementingBFF.Theseare: 
Fan Out: A breakdown of the single service will impact the users who have the same type of device interface to access backend microservices. Fig 5 representsbreakdownintheBFFlayerforwebusers whichaffectsalltheuserswhousesdesktopbrowser.
Fig 6 :BFFAnti patternFuse ď‚·
Duplication and Lower Reuse: The cost of development will be more since there will be deployment of multiple BFFs having similar capabilitieswithdifferentteams.Fasterresponsetime and increased consistency may decree this interruption.
Resolve issue of Fan out: Fault isolation needs to be implemented as there shouldn't be any exclusive correspondingserviceswhichBFFsynchronizesthatwould takeitdownentirely.Preferablyeachandeveryposterior services will have their own termination point of BFF for eachmodule.Thiswillhighlyimproveavailabilityandfault isolationwithalittlecostintermsofincreasednumberof deployments. Between all downstream components if we needinteractionandcoordinationthenwehavetorethink
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
thecauseofsplittingeachcorrespondingserviceasinwhen tosplitcomponents.
Rectifyfuses: Inordertoresolvethisweneedadedicated servicetoeachBFFinterface.Thepossibilityofdedicating services is only feasible if corresponding services do not needtoshareadatabasebecauseinthatcasethedatabase itselfwillbecomeafuse.Henceforthifaservicerequiresa databasethenitispreferabletohaveseparatedeployments toenhanceavailability.Incasedatabasesareneededbythe service then there will be technical debt that will be only partiallyremediatedbyeliminatingfanout.
Reuse: Dependingupontheimplementationthisproblem mayormaynotoccur.Howeveriftherearepossibilitiesthat there could be overlapping of functionalities between differentmodulesthereitispreferabletoensurethatteams are recognising larger efforts which should be shared. If these larger requirements are implemented in reusable libraries it will help to lower down the development expenses and at the same time there will be reduction in timetomarketforotherfeatures.
Multiplication: In the above points we have already discussed if the teams own their services via the service lifecycleandexecuteseasierreleasesandcommunications usingautomationthenitwillrectifyalltheproblemsoflarge numberofdeployableservices.
BackendForFrontendisdesignpatterncreatedtoimprove theuserexperience.Withtimeeveryapplicationneedstobe upgradedastherequirementsofcustomerschangesrapidly. So,BFFasanintermediatelayerisanefficientwaytosolve varioususerinterfaceconflictingupgraderequirementsand alsoprovideconsistencytotheapplication.Thesmallersize, extensibilityandre usabilityofmicroservicesarchitectures addscalability,flexibilitypowertodevelopmentaswellas operationsteam.Thispaperfocusesonproblemsdevelopers face while working on a single API gateway and how multiple gateway helps to tackle the challenges and problemsdevelopersmightfaceandhowdifferentlanguage canbeusedtoimplementtheintermediatelayerdepending upon the requirements of user interface and backend microservices.
[1] Muhammad Waseem, Peng Liang, Aakash Ahmad, Mojtaba Shahin, Arif Ali Khan, Gastón Márquez “Decision ModelsforSelectingPatternsandStrategiesinMicroservices SystemsandtheirEvaluationbyPractitioners”in202244th International Conference on Software Engineering (ICSE) SEIPTrack,2022
[2] Mohammad Sadegh Hamzehloui, Shamsul Sahibuddin, andArdavanAshabi“AStudyontheMostProminentAreas
ofResearchinMicroservices”in2019InternationalJournal ofMachineLearningandComputing,2019
[3]OmarAl Debagy,PeterMartinek“AComparativeReview ofMicroservicesandMonolithicArchitectures”in201818th IEEE International Symposium on Computational IntelligenceandInformatics,2018
[4] J T ZHAO S Y JING and L Z Jiang “Management of API gateway in microservices architecture” in 2018 IOP ConferenceSeries:JournalofPhysics,2018
[5] Hulya Vural, Murat Koyuncu, and Sinem Guney “A Systematic Literature review on Microservices” in 2017 InternationalConferenceonComputationalScienceandIts Applications,2017
[6] H. M. Ayas, P. Leitner, and R. Hebig. 2021. Facing the giant: A grounded the ory study of decision making in microservicesmigrations.InProc.ofthe15thACM/IEEEInt. Symp.onEmpiricalSoftwareEngineeringandMeasurement (ESEM).ACM,1 11
[7]R.Chen,S.Li,andZ.Li“FromMonolithtoMicroservices: A Data flow Driven Approach,” in 2017 24th Asia Pacific SoftwareEngineeringConference(APSEC),2017.
[8] Tan Yiming. Design and Implementation of Platform Service Framework Based on MicroserviceArchitecture [D].BeijingJiaotongUniversity,2017.
[9] Tan Yiming. Design and Implementation of Platform ServiceFrameworkBasedonMicroserviceArchitecture[D]. BeijingJiaotongUniversity,2017.
[10]S.Li,H.Zhang,Z.Jia,Z.Li,C.Zhang,J.Li,Q.Gao,J.Ge, andZ.Shan.2019.Adata ow drivenapproachtoidentifying microservices from monolithic applica tions. Journal of SystemsandSoftware157(2019),110380.
[11] R. Matt. 2020. Security Patterns for Microservice Architectures. https://tinyurl.com/zs85z9as accessed on 2021 07 05.
[12] M. Villamizar, “Cost comparison of running web applicationsinthecloudusingmonolithic,microservice,and AWSLambdaarchitectures,”Jun.2017.
[13] N. Dragoni, I. Lanese, S.T. Larsen, M. Mazzara, R. Mustafin, and L. Safina. 2017.Microservices: How to make yourapplicationscale.InProc.ofthe11thInt.AndreiErshov MemorialConf.onPerspectivesofSystemInformatics(PSI). Springer,95 104.
[14] H. Harms, C. Rogowski, and L. Lo Iacono. 2017. Guidelinesforadoptingfrontendarchitecturesandpatterns in microservices based systems. In Proc. of the 11thJoint Meeting on Foundations of Software Engineering (ESEC/FSE).ACM,902 907.
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056
Volume: 09 Issue: 06 | Jun 2022 www.irjet.net p ISSN: 2395 0072
[15]S.HaselböckandR.Weinreich.2017.Decisionguidance modelsformicroservicemonitoring.InProc.ofthe14thInt. Conf. on Software Architecture Workshops(ICSAW). IEEE, 54 61.
[16]S.Haselböck,R.Weinreich,andG.Buchgeher.2017.De cisionguidancemodelsformicroservices:Servicediscovery andfaulttolerance.InProc.ofthe5thEuropeanConf.onthe EngineeringofComputer BasedSystems(ECBS).ACM,1 10.
[17] P. Raj, H. Subramanian, and A. C. Raman. 2017. Architectural Patterns: UncoverEssential Patterns in the Most Indispensable Realm of Enterprise Architecture. PacktPublishingLtd.
[18]G.A.Lewis,P.Lago,andP.Avgeriou.2016.Adecision model for cyber foragingsystems. In Proc. of the 13th WorkingIEEE/IFIPConf.onSoftwareArchitecture(WICSA). IEEE,51 60.
[19] Balalaie,Armin, Abbas Heydarnoori, and Pooyan Jamshidi. Microservices architecture enables DevOps: migration to a cloud native architecture. IEEE Software, 2016.33(3)42 52.
2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal