Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf

上传人:聆听****声音 文档编号:57495 上传时间:2023-04-28 格式:PDF 页数:311 大小:4.15MB
下载 相关 举报
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第1页
第1页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第2页
第2页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第3页
第3页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第4页
第4页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第5页
第5页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第6页
第6页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第7页
第7页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第8页
第8页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第9页
第9页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第10页
第10页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第11页
第11页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第12页
第12页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第13页
第13页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第14页
第14页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第15页
第15页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第16页
第16页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第17页
第17页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第18页
第18页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第19页
第19页 / 共311页
Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf_第20页
第20页 / 共311页
亲,该文档总共311页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf

《Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf》由会员分享,可在线阅读,更多相关《Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf(311页珍藏版)》请在冰点文库上搜索。

Python Microservices Development_ Build efficient and lightweight microservices using the Python tooling e.pdf

PythonMicroservicesDevelopmentSecondEditionBuildefficientandlightweightmicroservicesusingthePythontoolingecosystemSimonFraserTarekZiadBIRMINGHAMMUMBAIPythonMicroservicesDevelopmentSecondEditionCopyright2021PacktPublishingAllrightsreserved.Nopartofthisbookmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,withoutthepriorwrittenpermissionofthepublisher,exceptinthecaseofbriefquotationsembeddedincriticalarticlesorreviews.Everyefforthasbeenmadeinthepreparationofthisbooktoensuretheaccuracyoftheinformationpresented.However,theinformationcontainedinthisbookissoldwithoutwarranty,eitherexpressorimplied.Neithertheauthor(s),norPacktPublishingoritsdealersanddistributors,willbeheldliableforanydamagescausedorallegedtohavebeencauseddirectlyorindirectlybythisbook.PacktPublishinghasendeavoredtoprovidetrademarkinformationaboutallofthecompaniesandproductsmentionedinthisbookbytheappropriateuseofcapitals.However,PacktPublishingcannotguaranteetheaccuracyofthisinformation.Producer:

ShaileshJainAcquisitionEditorPeerReviews:

SabyDSilvaProjectEditor:

RiannaRodriguesContentDevelopmentEditor:

AlexPattersonCopyEditor:

SafisEditingTechnicalEditor:

KaranSonawaneProofreader:

SafisEditingIndexer:

RekhaNairPresentationDesigner:

PranitPadwalFirstpublished:

July2017Secondedition:

September2021Productionreference:

1280921PublishedbyPacktPublishingLtd.LiveryPlace35LiveryStreetBirminghamB32PB,UK.ISBN978-1-80107-630-ContributorsAbouttheauthorsSimonFraserisaSiteReliabilityEngineerforCiscoMeraki.Hehasovertwentyyearsofexperienceincomputing,bothdevelopingandrunningsystems.HehasworkedasaSystemsAdministratorforaninternetserviceprovider;aninfrastructureandhigh-performancecomputingengineerattheWelcomeSangerInstitute,andasaFirefoxReleaseEngineeratMozilla.HestudiedCyberneticsandComputerScienceattheUniversityofReadingandhasalsotaughtacademiccoursesinprogrammingforscientists.IwouldliketothankEmmaAptedandHelenCookfortheirfrequentsupportandencouragement,rangingfromproofreadingtomimingabookopeningwhenImclearlynotworking.MyfatherGeorgeFraserpassedonhisimmeasurableskillatfinishingaprojectjustbeforethedeadline,andmymotherElizabethFrasershowedmehowtoexplainconceptsandinformpeoplethroughyearsofteaching.ThisbookwouldalsonotbepossiblewithoutTarekZiadsworkonthe1steditionandthesolidbaseonwhichtobuild,aswellastheworkofDevelopmentEditorAlexPatterson,ReviewerWilliamKahn-Greene,andProjectEditorRiannaRodrigues.Wemightstandontheshouldersofgiants,butwealsobuildonahugestructuremadebyeveryoneofus,soIwouldalsoliketothankeveryoneIveworkedwithovertheyearsinallmydifferentteams.Yes,evenyou.TarekZiadisaSoftwareEngineer,locatedinBurgundy,France.HeworksatElastic,buildingtoolsfordevelopers.BeforeElastic,heworkedatMozillafor10years,andhefoundedaFrenchPythonusergroup,calledAFPy.TarekhasalsowrittenseveralarticlesaboutPythonforvariousmagazines,andafewbooksinFrenchandEnglish.IwouldliketothankFreya,Suki,Milo,andAminaforbeingsosupportiveofallmybookprojects.AboutthereviewerWillKahn-GreenehasbeenbuildingthingsinPythonandotherlanguagessincethelate90s.HemanagesthecrashingestionpipelineatMozillaandmaintainsseveralPythonlibraries.WhenheswaitingforCItoruntests,hebuildsthingswithwood,tendshistomatoplants,andcooksforfour.vTableofContentsPrefacexiChapter1:

UnderstandingMicroservices1Theoriginsofservice-orientedarchitecture2Themonolithicapproach3Themicroserviceapproach8Microservicebenefits10Separationofconcerns10Smallerprojects10Scalinganddeployment11Pitfallsofmicroservices12Illogicalsplitting12Morenetworkinteractions13Datastoringandsharing13Compatibilityissues14Testing14ImplementingmicroserviceswithPython15Howwebserviceswork16TheWSGIstandard16Workers,threads,andsynchronicity17Aworkerpoolapproach17Beingasynchronous18Twisted,Tornado,Greenlets,andGevent19AsynchronousPython19Languageperformance21Summary24TableofContentsviChapter2:

DiscoveringQuart25MakingsurewehavePython27HowQuarthandlesrequests28Routing32Variablesandconverters33Theurl_forfunction37Request37Response38Quartsbuilt-infeatures40Thesessionobject40Globals41Signals42Extensionsandmiddleware44Templates46Configuration48Blueprints50Errorhandling52Customerrorhandler52Amicroserviceskeleton54Summary57Chapter3:

Coding,Testing,andDocumentation:

theVirtuousCycle59Differentkindsoftests62Unittests63Functionaltests67Integrationtests70Loadtests71End-to-endtests75Usingpytestandtox76Developerdocumentation80Toolsfordocumentation81Versioncontrol85ContinuousIntegrationandContinuousDeployment86GitHubActions87Documentation88Coveralls89Badges89Summary90TableofContentsviiChapter4:

DesigningJeeves91TheJeevesbot92Userstories92Monolithicdesign93Model94Viewandtemplate97Ahuman-readableview100Slackworkspaces103Takingactions107OAuthtokens108Authenticationandauthorization109Backgroundtasks113Puttingtogetherthemonolithicdesign116Summary118Chapter5:

SplittingtheMonolith119Identifyingpotentialmicroservices119Codecomplexityandmaintenance121MetricsandMonitoring122Logging128SplittingaMonolith131FeatureFlags135RefactoringJeeves137Workflow139Summary140Chapter6:

InteractingwithOtherServices141Callingotherwebresources142Findingoutwheretogo145Environmentvariables145Servicediscovery145Transferringdata146HTTPcacheheaders147GZIPcompression149ProtocolBuffers152MessagePack153Puttingittogether155Asynchronousmessages155Messagequeuereliability156Basicqueues156TableofContentsviiiTopicexchangesandqueues157Publish/subscribe161Puttingittogether162Testing162UsingOpenAPI164Summary165Chapter7:

SecuringYourServices167TheOAuth2protocol168X.509certificate-basedauthentication170Token-basedauthentication173TheJWTstandard174PyJWT176UsingacertificatewithJWT177TheTokenDealermicroservice179TheOAuthimplementation180UsingTokenDealer184Securingyourcode186Limitingyourapplicationscope187Untrustedincomingdata189Redirectingandtrustingqueries192Sanitizinginputdata193UsingBanditlinter194Dependencies195Webapplicationfirewall195OpenResty:

Luaandnginx196Rateandconcurrencylimiting199OtherOpenRestyfeatures201Summary202Chapter8:

MakingaDashboard203BuildingaReactJSdashboard205TheJSXsyntax205Reactcomponents206Pre-processingJSX211ReactJSandQuart212Cross-originresourcesharing213Authenticationandauthorization215AnoteaboutMicroFrontends216GettingtheSlacktoken218JavaScriptauthentication220Summary221TableofContentsixChapter9:

PackagingandRunningPython223Thepackagingtoolchain224Afewdefinitions225Packaging226Thesetup.pyfile226Therequirements.txtfile231TheMANIFEST.infile234Versioning235Releasing238Distributing239Runningallmicroservices242Processmanagement243Summary245Chapter10:

DeployingonAWS247WhatisDocker?

248IntroductiontoDocker251RunningQuartinDocker255Docker-baseddeployments257Terraform259Servicediscovery261DockerCompose263DockerSwarm265Kubernetes267Summary272Chapter11:

WhatsNext?

275Automation275Scaling276ContentDeliveryNetworks277Multi-clouddeployments277LambdaFunctions277Expandingmonitoring278Makingpromises278Summary280OtherBooksYouMayEnjoy283Index287xiPrefacePythonMicroservicesDevelopmentintroducesthedesignandcreationofamicroservice-basedapplicationusingthepopularPythonprogramminglanguage,andtheQuartwebframework.Inthisbook,youwilllearnaboutmicroservicearchitectureandhowitdiffersfromthetraditionalmonolithicapproach,whatthebenefitsare,aswellaspotentialtroublethatneedsovercoming.WhothisbookisforThisbookisforpeoplefamiliarwiththefundamentalsofthePythonprogramminglanguagewhowanttostartwritingwebservices,orwhohaveinheritedawebservicetheywanttomodernize.ItisexpectedthatthereaderwillbefamiliarwithsimplePythonstructuressuchasfunctionsandloops,aswellassomemoreadvancedfeaturessuchasdecorators.Somefamiliaritywithusingwebapplicationswouldbehelpful,althoughthefundamentalsofapplicationdesignarecovered.WhatthisbookcoversChapter1,UnderstandingMicroservices,introducestheconceptsbehindmicroservices,thedifferencesbetweenmonolithicapplicationsandmicroservices,commonbenefitsandpitfalls,aswellastestingandscaling.Chapter2,DiscoveringQuart,coverstheQuartwebframeworkandthewaysinwhichitcanrespondtorequests,createtemplateddocuments,actasmiddleware,handleerrors,andreadconfiguration.PrefacexiiChapter3,Coding,Testing,andDocumentation:

theVirtuousCycle,teachesyouaboutthedifferenttypesoftestingthatarepossible,whatbenefitseachtypehas,andhowtosetupautomatictesting,aswellasgeneratingdocumentationinCIpipelines.Chapter4,DesigningJeeves,looksatJeeves,whichisthesampleapplicationweuseinthisbooktoexplainthevariousconceptsbehindmicroservices.WeintroducewhatweneedJeevestodoanddescribeamonolithicapproachtoapplicationdesign,coveringthewebAPIinterface,databaseuse,andworkerpools.Chapter5,SplittingtheMonolith,buildsonthemonolithicJeevesdescribedinpreviouschapter.Thischapteroffersguidanceonhowtoidentifycomponentsthatmaybegoodmicroservices,measuringtheeffectsofchangesonthesoftwarearchitecture,andhowtocleanlymigratefeaturestonewmicroservices.Chapter6,InteractingwithOtherSer

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2