资源描述:
《微服务和云原生应用.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、微服务和云原生应用ElvisZhangSpringCloudGetAPlatform,ButAvoidBuildingYourOwn“CloudPlatform”isthesystemthatmanageseverythingfromtheinfrastructureup,defineshowapplicationsarepackagedanddeployed,defineshowservices(likedatabases,identity,queues,etc.)areprovided,andprovidescapabilitie
2、storun,monitor,andotherwiseoperateinproduction.Anddon’tforgetthatyoumaywantthebenefitsofmulti-cloudportability—tomoveyourapplicationstowhatevertypeofinfrastructureyouwant—private,public,dedicated,“real”cloud,orjustplainoldvirtualization.GetAPlatform,ButAvoidBuildingYour
3、OwnAreyouinthebusinessofbuildingplatformsorbuildingthesoftwarethatrunsyourbusiness?You’regoingtoneedahighlyautomatedcloudplatformthatsupportstheentireapplicationlife-cycle—development,QA,staging,production—andthattaskislikelybestlefttoathirdparty(orecosystem).Usingaclou
4、dplatformwillalsoforceyoutofollowarchitecturalCloudNativediscipline,likefollowingthe12factorappguidelinesandbreakingupyourapplicationintomicroservices.Remember,thisstuffisproventowork,butifyoudeviatefromthestandardCloudNativepractices,yourmileagemayvary.TheCloudNativeAr
5、chitecture:WhatyouneedtobecloudnativeThepracticesofatwelve-factorapplicationCodebase:Onecodebasetrackedinrevisioncontrol,manydeploysSourcecoderepositoriesforanapplicationshouldcontainasingleapplicationwithamanifesttoitsapplicationdependencies.Thereshouldbenoneedtorecomp
6、ileorpackageanapplicationfordifferentenvironments.Thethingsthatareuniquetoeachenvironmentshouldliveexternaltothecode.Codebase:Onecodebasetrackedinrevisioncontrol,manydeploysSourcecodeisbuiltonceanddeployedtoeachenvironmentDependencies:Explicitlydeclareandisolatedependen
7、ciesApplicationdependenciesshouldbeexplicitlydeclared,andanyandalldependenciesshouldbeavailablefromanartifactrepositorythatcanbedownloadedusingadependencymanager,suchasApacheMaven.Twelve-factorapplicationsneverrelyontheexistenceofimplicitsystemwidepackagesrequiredasadep
8、endencytoruntheapplication.Alldependenciesofanapplicationaredeclaredexplicitlyinamanifestfilethatcleanlydeclar