Upload
tech-in-the-middle
View
1.251
Download
0
Tags:
Embed Size (px)
Citation preview
Google App EngineDay of Cloud
October 16, 2009
1Monday, October 19, 2009
About Me
Don Schwarz
Software Engineer
2
2Monday, October 19, 2009
Overview
• Problems with scalable web applications
• What is Google App Engine?
• Let’s Play a Game
• How much does it cost?
• Q/A
3
3Monday, October 19, 2009
Challenges of Building Web Apps
4
4Monday, October 19, 2009
Easy to start. Easy to scale.
5
5Monday, October 19, 2009
It’s all included!Hardware
ConnectivityOperating System
Web ServerLanguage RuntimesSoftware Services
Fault-toleranceLoad balancing
SSL Support
6
6Monday, October 19, 2009
Key Features
• No need to install or maintain your own stack
• We do the scaling for you
• Use Google’s scalable services
• We charge only for actual usage
–Always free to get started
• Built-in application management console
• Tool integration (IDE plugins, etc.)
7
7Monday, October 19, 2009
Incoming Requests
App Engine Front End
App Engine Front End
App Engine Front End
AppServer AppServer AppServer
Load Balancer
AppServer
API Layer
Other Google Infrastructure
- Bigtable
- Google Accounts
- Memcache
- Image manipulation
App App App
Architecture
8
8Monday, October 19, 2009
9
Service Google Infrastructure
Authentication Google Accounts
Datastore Bigtable
Caching Custom memcache implementation
E-mail Gmail gateway
URLFetch Caching HTTP proxy
XMPP Google Talk infrastructure
Images Picasa Web Photo Infrastructure
Software Services
9Monday, October 19, 2009
Web Hooks
• Receiving XMPP
• Receiving Email
• Scheduled Tasks (cron)
• Task Queue (offline processing)
• Google Wave Robots
10
10Monday, October 19, 2009
Restrictions
• No threads
• No direct network connections
• ... but URLFetch & SDC
• No direct file system writes
• ... but Datastore and Memcache
• No subprocesses or native code
• “Safe” subset of runtime environment
• 30 seconds per request, 10MB limit
11
11Monday, October 19, 2009
Java• Java 6 VM (with Hotspot)
• Full Servlet 2.5 Container
• HTTP Session support
• JSP support
• Services integrate with common Java Standards
• JDO/JPA for Datastore API
• JSR 107 for Memcache API
• javax.mail for Mail API
• java.net.URLConnection for URLFetch API
• IDE integration: Eclipse, IntelliJ, NetBeans
12
12Monday, October 19, 2009
Python• Python 2.5.2
• CGI environment, provided by WSGI module
• Web frameworks
• webapp - Minimal built-in framework, based on WebOb
• Django 0.96 is built-in, can deploy 1.0 or 1.1
• App Engine Launcher (Mac & Windows)
• Easy access to edit, test, and deploy applications
13
13Monday, October 19, 2009
Datastore
14
• Datastore is:
• Transactional
• Natively Partitioned
• Hierarchical
• Schema-less
• Based on Bigtable
• Datastore is not:
• A relational database
• A SQL engine
14Monday, October 19, 2009
Interesting Datastore Modeling
• Ancestor
• Multi-value properties
• Variable properties
• Heterogenous property types
15
Kind Person
Entity Group /Person:Ethel
Key /Person:Ethel
Age Int64: 30
Hobbies String: Tennis
Kind Person
Entity Group /Person:Ethel
Key /Person:Ethel/Person:Jane
Age Double: 3.5
PetsKey:/Turtle:Sam
PetsKey:/Dog:Ernie
15Monday, October 19, 2009
Datastore Transactions• Transactions apply to a single Entity Group
• Global transactions are feasible
• get(), put(), delete() are transactional
• Ancestor queries are transactional
16
/Person:Ethel/Person:Jane
/Person:Ethel
/Person:Max
Transaction
16Monday, October 19, 2009
Testing Locally• “Development AppServer”
• Emulates production environment
• Enforces many of the same restrictions
• Local implementation of software services
• Disk-based datastore
• In-memory LRU memcache implementation
• Simple URLFetch implementation
17
17Monday, October 19, 2009
Deploying to the Cloud• Application is available at:
• yourapp.appspot.com, or
• a custom domain
• Command-line and IDE-based tools
• Admin Console
• Dashboards, Data Viewer
• Request and diagnostic logs
• Billing
18
18Monday, October 19, 2009
Code Walkthrough
19Monday, October 19, 2009
http://java-demo.appspot.com
20Monday, October 19, 2009
21
Resource Provided Free Additional Cost
CPU 6.5 hours/day $0.10/hour
Bandwidth In 1GByte/day $0.10/GByte
Bandwidth Out 1GByte/day $0.12/GByte
Stored Data 1 GB $0.005/GB-day
Emails sent2000/day to users
50000/day to admins$0.0001/email
Quotas and Billing
21Monday, October 19, 2009
Quotas and Billing: Estimates
• Will always be free to get started
• ~5 million pageviews/month free
• Pay only for what you use
• 10-20 million pageviews/month for$20-30/month
• Payment via Google Checkout
•X-AppEngine-Estimated-CPM-US-Dollars
22
22Monday, October 19, 2009
Questions?
23Monday, October 19, 2009
Resources• Speaker
• Don Schwarz ([email protected])
• Google App Engine
• http://code.google.com/appengine
• Google Group
• http://groups.google.com/group/google-appengine
24
24Monday, October 19, 2009
Backup Slides
25Monday, October 19, 2009
Does it scale?
http://whitehouse.gov/openforquestions26
26Monday, October 19, 2009
Secure Data Connector
27
27Monday, October 19, 2009
Demo - Login
28
28Monday, October 19, 2009
Demo - Question
29
29Monday, October 19, 2009
Demo - Question Result
30
30Monday, October 19, 2009
Demo - Scoreboard
31
31Monday, October 19, 2009