moderator: we'd like to welcomechris elliott, solutions architect, to talkabout google cloud. chris elliott: thanks. glad to be here. so, fun story, when youget really close to time, there's an entire google possethat stands up in the corner and starts going likethis and walking closer. so that's a great counter. so we're going to talkabout google cloud platform
and how you can build games thatare scalable and will really be able to handle theload when you launch. so my name is chris elliott. i always like to startwith a terrible picture. and this one is actuallyone of my favorites, because it's in publicationsthat are commonly found in restroomsall over the world. so on my resumeliterally is a bullet that says "found on toiletsall over the world."
and it's a terrible photo. but as an architect, i workand help tidy up the platform to solve a lot of thereal world use cases that people are tackling--game developers specifically. so about that, basicallyfour sections here broken down into-- first just anoverview of the platform, make sure we're all on theexact same page in terms of the core fundamentalbuilding blocks there. and then really themeat and potatoes
of diving into some example,real world implementation the developers havebuilt, and also talk about in an idealworld, what you could build. so you can mix andmatch and choose what works best foryour use case here. so when looking at thegoogle cloud platform, we provide a variety of computeplatforms, storage services, and additional servicesto layer on top of that. and really, it's alittle bit confusing,
because there are alot of moving parts. and you're notquite sure which one is the best one touse for your use case. and so i hope by theend of this session, everyone here will understandsome potential ways of combining thesetechnologies to solve the really challengingproblems we face. and rest assured,you're not alone. we have a lot of customerswho are very happy in the game
industry buildingon our platform. and it's amazing,because usually you see a couple developersbuild something on it that scales and goesand doesn't crash. everyone kind ofpicks up on that, and you see google cloudplatform adoption just growing within companies. and here are acouple of examples. and you'll notice it goeseverywhere from small indie
studios all the way upto aaa game studios. we see everyone acrossthe board benefiting from the value andpower of the platform. and a couple examples, forexample, electronic arts, initially started withjust one mobile title. but its scaled-- it didn'tgo down, it didn't crash. it was a small dev team. it was ideal, and it madeeveryone else envious who was hammering away andmanaging our infrastructure.
and then now they'reusing it for a lot of their mobile applicationsthat they're building out, and you may recognizea few from here. another one-- actually. i found this out last gdc whenjust talking to epic games-- that they actually used appengine for "infinity blade ii," and the compellingsocial features there. it was really cooltoo, because it was done by just oneguy in about six weeks.
and that is a reallycompelling note, because if i was a developerand i had six weeks to build something i knewmillions of people were going to behammering, i would be on the edge of my seat. and luckily, it scaledup, and it handled. and it just worked. and it's just another oneof those example use cases where people arereally harnessing
the power of theplatform and using the right toolfor the right job. and so to look at a few ofthe few building blocks, really when building onthe google cloud platform, the two things youhave to choose about are whether you want to usecompute engine, app engine, how do i mix and match,and really what is the best toolfor my use case. so we'll start with computeengine, which there's
been a lot of excitementaround recently since we went ga in december. and with that, the core wayto describe the platform is it's virtual machines--open and flexible virtual machines that you canbring whatever software stack you want, and run thaton a linux machine and be good to go. and so bring yourdedicated game servers, anything that you want thatdoesn't quite necessarily fit
within the app enginecontainerized environment. it's a great fiton compute engine. and the next coupleof slides, there are really twopoints that i've seen be very compellingfor game developers. the first one isthe global network and the performanceof the network opens up newopportunities with respect to cloud gaming, and alsothe consistent performance.
not only is it a veryhigh performance system, every machine performsat a high level, so you can design dependingon those consistent benchmarks in the back end. and so with that,the first network-- the first point is really thenetwork that spans the globe. we have our ownprivate fiber network, and compute enginetaps into that. it's built ongoogle data centers.
and it really allowsyou to do things that you can't and havenever been able to do before on previous cloud platforms,just because you're running over google'sprivate fiber. one of the fun partsabout being inside google is you get to seebehind the scenes. there's a really classicvideo of inspecting one of our transatlanticfiber lines. and out of nowhere,a shark comes out,
bites onto the cable. and luckily, the cableis wrapped in kevlar and designed towithstand shark attacks. and it's reallycool to actually be able to go and see sharkattacks happening and knowing that your app'sstill going to go. although the fiber can withstandthat, if i was developer and i had a small littleoutage for 1% and it was due a shark attack, i would actuallybe much more comfortable
than, say, a go-tofail statement issue. i would much rather havea shark attack happening. but anyways, we get alot of press on platform. and people are really pickingup on what we're doing. this one quote in "wired"i absolutely love, because it summarizeeverything we're doing, and how we're exposinggoogle's history and experiencewith infrastructure to external developers to getin and harness that power.
and it really sums up asthe mother of all clouds. and yes, our data centersreally do look like that. there are some reallygreat pictures there. in one of them, you mighthave seen the easter egg with a stormtrooper in it. and i'm pretty sure thatexists there as well. but people are noticing this. i worked with edover at pa consulting on a bunch ofchrome jam projects.
one of them was-- actually,one was called chrome jam. and these are projectsby the chrome team. and this one wasbasically required very low latencyconnections so they could stream audiobetween four clients, and friends could just jam on,log in, choose an instrument, and just start jammingwith each other. and this quote wasstraight from them. they absolutely love thelatency that they were seeing.
it was low, much lower than theywere designing for elsewhere. and it actually allowedthem to launch successfully instead of having to scrap theproject because of latency. what does that actuallymean in numbers? well, here's a study that,although it's over a year old, these numbers just geteven better and better from this point on. and the coloring isaccidental of other, but it's fairly accurate per se.
but this is between tworegions, and what you can see-- and the really key thingis trying to highlight, as game developers, whatare the key metrics? latency-- we're looking atsignificantly lower latency that enables you to dothings that you haven't been able to do before acrossregional deployments, and also bandwidth. every instancewithin compute engine exists on a projectprivate network
and can communicate overan internal network. so you can literallycreate an instance in eu, create an instance in us, andsay, ping my european instance. and that's all overinternal private network. of course, you have to havefirewall ports open and all that, and we walkyou through that. but it's one of thepowerful features. and even instance creation--although it doesn't necessarily involve having afaster-performing instance,
the fact you can create aninstance and go to ssh into it, and it's almost always there,that is very compelling. i'm no longer just sittingaround waiting for my instances to be created. and it's great when you'respinning up 1,000 instances to meet with an unexpectedsurge in demand. and one last benchmark,just to kind of give you a sense and validate what we'retalking about here in terms of performance, is thismapr terasort record.
and there are two reasons ireally love this for gaming. one is the previousrecord was held on dedicated hardware intheir own data center. and we smashedthat record sorting a terabyte of data on acloud-based deployment. nobody would haveexpected cloud performance to exceed that of what theyhad on dedicated hardware. and you'll see that we used athird of the number of cores. and the other aspect is-- andthe reason this was possible--
is because of thatconsistent performance. you don't have a coupleof mapreduce nodes hanging around being slow, draggingthe entire job back down. everything spins up quickly,computes, shuts down. and that's why they'reable to smash that record. and for gaming, it's important. if you have 2%, 3%, 5% ofyour servers not performing correctly, you're going to have5% of your user base having a bad experience.
and this is one of the ways wecan help avoid that problem. so the other aspect-- and i'mnot spending a lot of time on it in this overview, becausea lot of people i talk to are already intimatelyfamiliar with app engine and understand what it provides. they may love it,or they may have not used it for otherreasons, such as wanting to run their own dedicatedgame server that doesn't work within the app engine container.
but i absolutelylove app engine. it scales tounbelievable heights. the developers i've workedwith that have built on it have been doing amazing thingswith extremely small teams-- easy to build, easy to scale. and if you're running inphp, go, java, or python, it's always great to evaluate ifit's a right tool for your job, or whether you needto leverage and add on other things suchas compute engine.
so that's really thehigh level overview, just trying to keep it brief. and i'll be aroundafterwards if you have more questionsabout those components. but really, i wanted tojump into some things that people areactually building, and what did it look like. so the first one is "song pop." how many people inthe audience have
played this game,out of curiosity? a few hands, so about80 million users played this game-- fairlysuccessful by app standards. and basically it'syou go in, and you compete against your friend forwho is the best at song trivia, do recognize this song, doyou recognize this title, do you recognize this artist? and so with that, this istheir daily active users. and i remember being involvedat about near the very beginning
of that hockey stick, andhearing about this app and how it wasgrowing massively. and then it justkept going and going, up until about 300 millionrequests per day-- and this is all backed by app engine--and three billion data store operations per day. and the most amazingthing about this is there's one back enddeveloper for this game. and he actually got to enjoyhis weekends off and sleep
at night. and they actuallyattribute app engine to be one of the reasonswhy they're successful, because instead of worryingabout their system scaling, having to maintain a nosqldatabase that is doing three billion rows, threebillion operations per day, instead they're able to focus onadding the features people are asking in order to keepthat hockey stick growing. and they absolutelylove the platform,
and have released theirnewest title on it as well called "movie pop"--which you can probably guess the spin on that,but it's also really cool. and so what doesthe architecture look like behind this? well, here's what it looks like. it's actually prettystraightforward. it's efficient, and it getsthe job done, and scales. and you'll notice i sayscale a lot during this talk,
but scaling really isthe heart of everything we try and do at google andexpose to all developers out there. and so the key aspect ofthis is the core game logic running on app engine instances. they're using python andhaving all those mobile device syncing into app engine, haveall the game logic there. for example, allthe user profiles are stored in data store.
all their songs,all their scores, all the playliststhey've played, all their friends storedin the data store. and so when you have80 million users, you need a nosqldatabase that scales up and can handle that load. and similarly,all of their songs are stored in cloud storage. so what happensis you'll request
to play a game with a friend. they'll get a push notification. and then you'll bothretrieve that data from cloud storage of allthe song samples, play, and then push the resultsback into app engine. and so it's fairlystraightforward, but it scales when youuse components right. and they're designedfor scalability in mind. and i'll talk a little bit moreabout the actual components
here in otherarchitectures as well. and another one thati was lucky enough to be involved withat the very beginning is "motorola spotlight stories." out of curiosity,how many people have moto x in the audience? and how many of you haveplayed the spotlight stories? and they're awesome, right? yeah, they'reabsolutely awesome.
a friend of mine reachedout at motorola an asked if i'd be interested in helpingout with some 20% project work. so i went over and talkedto the team at motorola, and i was blown away. because behind this doorwas this creative team that worked on so many ofmy favorite pixar movies. you had oscar-winningdirectors, you had the animator who animatedwoody in "toy story." everyone was therein the room, and i
had no idea what toexpect when i was just asked to come andhelp out with 20%. ironically, i had glass on,and it was still fairly new. and so i was both in shock,and they were both in shock, and we kind of had a moment. but they got an amazing creativeteam, spent a ton of time building their owncustom game engine and hiring amazing animators. everything here ishand-animated frame by frame.
and if you have a moto x, oryou know a friend with a moto x, just ask to borrow it. i'll always rememberin the office, we have a lot ofmoto x's at google. and everyone there isjust looking around, interacting in the world. and it's just anamazing experience and really cool stuff they did. but what does itactually look like?
well, here's thecore architecture. so on the moto x itself, theywrote their own native engine, opengl 3.0. some really great stuffthere to power the in-game, and it runs onandroid 4.4 kit kat. what's interesting thereis the actual java services they've implemented. and so all of the storyscripts and art assets are kept within cloud storage.
so what happens is yourdevice, about once a day, just checks in withapp engine, check and see if there'sany new content stories, anything at all. and if there is, it gets thatinformation from the datastore. and then app engine will returna signed url to the device that it can then download allof those assets to the phone. and similarly, on the cloud,you have the admin panel for adding new assets,adding new stories.
and that's the cloudplatform aspect. and the other interestingthing they're doing here is their engine service. i mean, this is perfectly timedafter the analytics session. and so they're using googleanalytics for everything to see how users areplaying, how many times are people playing it. if you actually playone of the movies, like "windy day"or "buggy night,"
you can follow along the storyand kind of interact with it. but if you justdetour off, there's all these really funnythings you wouldn't even notice are happeningunless you take your time. and you can get a sense forwhat people are looking at, what really excites people,what do they look at a lot. so that's thearchitecture behind that. and more than willing totalk about these later on, and there's lotsof architectures.
but we have 30minutes, so this is a whirlwind tour ofeverything great in cloud. so now we're going to talk aboutsome reference architectures here. and these really are,in an ideal world, what would the perfectimplementation look like on google cloud platform. and feel free to mix andmatch and choose whatever is best for your implementation,because there's no wrong way
to build when you use thetools you're familiar with and sprinkle in thetechnology that you know is going to be there foryou when your game grows. so the first onewe're looking at is gaming referencearchitecture, specifically with player versus player,intense multiplaying, low latency dedicatedgame servers. so the past two we talkedabout were more mobile focused, mobile device focused.
this is what i do when iget home for five hours until i can't stayawake anymore. and it's really about buildinga full-featured gameplay experience. so with these referencearchitectures, we like to pack up asample application as well, to show you that it's fairlystraightforward to get the bare bonesimplementation up and running so you can startsprinkling in custom logic.
and for that, about two yearsago at google i/o, we-- colt, actually-- developedthis game called "grits." and it was meant toshow html5, and having a whole bunch ofrobots running around on screen shooting each other. we took that as thecore gameplay element and sprinkled in theauto-scaling game cluster aspect. so essentially, what you have isthis core fun gameplay mechanic
requiring dedicated servers. and what we've added to it is awhole bunch of app engine logic for scaling up, scalingdown, maintaining status of all the clusters, and doingsome of the straightforward matchmaking logic. so what does thisactually look like? well, i apologize for the bigarchitecture diagrams to start. typically, i liketo reveal these. but then i feel bad, becauseeveryone in the audience
takes a picture, and the nextslide, ooh, there's more, takes a picture. and about eight slideslater, it's finally revealed. and so with this one--and the thing i really want you to focus onis down in the bottom, you'll see computeengine instances connected to mobile devices. and that is where the majorityof the gameplay of the player is going to happen.
it's just directly connectingto those instances, running the dedicatedgame servers, handling all those connections. but as you know,there's a lot more that it takes to actually makea game that players are going to come back to andthat they're going to have a great time with. and that's reallywhere app engine comes in as the brains ofbuilding a game type like,
a game like this. and compute engineis really the brawn of just running thededicated game servers. so with respect toserver matchmaking, memcache is low latency,in-memory caching. and you want to thinkabout, for example, keeping a list ofall your servers and their currentstats in memcache, so every single person wholooks for a server can instantly
get that back, and you're nottaking the cost of extra data center reads with respect tolatency and monetary value as well. another important thing as wellis processing in-game requests. if players havecustom configuration, they want to download thatdown to the game server. or if they want topurchase things, or if you want to keeptrack of kill/death ratios at the end of a match.
all of that can besent into app engine and stored within data store,and all of the player profiles that can be built up there,by relying on the data store and thatscalable technology. and you'll noticethat everything's going through thiscloud endpoints. and this is afantastic technology that provides restful apis,strongly-typed libraries, and authentication.
i had to do all of this beforecloud endpoints was available. and you kids these days,just have it so lucky. and cloud endpoints abstractsaway a lot of the complexities there. but if you want to use yourown authentication restful api system, feel free to sprinklethat in there as well. and the last aspect is thevirtual machine orchestration. and that really isscaling the cluster up and down with respectto demand and player load.
and there's actuallytwo things that make that greaton compute engine. one is we do minute billing. so if you need tospin up and burst and then terminatedown instances, you don't have toworry about, oh, i'm getting billed by the hour. how does my logic takeinto account that? you can justterminate an instance,
and you're only chargedfor what you used there. similarly, theconsistent performance that you're not going to havekeep an eye on your instances and find the ones thatare underperforming so you can go in andterminate those out. and so the final last aspectof this architecture, i swear, is the big data aspect of it. i know that's areally fuzzy term that has a lot differentways of looking at that
and slicing and dicing it. and just one example here is youhave all the game server logs, every single player action,everything people are doing, dumping that into a permanentstorage in cloud storage is easy. and it's really cheap tokeep it there long-term. and then you can start to dothings like mapreduce jobs over that to aggregate downto player actions per day, instead of everysingle player action.
and from there, you can pipeinto tools like bigquery that can do ad hoc, real-timeanalysis on billions of rows of data. and so there arethese tools that allow you to getreally great insights. and typically, what wefind is people start building on the left, getthe core gameplay working. and as they scaleand as they grow, they start to sprinklein more features.
and eventually,they're into bigquery, to actually understandand get insight into what's happeningwith their applications. and so one more referencearchitecture for you here-- and this is along themobile gaming one as well. and this is your typicalmobile gaming application with a complex backend, where you're supporting multipledevices, you're scalable to millions ofplayers, and you really
want to sprinkle in theengaging social aspects. and with that, we have anawesome sample application-- which, if you want to justthrow something out there in the app store, youcan download this, put it in the app storeor the play store, and see if you can get anyrevenue driving from it. it's actually full-featured,and pretty awesome to add more riddlesto it, et cetera. and so what this game is,it's called "griddler."
and essentially, it's kindof a player versus player, asynchronous game, whereyou get a riddle such as, what has to be brokenbefore it can be used? and you highlight, oh, egg. and so you highlight egg. and you're competingagainst your friend to go through all ofthese different riddles and get a score at the end. and so that asynchronousgame works really well
on app engine. we see a lot of peoplebeing very successful with that architectureand game type. and now you have agreat starting point available on both androidand ios to move quickly there and have a base implementationto start building on. and what does that look like? well, similar to what you sawfor "song pop," except we've added a little bit morein here with respect
to other componentsthat can drive value. and so we have ourios, android devices, through cloud endpointsto app engine. and one of the interestingthings we'll actually point out here is the task queuesand scheduled tasks and app engine back ends. if you've used ios pushnotifications, for example, you know they like you tomaintain sockets and not just open and closea million sockets.
so what you can dois have a back end-- a few back ends on appengine running continuously. and what they do isa pull/push request from the task cube,batch those together, and then push those overapple push notification, just so you can tap intowhat apple expects you to do with respect topush notifications, and harness thescalable components within app engine and thetask queues, et cetera.
and that's just one of the ways. and we actually havea sample for that as well, if you'reinterested in doing that. and the other aspect herethat's worth calling out is cloud storage, once again. and you don't have to choosebetween app engine or compute engine. it's really aboutpicking the best tool for what you're doing.
and so say you have anapplication where people upload pictures and video, and you wantto do some transcoding or image manipulation on that. you can upload thatthrough app engine, dump that into cloud storage. and then using taskqueues, you can actually orchestrate theprocessing of those videos with compute engine,whatever custom software you want to runon that, and then
put it back in cloud storageand send notifications back. there's lots offlexibility here, and a million different waysto combine these components and really pick what worksbest for your use case and application. and so just to quickly wrapit up here, what we've seen is really-- sorry for thecropping at the very top, not quite sure whathappened there. but we've seen google is thebest place for developers.
from aaa to indiestudios, we love seeing what people arebuilding on the platform. if you have anything greator you're thinking about it, please talk to us. we'd love to hear from you. you'll see there'sa couple of google employees in the audience. and they may be headsdown on laptops. apologies for that--it's performance review
season at google, andeveryone's a little bit stressed out about that. but we're more thanhappy to talk to you and put our laptops away. and with that aswell, we have papers talking about thereference architectures. and we also have thosesample applications. if you just google anywords that come to your mind from this session, you'llprobably find them.
otherwise,cloud.google.com, the papers are all there togo in and look at. otherwise, our github accounthas the samples on it. and this link here is toa prettier github version that has a littlebit more readable. but you'll also find everythingon the cloud github account. i guess i'll leavethat up for one more minute, given the pictures here. but if you just search forwhatever's on your mind,
you'll find it. i've done it a million times. and so lastly, thisone you'll actually really want totake a picture of. and this is a really cool deal. it is $2,000 in cloud credits. basically, go to--wow, that qr code became giant on that screen. that's taller than i am.
but go there, enter in theform, enter in a project id. and you'll get $1,000of app engine credits, which will take youquite a long ways, and also $1,000 incompute engine, which you can go very far on,especially if you turn down your instance and takeadvantage of minute billing. i've seen people buildsome amazing systems and run a quick test, ok,tear down the instances, change things for now.
and then run another quicktest, tear down the instances. great options therefor maximizing the use case of these credits. and that's basically it. i realize there's noq&a, but thank you. and i'll be around if youhave any more questions.
source
0 comments:
Post a Comment