Joe Sondow, Netflix @joesondow #gr8conf The Grails App ...

43
Joe Sondow, Netflix @joesondow #gr8conf The Grails App that Deploys Netflix to the Cloud GR8Conf Europe 2012 June 6th-8th Copenhagen, Denmark // Feed your brain gr8.technologies.each{ yourBrain << it }

Transcript of Joe Sondow, Netflix @joesondow #gr8conf The Grails App ...

Joe Sondow, Netflix @joesondow #gr8conf

The Grails App that Deploys Netflix to the Cloud

GR8Conf Europe 2012June 6th-8th

Copenhagen, Denmark

// Feed your braingr8.technologies.each{ yourBrain << it}

Slides onlinehttp://slideshare.net/joesondow

@joesondow #gr8conf

AgendaWho am I? Why am I here?

Asgard, Screen shots

Netflix, Freedom and Responsibility

Regional URLs

Cloud Deployment Model

Offline Development

Why not the AWS Console?

Who am I?

@joesondow #gr8conf

Who am I?Joe Sondow

Netflix since 2010

Asgard lead

Grails

jQuery

@joesondow #gr8conf

Why am I here?

@joesondow #gr8conf

Sell you something

Discuss business plans

Answer technical questions

Be a smaller fish in AWS

Give back to community

Steal your engineers

Why am I here?

AsgardScreen shots

AsgardApplication list

AsgardAuto Scaling Group list

AsgardCluster deployment, ready for fast rollback

AsgardCloud deployment

Cloud management

Started 2010

Open source in 2012

Follow @NetflixOSS

100’s of Jira tickets

Actively developed

Asgard TeamJune 2012 (The dolphin writes integration tests)

Jason Gritman @jgritman

Joe Sondow @joesondow

Clay McCoy @claymccoy

With more than 25 million streaming members in the United States, Canada, Latin America, the United Kingdom and Ireland, Netflix, Inc. (NASDAQ: NFLX) is the world's leading internet subscription service for enjoying movies and TV programs.

(from http://ir.netflix.com)

Freedom and Responsibility

Freedom and ResponsibilityCloud SOA

100’s of services

Small teams

Independent releases

Controlled chaos

Regional URLsLet’s see some code

Regional URLsCloud object URLs were unique, conventional, intuitive

Default Grails URL mapping is excellent

Regional URLsLater, Netflix needed to use multiple Amazon regions

Regional URLsRegion is another URL dimension

Add URL mapping, but don’t break existing links

Regional URLs

RegionService.groovy (excerpt)

Regional URLsSome controllers should never be regional

RegionService detects RegionAgnostic annotation

Cloud deployment modelApplications and Clusters

Cloud deployment model

Auto Scaling Group

Launch Configuration

Security Group

Amazon Machine Image

Instances

Elastic Load Balancer

Cloud deployment modelStreaming Starts

Autocomplete API

Sign Up

Ratings

Search

ApplicationApplication

ApplicationApplication

Application

Application

Inventing the ApplicationProblem:

Application is not an Amazon concept

Solution:

Create an Application domain in SimpleDB

Enforce naming conventions on Amazon objects

Fast RollbackOptimism causes outages

Production traffic is unique

Keep old version running

Switch traffic to new version

Monitor results

Revert traffic quickly

Fast Rollback

api-usprod-v007

api-frontend

api-usprod-v008

Inventing the ClusterProblem:

Two ASGs with one function but different names

Solution:

Append version number in reserved format

Parse ASG name to determine long-term “cluster”

Inventing the Cluster

api

api-usprod

api-usprod-v007

api-usprod-v008

Application

Cluster

Auto Scaling Group

Auto Scaling Group

Instead of keeping a database in sync, use naming conventions to store the source in truth in Amazon’s API

Offline DevelopmentMakes on a plane

Offline DevelopmentMock data

Mock behavior

System property switch offline=true

Mock Datahttp://asgardprod/us-east-1/autoScaling/list.json

Mock DataParse JSON

Mock BehaviorOverride Amazon Java client methods

System Propertygrails run-app -Doffline=true

Why not the AWS console?No, not to keep me busy

Why not the AWS console?

Why not the AWS console?Hide keys

Customize model

Enforce conventions

Automate workflow

Log changes

Integrate systems

Create REST API

@NetflixOSShttp://techblog.netflix.com Open source announcement...

Thank youQuestions?

@joesondow slideshare.net/joesondow linkedin.com/in/joesondow

@NetflixOSS