4. Key Features
• No need to install or maintain your own stack
• Use Google scalable services via standard APIs
• Built-in application management console
• Google does the scaling for you
• Pay-as-you-go, with free quota to get started
4
Sunday, May 9, 2010
5. Key Limitations
• No native code
• No threads or sockets
• No writing to the filesystem
• No relational database
• No more than 30 seconds per request
5
Sunday, May 9, 2010
6. Dev AppServer
• Local implementation of services
– LRU memcache
– Disk-backed datastore
– HttpClient-backed URLFetch
• Emulates the production environment
– Sandbox restrictions may be inconsistent,
so run tests on production servers as well
6
Sunday, May 9, 2010
7. Deployment
• Your app lives at
– <app_id>.appspot.com, or
– Custom domain with Google Apps
• Deploying uploads
– Static files
– Resource files
– Other metadata (datastore indexes, cron jobs)
• Admin Console
– dashboards
– manage multiple versions
– view logs
7
Sunday, May 9, 2010
8. Quotas and Billing
Resource Provided Free Additional Cost
CPU time 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 sent 2000/day to users $0.0001/email
50000/day to admins
8
Sunday, May 9, 2010
9. App Engine Product Roadmap
• SSL for third-party domains
• Background servers capable of running for longer than 30s
• Ability to reserve instances to reduce application loading overhead
• Ability to select different availability vs. latency options for Datastore
• Support for mapping operations across datasets
• Datastore dump and restore facility
• Raise request/response size limits for some APIs
• Improved monitoring and alerting of application serving
• Support for Browser Push (Comet) communication
• Built-in support for OAuth & OpenID
9
Sunday, May 9, 2010
11. Rails Deployment History
• 2004 - FastCGI on Apache or Lighttpd
“a rocket that sometimes blows up in strange ways”
• 2006 - Mongrel clusters behind Apache mod_proxy
“high throughput, but requires multiple moving parts”
• 2008 - Phusion Passenger on Apache
“simply upload files, rack-based, REE/COW”
• 2010 - Running in a servlet container with JRuby-Rack
“powerful/portable/scalable, rack-based, JRuby”
11
Sunday, May 9, 2010
12. Benefits of JRuby
• Outperforms MRI in many cases... 2x to 10x
• Gem extensions written in Java (no more segfaults)
• A wealth of integration options and first-class Java APIs
• Spin-up new instances quickly using Duby (or Java) servlets
12
Sunday, May 9, 2010
14. Current Issues with JRuby on App Engine
• Several seconds to “spin-up” a new JRuby instance
• Some gems may need their extensions ported to Java
• Not officially supported , but you have all that you need
+
14
Sunday, May 9, 2010
15. Install it Now
sudo gem install google-appengine
Everything you need installs as gems
15
Sunday, May 9, 2010
18. Users API
• Existing User Account
• Restrict your app to a domain
map '/src' do
use AppEngine::Rack::AdminRequired
use AppEngine::Rack::SSLRequired
run ActionController::Dispatcher.new
end
map '/' do
run ActionController::Dispatcher.new
end
18
Sunday, May 9, 2010
19. Datastore API + DataMapper
# Comparisons you’d expect
Zoo.first(:name => 'Galveston')
# The 'gt/lt' means greater/less-than.
Person.all(:age.gt => 30)
Person.all(:age.lt => 40)
# The 'gte/lte' means greather/less-than-or-equal-to.
Person.all(:age.gte => 30)
Person.all(:age.lte => 40)
# The value of a pair is an Array
Person.all(:name => 'Sam', :id => [ 1, 2, 3, 4, 5 ])
Person.all(:name => [ 'bob', 'rick', 'steve' ])
# Ordering
Person.all(:order => [ :age.desc ])
19
Sunday, May 9, 2010
20. Memcache API
• No configuration required
• Same API as Ruby-Memcache
• Keys can be any Symbol or String
• Can store any Marshalable or Serializable object
cache = AppEngine::Memcache.new
cache.set_many({:a => 1, :foo => 1..5})
a, foo = cache.get(:a, :foo)
20
Sunday, May 9, 2010
21. URL Fetch API
• Drop-in replacement for Net::HTTP
AppEngine::URLFetch.fetch(url, options={})
:method
:payload
:headers
:allow_truncated
:follow_redirects
:deadline
21
Sunday, May 9, 2010
22. Resources
• John Woodell, @johnwoodell
• Blog
– http://jruby-appengine.blogspot.com/
• Code Site
– http://code.google.com/p/appengine-jruby/
• Google Group
– http://groups.google.com/group/appengine-jruby
22
Sunday, May 9, 2010