google app engine - devfest india 2010

Post on 06-May-2015

4.724 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Intro to Google App Engine, Google's cloud computing platform. Presented at Devfest India 2010 Hyderabad andPune.

TRANSCRIPT

Google Confidential and Proprietary 1

Google App Engine

Feb – March, 2010Patrick ChanezonDeveloper AdvocateGoogle Developer Relationschanezon@google.com

Monday, March 8, 2010

Agenda

-App Engine introduction-Why build it?-App Engine tour-What's different?-Wrap up-Questions

2

Monday, March 8, 2010

Isha Upanishad

3

4. The spirit is unmoving, one, swifter than the mind. The senses do not reach It as It is ever ahead of them. Though Itself standing still It outstrips those who run. In It the all-pervading air supports the activities of beings

Monday, March 8, 2010

Vayu computing?

4

Public domain image from http://commons.wikimedia.org/wiki/File:Vayu.jpg

Monday, March 8, 2010

Vayu Computing?

5

7−10 Then they said to Vayu (Air): "O Vayu! Find out who this great Spirit is." "Yes," he said, and hastened to It. Brahman asked him: "Who are you?" He replied "I am known as Vayu; I am also called Matarisva." Brahman said: "What power is in you, who are so well known?" Vayu replied: "I can carry off all−whatever there is on earth." Brahman put a straw before him and said: "Carry this." He rushed toward it with all his ardour but could not move it. Then he returned from the Spirit and said to the gods: "I could not find out who this Spirit is,"

Kena Upanishad

Monday, March 8, 2010

PlacePostage H

ere

6

IaaSPaaSSaaS

What is cloud computing?

Monday, March 8, 2010

IaaS value proposition…

7

Monday, March 8, 2010

IaaS value proposition…

7

Monday, March 8, 2010

IaaS value proposition…

7

Monday, March 8, 2010

IaaS value proposition…

7

Monday, March 8, 2010

Google App Engine

8

“We wear pagers so you don’t have to”

pager

Monday, March 8, 2010

Google App Engine

-Easy to build-Easy to maintain-Easy to scale

9

Monday, March 8, 2010

By the numbers

- Built 100K apps- Maintained by 250K developers- Scaled to 250M pageviews daily

10

semi-transparent collage of apps

Monday, March 8, 2010

gigya Socialize

11

Monday, March 8, 2010

gigya Socialize - traffic

12

Monday, March 8, 2010

gigya Socialize - traffic

12

Monday, March 8, 2010

Gigya Socialize - traffic

13

Monday, March 8, 2010

App Engine

14

Monday, March 8, 2010

App Engine

15

Monday, March 8, 2010

Time.com

16

Monday, March 8, 2010

Socialwok

17

Monday, March 8, 2010

Social networking at scale

18

Monday, March 8, 2010

Social networking at scale

18

>40M Users

Monday, March 8, 2010

PubSubHubbubhttp://code.google.com/p/pubsubhubbub/

19

The future is distributed: There will be big hubs, many small hubs, and tons of publishers and subscribers.

Publishers, subscribers, and hubs may play multiple roles.

Monday, March 8, 2010

Hell's Kitchen on facebook

20

Monday, March 8, 2010

Handling peak traffic: mental_floss

21

Monday, March 8, 2010

Elastic / redundant capacity

22

Monday, March 8, 2010

Short term events: earthhour.org

23

Monday, March 8, 2010

http://www.allforgood.org/

24

Monday, March 8, 2010

http://www.snapabug.com/

25

Monday, March 8, 2010

エコポイント

26

Monday, March 8, 2010

Japan: Q&A for our Future

27

Monday, March 8, 2010

http://www.google.com/tipjar

28

Monday, March 8, 2010

Chillingo CrystalGaming meets Social

Cogs

Guerilla Bob

Zombie Dash Angry Birds LITE underground Meltdown

Mission Deep Sea Speed ForgeExtreme

Ravensword:The Fallen King

Angry Birds

Monday, March 8, 2010

Why build it?

30

Wrench

Monday, March 8, 2010

It's just too difficult

31

Monday, March 8, 2010

Hosting means hidden costs

• Idle capacity• Software patches & upgrades• License fees• Lots of maintenance• Traffic & utilization forecasting• Upgrades

32

Monday, March 8, 2010

Cloud development in a box

33

• SDK & “The Cloud”• Hardware• Networking• Operating system• Application runtime

o Java, Python• Static file serving• Services• Fault tolerance• Load balancing

Monday, March 8, 2010

Distributed Cloud ComputingReliability and scalability

Monday, March 8, 2010

Know your Distributed Memes

-Divide & conquer -Sharding-Tolerate / expect failure- Idempotency-Just scale it up

35

Monday, March 8, 2010

Rocket scienceMonolithic Computing

36

Monday, March 8, 2010

Rocket scienceMonolithic Computing

36

Hot spare“Just in case”

Monday, March 8, 2010

Distributed Meme:Expect, tolerate and design for failure

37

MTFB: O(Years)

Monday, March 8, 2010

Distributed Meme:Expect, tolerate and design for failure

37

MTFB: O(Years)

Monday, March 8, 2010

Distributed Meme:Expect, tolerate and design for failure

37

MTFB: O(Months)

MTFB: O(Years)

Monday, March 8, 2010

Distributed Meme:Expect, tolerate and design for failure

37

MTFB: O(Months)

MTFB: O(Years)

Monday, March 8, 2010

Distributed Meme:Expect, tolerate and design for failure

37

MTFB: O(Months)

MTFB: O(Years)

MTFB: O(Minutes/Seconds)

Monday, March 8, 2010

Monolithic computing

38

stop watchsmall

stop watchlarge

Monday, March 8, 2010

Distributed web hosting platform

39

Monday, March 8, 2010

Distributed web hosting platform

39

X

Monday, March 8, 2010

Distributed web hosting platform

39

XRetry

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical / horizontal scalability

40

Monday, March 8, 2010

Vertical scalability

41

Monday, March 8, 2010

Vertical scalability

41

Horizontal scalability

Monday, March 8, 2010

Vertical scalability

41

Horizontal scalability

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Tolerate, plan for and expect small failures

Monday, March 8, 2010

Easy to deploy & scale

43

http://www.yourdomain.com/

1

2

Monday, March 8, 2010

Thinking about scalability

....the tools, platform and design don't matter too much

Just a few users....

44

Monday, March 8, 2010

Thinking about scalability

....you must design for scalability

Lots and lots of users...

45

Monday, March 8, 2010

But the problem is...

When?

http://digg.com/http://slashdot.org/

46

Monday, March 8, 2010

The real problem is...

When it happens.

Can you afford to puteverything else on hold?

47

Monday, March 8, 2010

Google App Engine

Leveraging Google'splatform to better serveyour customers

48

Monday, March 8, 2010

Distributed web hosting platform

49

Monday, March 8, 2010

Distributed web hosting platform

50

-Great for web apps• Request based, data backed

-Parallel processing-Scales automatically-Available globally-Configuration free-Built-in DoS protections

Monday, March 8, 2010

Distributed datastore

51

Monday, March 8, 2010

Distributed datastore

52

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling-Parallel processing

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling-Parallel processing-Scales to 'Internet scale'

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling-Parallel processing-Scales to 'Internet scale'-Predictable query performance

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling-Parallel processing-Scales to 'Internet scale'-Predictable query performance-No deadlocks

Monday, March 8, 2010

Distributed datastore

52

-Arbitrary horizontal scaling-Parallel processing-Scales to 'Internet scale'-Predictable query performance-No deadlocks-No global schema

Monday, March 8, 2010

Distributed memcache

53

Memcache

Monday, March 8, 2010

Distributed Meme: Divide & ConquerSpecialized services

54

BlobstoreImages

Mail XMPP Task Queue

Memcache Datastore URL Fetch

User Service

Monday, March 8, 2010

Distributed Meme: Sharding

Single Sharded

55

Counter CounterCounter Counter

Monday, March 8, 2010

Distributed Meme: Sharding

Single Sharded

55

Counter CounterCounter CounterCounter

Monday, March 8, 2010

Distributed Meme: Sharding

Single Sharded

55

Counter CounterCounter CounterCounter CounterCounter

Monday, March 8, 2010

Language runtimes

Duke, the Java mascotCopyright © Sun Microsystems Inc., all rights reserved.

56

Monday, March 8, 2010

JVM languages

-Scala-JRuby (Ruby)-Groovy-Quercus (PHP)-Rhino (JavaScript)-Jython (Python)

57

Monday, March 8, 2010

Ensuring portability

58

Monday, March 8, 2010

Ensuring portability

58

Monday, March 8, 2010

Complete Java development stack

59

Monday, March 8, 2010

Google Plugin for Eclipse

60

Monday, March 8, 2010

Google Plugin for Eclipse

61

Monday, March 8, 2010

Google Web Toolkit (GWT)

62

Monday, March 8, 2010

Google Web Toolkit (GWT)

IE

Firefox

SafariChrome

Opera

63

Monday, March 8, 2010

GWT Debugging in the browser

64

Monday, March 8, 2010

Quotes to remember

“The fastest code is thatwhich does not run.”

Joel WebberGWT co-creator

65

Monday, March 8, 2010

Google's scalable serving architecture

Google Apps + your apps

Your custom applicationsOur Google Apps

66

Monday, March 8, 2010

Google Apps integration

http://appid.appspot.com/

http://yourapp.yourdomain.com/

67

Monday, March 8, 2010

2. Log in to your Google Apps domain as an admin

68

Monday, March 8, 2010

3. Accept terms and specify web address

69

Monday, March 8, 2010

4. The new feature is available in your control panel

70

Monday, March 8, 2010

5. Additional configuration is available for each feature

71

Monday, March 8, 2010

Google Apps + App Engine

72

Monday, March 8, 2010

Federate your on-premise data

73

Monday, March 8, 2010

Secure Data Connector (SDC)

74

Monday, March 8, 2010

Secure Data Connector

75

Monday, March 8, 2010

Secure Data Connector

and 50+ more...

76

Monday, March 8, 2010

Using Secure Data Connector

77

Monday, March 8, 2010

Using Secure Data Connector

Installation- Determine access rules- Configure and install SDC

77

Monday, March 8, 2010

Using Secure Data Connector

Installation- Determine access rules- Configure and install SDC

Getting ready to serve- SDC opens SSL tunnel

77

Monday, March 8, 2010

Using Secure Data Connector

Installation- Determine access rules- Configure and install SDC

Getting ready to serve- SDC opens SSL tunnel

Serving- User request sent to App Engine- User authenticated- App makes request through tunnel- SDC performs access checks- Results returned

77

Monday, March 8, 2010

Database export / import

78

Monday, March 8, 2010

Cron support

- clean-up DB- prepare reports - batch mail

- perform calcs- call mom

79

Monday, March 8, 2010

<?xml version="1.0" encoding="UTF-8"?><cronentries>  <cron>    <url>/recache</url>    <description>Repopulate the cache every 2 minutes</description>    <schedule>every 2 minutes</schedule>  </cron>  <cron>    <url>/weeklyreport</url>    <description>Mail out a weekly report</description>    <schedule>every monday of month 08:30</schedule>    <timezone>America/New_York</timezone>  </cron></cronentries>

("every"|ordinal) (days) "of" (monthspec) (time)

every 5 minutesevery 12 hours2nd,third mon,wed,thu of march 17:00every monday of month 09:001st monday of sep,oct,nov 17:00

Cron support

80

Monday, March 8, 2010

Distributed Meme: Divide & ConquerTask Queues

81

Brett SlatkinMay, 2009

Offline Processing onApp Engine: A Look Ahead

Task 12 Task 67 Task 42 Task 2 Task 91 Task 16 Task 7

Monday, March 8, 2010

Tasks Queues - Motivation

• Why do background processing? oDo work continuously without user requestso Incrementally process data, compute resultsoSmooth out load patterns, lower user latency

• Simple idea in general:1.Describe the work you want to do now2.Save the description somewhere3.Have something else execute the work later

• Work executed in the order received (best-effort FIFO)• If execution fails, work will be retried until successful

Task 12 Task 67 Task 42 Task 2 Task 91 Task 16 Task 7

Monday, March 8, 2010

Task Queue Benefits

• BenefitsoAsynchronous

Why do work now when we can do it later?o Low-latency (for users)

Tasks are light-weight; ~3x faster than DatastoreoReliable

Once written, a task will eventually complete oScalable

Storage of new tasks has no contentionParallelizable with multiple workers

• Many features can extend this basic concept

Task 12 Task 67 Task 42 Task 2 Task 91 Task 16 Task 7

Monday, March 8, 2010

How do traditional task queues work?

Monday, March 8, 2010

How do traditional task queues work? (2)

• Polling has problems:oWorker sits in a loop polling the front of the queue

Not event driven; wasted work oWorkers stay resident when there's no work to do

Wastes machine resourcesoFixed number of workers

Admins must manually add more workers to keep up or queue will grow without bounds

• Limited optimization possible

oMany systems fake a polling interface with something event-driven under the hood

o Long-lived, hanging connections

Monday, March 8, 2010

How does our Task Queue API work? (2)

Monday, March 8, 2010

How does our Task Queue API work? (3)

Monday, March 8, 2010

Your application's health

88

Monday, March 8, 2010

App Engine's health history

89

Monday, March 8, 2010

creative commons licensed photograph from cote

Scalable serving architecture

90

Monday, March 8, 2010

Distributed frontends

91

Monday, March 8, 2010

Distributed frontends

-Edge Caching

91

Monday, March 8, 2010

Distributed frontends

-Edge Caching-Priority routing

91

Monday, March 8, 2010

Distributed frontends

-Edge Caching-Priority routing-Geographically close

connection endpoint91

Monday, March 8, 2010

Life of a request

UserApp

EngineFrontend

App'sRuntime

92

Monday, March 8, 2010

Life of a request

UserApp

EngineFrontend

App'sRuntime

93

Monday, March 8, 2010

Scales dynamically / automatically

UserApp

EngineFrontend

App'sRuntime

User

UserUser

User

94

Monday, March 8, 2010

Scales dynamically / automatically

App'sRuntime

App'sRuntime

UserApp

EngineFrontend

App'sRuntime

User

UserUser

User

95

Monday, March 8, 2010

Multiple versions

UserApp

EngineFrontend

Version 1.1

Version 2.1

Datastore

http://2.1.fredsa.appspot.com/

http://fredsa.appspot.com/

96

Monday, March 8, 2010

Distributed datastore

http://labs.google.com/papers/bigtable.html97

Monday, March 8, 2010

Bigtable :A distributed, sharded, sorted array

 Row key    Row data

98

Monday, March 8, 2010

Shard 1

Shard 2 . .

Shard n

Bigtable :A distributed, sharded, sorted array

 Row key    Row data

99

Monday, March 8, 2010

Datastore design

-Distributed-Bigtable + entity groups-ACID transactions-Optimistic concurrency-Entities + indexes-Protobuf encoded entities

100

Monday, March 8, 2010

Datastore properties

-Core value types-List properties-Text & binary blobs-Reference

101

Monday, March 8, 2010

What's different?

102

Monday, March 8, 2010

Datastore - what's new

-Distributed-Scales to 'internet scale'-No deadlocks-Predictable query performance

103

Monday, March 8, 2010

Datastore - what's different

-No inner/outer/natural joins-Dense index scans-Per entity metadata-Soft schema-No more DDL

104

Monday, March 8, 2010

Datastore - what's familiar

- Indexes-ACID transactions-GQLSELECT * FROM StoryWHERE title = 'App Engine Launch'AND author = :current_userAND rating >= 10ORDER BY rating, created DESC

105

Monday, March 8, 2010

The new ACID

AssociativeCommutativeIdempotentDistributed

AtomicConsistentIsolatedDurable

106

Monday, March 8, 2010

Entities

107

Monday, March 8, 2010

Entity groups

108

Monday, March 8, 2010

Amortizing costs

Customer Order

Count(COUNT)

SUM(Order Amount)Transaction

CreateUpdateDelete

109

Monday, March 8, 2010

An evolving platform

110

Monday, March 8, 2010

Apr 2008 Python launchMay 2008 Memcache, Images APIJul 2008 Logs exportAug 2008 Batch write/deleteOct 2008 HTTPS supportDec 2008 Status dashboard, quota detailsFeb 2009 Billing, larger filesApr 2009 Java launch, DB import, cron support, SDCMay 2009 Key-only queriesJun 2009 Task queuesAug 2009 Kindless queriesSep 2009 XMPPOct 2009 Incoming emailDec 2009 BlobstoreFeb 2010 Datastore cursors, Async Urlfetch

23 months in review

111

Monday, March 8, 2010

- Support for mapping operations across datasets

- Alerting system for exceptions in your application

- Datastore dump and restore facility112

App Engine Roadmap

Monday, March 8, 2010

Wrap up

113

Monday, March 8, 2010

Always free to get started

~5M pageviews/month• 6.5 CPU hrs/day• 1 GB storage• 650K URL Fetch calls/day• 2,000 recipients emailed• 1 GB/day bandwidth• 100,000 tasks enqueued• 650K XMPP messages/day

114

Monday, March 8, 2010

Purchase additional resources *

* free monthly quota of ~5 million page views still in full effect115

Monday, March 8, 2010

Thank you

Read morehttp://code.google.com/appengine/

Contact infoPatrick ChanezonDeveloper Advocatechanezon@google.comhttp://twitter.com/chanezon

Questions?

116

Monday, March 8, 2010

ThanksTo Alon Levi, Fred Sauer, Brett Slatkin and others for their slides

Monday, March 8, 2010

top related