1、MicroservicesFrom Winning the WarTo Keeping the PeaceBackgroundA bit about Andrews work. Many different domains Trading & risk systems PhD on software components Riot Games Hulu2MicroservicesWork!But make sure you prepare for the challenges.31. Microservices in Gaming2. Microservices for Video3. Bel
2、ieve the Hype4. Believe the Challenges41.Microservices inGamingA microservice architecture scaleLeague of Legends ScaleGaming Particulars Low latency Need to match up players = shared state Rapid development cycles Lots of engineers working on 1 game81A.Winning the WarEvolving from a monolith9Evolvi
3、ng the Architecture 2009: Large service monolith Matchmaking, game selection, inventory etc 2012: Started evolving to microservices http:/bit.ly/evolving-league10League of LegendsFront End BoxMatchmakingGame Server Mgrplatform.warplatform.warplatform.warDistributed in-memory cacheMySQL11Microservice
4、s for New FeaturesPlatformMatch MakingServiceProxy / APIplatform.wartb.jarCacheDistributed in-memory cacheMySQLMySQL12Standard InfrastructureClient of ServiceServiceMetricsMetricsClient RESTlibraryS/W LoadBalancerServer RESTlibraryHTTP ServerRESTSWAGGERDashboardsService DiscoveryConfig Service131B.K
5、eeping the PeaceHeld back by remains of themonolith14Not Quite Free of the Monolith.PlatformMicroserviceInventoryStatsSummoner detailsCacheDistributed in-memory cacheMySQLMySQL15Ouch - Hitting the Wall16If We Could Redo? Decouple state completely Inventory service Catalog service Runes service Socia
6、lize to get prioritization Simplify infrastructure Config System too “clever” Too much “smarts” in fat libraries172.Microservices forInternet VideoHundreds of tiny pieces.Hulu 2016: Full microservices architecture Evolved / replaced existing VOD architecture Live TV 20m+ total subs 1m+ live subs 15
7、month development! 800+ microserviceshttp:/bit.ly/hulu-landscape19Video System Particulars Lots of caching to support browsing TV show metadata needed everywhere Real-time playback to support live TV Lots of integration (billing, ads etc)20Infrastructure for MicroservicesDonki PaaSDNSGithubJenkinsLo
8、adBalancersAppsStatsdGraphiteProvisioning SystemMySQLClusterVMsRedisCluster21Microservice OwnershipPlayback teamBrowse team Recording teamEtc.22Data Distribution PatternReadingCacheCacheCacheCachePub-sub /read-throughMasterIngestion + Admin23Scaling for Launch DayBrowse Queries Per SecondCollege kid
9、s falling asleepwith XBOX on!2B.Keeping the PeaceEvery issue gets magnified.25Arch / Ops DashboardLoginBrowse & Search PlaybackAdsDVR etc26Scaling For Growthhttp:/bit.ly/hulu-scaling27Circuit Breakers avoid FirestormsA B CXYZ28Cross-Cutting Requirements29Cloud versus DC Could target cloud or DC But
10、no elasticity, must overprovision Abstracting cloud & DC= Lowest common denominator Hard to do proper blue-green in DC303.Believe the HypeThe many benefits of microservices31They Actually Work! Ownership & Independence Development velocity Operational & Development scaling32They Actually Work! Granu
11、lar deployment Evolution Organizational alignment334.Believe the ChallengesStanding on the shoulders ofconstantly improving infrastructure.34Common CICD + Operating EnvBuild + CICDRuntime InfraDeploy &RollbackJenkinsSpinnaker / HarnessTerraformK8s, istioStackdriverOperational InfraCloud!35Cloud Appr
12、oachPreferred approach Pick one cloud provider (per workflow?) Consider costs early Multi-region, multi-account on day 1Cloud has so many advantages over DC Elasticity Easy environments (blue-green) Better shared services (db, queues etc)36Circuit Breakers by Default!API GatewaysGatewayAPI DocsEnvoy
13、ServiceService38PlatformsFor things that need holistic treatment but still allow self-service Load testing Billing Browse caching A / B testing UI layout39TakeawaysMicroservices offer many benefits Isolation & independence Granular deployment, scaling & evolutionUse infra to protect against common issues Full CICD Infrastructure as code Circuit breakers to prevent firestorms Istio to help with monitoring + more Cloud elasticity FTW40Thanks for Listening!41