SlideShare a Scribd company logo
The 90-Day Startup on Google AppEngine David Chandler [email_address] http://TurboManage.com
Who is this guy? Wrote first book on running a Web site (1995) Written Web apps in perl, ksh, C with lex/yacc, ColdFusion, JSF, GWT Most recently, Web architect with Intuit on Internet banking products Patent on non-recursive SQL trees Working in a startup last 6 mos
AppEngine for Java What is it? Getting started Where does it fit? Designing for AppEngine An architecture that works Unsolved problems Resources
What is AppEngine? Business: Google’s cloud computing platform competing with Azure and AWS Technical: giant Web farm in front of world’s largest HashMap Java developer: easiest and most scalable Java hosting environment Startup developer: FREE to get started Enterprise developer:  tools that make you drool, but Security will never allow it
Let’s do it Sign up for AppEngine beta Download Google plugin for Eclipse Create new Google Web application Deploy it
What didn’t we do? Install Tomcat Configure Tomcat Start Tomcat Stop Tomcat Install a database Configure a database Find a DBA to run scripts to populate a database…
What didn’t we do? But what would we do differently to SCALE our Web tier? our data tier? our asynchronous service tier? For example, Azure: provision more SQL or IIS instances in admin console AWS: same, using Rightscale or similar AppEngine: see checklist…
 
Tradeoffs You have to build the AppEngine way BigTable is not a relational database Can’t start your own threads JRE whitelist Don’t forget quotas
Working with the Datastore Hierarchical, not relational Entity may have child entities Entity + children = entity group Transactions only work within entity group But deeply nested entity graph limits perf Datastore can only write 5-10 updates / sec per entity group (instance, not class, thankfully) To update many entities in one request, they must be root entities
Datastore APIs Native get(Key key), put(Entity e), etc. But…entities are not POJOs, so you need... JDO or JPA JDO supported first, seems to be Google’s favorite JPA well-supported now, Google is committed Objectify ( http://code.google.com/p/objectify-appengine ) Twig, SimpleDS, others
Datastore limitations Some RDBMS features can be implemented in JDO / JPA drivers Lazy fetching (be careful) Cascading deletes Relationship modeling with Collections Others can’t Datastore doesn’t enforce FK relationships Query restrictions
Query restrictions No OR clauses (requires separate trips to the Datastore) IN supported, but makes separate trips Inequality filters (<, >, !=) on one prop only Joins barely supported As of Feb 12, can do 2-way == joins with JDO or JPA only
What IS supported? Fast, scalable index retrieval Remember, it’s a HashMap Define multi-property indexes in datastore-indexes.xml JDO + JPA auto-create them for you Merge-join AND clause on multiple properties AppEngine uses efficient zig-zag algorithm to satisfy AND conditions without multi-prop idx
Datastore vs. RDBMS Banking application Forget it. You need transactions, enforced relationships Social networking application Absolutely! Latency, asynchronous writes OK List properties solve the million-fan-out problem General business app (issue tracker) Tx not so important, can solve for latency
What are list properties? @Entity public   class  PrayerIndex { @Id private  Long id; @Parent private  Key<PrayerItem> parent; private  List<Key<User>> followerKeys;
Whoa--isn’t that bad design? Rules of normalization disallow repeating elements in a “column” Normally use intersection table to model a many-to-many relationship In fact, that’s what Datastore is doing Creates index row for each item in the list So you can do this: indexQuery.filter(&quot;followerKeys&quot;, followerKey);
Joins revisited Query on list property can be used in place of a join with an intersection table Some things are much easier this way Example: find mutual friends of Joe and Sam SQL:  SELECT FROM Friends a JOIN Friends b ON a.friend = b.friend WHERE… AppEngine:  filter(“friends”, “Joe”).filter(“friends”, “Sam”)
Datastore specialties List properties (Google I/O ’09, Brett Slatkin) Keys-only queries (avoids deserialization) Efficient batch gets: get(keys) And puts: put(entities) Ancestor queries--find all child entities Web-safe cursor! http://gae-java-persistence.blogspot.com/
Why Objectify? Light 36k jar, no external dependencies Fast no bytecode enhancement on start Simple No PersistenceManager lifecycle means no DI required, no attach / detach to mess with @Cache (uses AppEngine Memcache) @Embedded (objects as list tuples)
How to do background processing? Your application can’t start threads Causes problems for some frameworks See will-it-play-in-appengine wiki No, you can’t run WebSphere or JBoss on AppEngine AppEngine provides Task Queue API Servlet-based Allows throttling
Queuing a Task Define queue in WEB-INF/queue.xml <queue> <name>mail</name> <rate>8/m</rate> </queue> Create worker servlet that handles task Queue the task queue.add(url(&quot;/mail&quot;).param(&quot;key&quot;, key)…)
Is there an easier way?
Is there an easier way? Vince Bonfanti’s Deferred task servlet Task throttling can help with quotas
An architecture that works Objectify Guice Gwt-dispatch (GWT-RPC) QueuingBatchingCachingDispatchAsync
Guice Google’s dependency injection framework Small, light, almost plain English See ServerModule DispatchServletModule DispatchTestModule ROAUserServiceImpl Used by gwt-dispatch, useful for unit tests
gwt-dispatch GWT-RPC basics: every service = 3 classes Service interface (LoginService) Async version (LoginServiceAsync) Server impl (LoginServiceImpl) @RemoteServiceRelativePath(&quot;gwtlogin&quot;) public   interface  LoginService  extends  RemoteService { public  LoginInfo login(String requestUri)  throws  UserNotRegisteredException; }
gwt-dispatch Eclipse tooling auto-creates the asyncs What if you wanted to add a standard arg to every service call? Like a security token to prevent CSRF Would have to add to every interface, async, and impl UGH Or what if you wanted to cache data from service calls?
gwt-dispatch Turn verbs (methods) into nouns (classes) loginService.login(p1,p2…,callback); dispatchService.execute(new LoginAction(), new AsyncCallback<LoginResult>() { handleSuccess(LoginResult result)… handleFailure(Throwable caught)… }
gwt-dispatch Command pattern benefits Send security token in DispatchService and Actions don’t even have to know about it Actions and ActionHandlers can extend base classes Constructor params are saved with the cmd Caching! Batching! Queuing! Rollback!
Unsolved problems Cold start Datastore latency
Unsolved problems
One more thing AppEngine for Java < 1 yr old gwt-presenter, gwt-dispatch < 5 mos Many Datastore features < 2 mos Objectify barely 1 mo Bleeding edge : (t problem  – t solution posted )   == 0 How close can you tolerate?
How long did it really take? Deploy sample app 90s Ooh & aah at admin console 90m Wait for frameworks I needed 90d Learn how to use them 30d Write application code 60d Upgrade them constantly 90h
Resources AppEngine docs (a little thin, but good) Forums http://groups.google.com/group/google-appengine-java  (Google engineers monitor) http://groups.google.com/group/google-appengine-downtime-notify http://gae-java-persistence.blogspot.com / http://turbomanage.wordpress.com  (Objectify, gwt-dispatch, gwt-presenter example code) Upcoming Google I/O conf

More Related Content

What's hot (20)

PDF
Building Desktop RIAs With PHP And JavaScript
funkatron
 
PDF
Lessons from helping developers integrate 1,000 APIs with Zapier
Fokke Zandbergen
 
PDF
Behavior Driven Development with Cucumber
Brandon Keepers
 
PDF
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
PPTX
Web development with django - Basics Presentation
Shrinath Shenoy
 
ODP
* DJANGO - The Python Framework - Low Kian Seong, Developer
Linuxmalaysia Malaysia
 
KEY
Architecting single-page front-end apps
Zohar Arad
 
PDF
Implementing Testing for Behavior-Driven Development Using Cucumber
TechWell
 
PDF
Getting Started with Angular - Stormpath Webinar, January 2017
Matt Raible
 
PPT
Administrators admin tips tricks and hacks presented by an ex-googler
zpurcey
 
PPTX
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
PPTX
Creating a Custom PowerApp Connector using Azure Functions
Murray Fife
 
PDF
Front End Development for Back End Developers - Denver Startup Week 2017
Matt Raible
 
PDF
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Matt Raible
 
PPTX
Organized web app development using backbone.js
Shakti Shrestha
 
PDF
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Matt Raible
 
PPTX
Async
Kevin Griffin
 
PPTX
django Forms in a Web API World
Tareque Hossain
 
PDF
Frontrunners react
Allison Kunz
 
PDF
Bootiful Development with Spring Boot and React - Belfast JUG 2018
Matt Raible
 
Building Desktop RIAs With PHP And JavaScript
funkatron
 
Lessons from helping developers integrate 1,000 APIs with Zapier
Fokke Zandbergen
 
Behavior Driven Development with Cucumber
Brandon Keepers
 
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
Web development with django - Basics Presentation
Shrinath Shenoy
 
* DJANGO - The Python Framework - Low Kian Seong, Developer
Linuxmalaysia Malaysia
 
Architecting single-page front-end apps
Zohar Arad
 
Implementing Testing for Behavior-Driven Development Using Cucumber
TechWell
 
Getting Started with Angular - Stormpath Webinar, January 2017
Matt Raible
 
Administrators admin tips tricks and hacks presented by an ex-googler
zpurcey
 
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
Creating a Custom PowerApp Connector using Azure Functions
Murray Fife
 
Front End Development for Back End Developers - Denver Startup Week 2017
Matt Raible
 
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Matt Raible
 
Organized web app development using backbone.js
Shakti Shrestha
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Matt Raible
 
django Forms in a Web API World
Tareque Hossain
 
Frontrunners react
Allison Kunz
 
Bootiful Development with Spring Boot and React - Belfast JUG 2018
Matt Raible
 

Viewers also liked (7)

PDF
Deploying to AppEngine
Alexander Khaerov
 
PDF
Google App Engine Developer - Day4
Simon Su
 
PPT
Cloud computing and security 01
Akash Kamble
 
PDF
appengine ja night #25 Google App Engine for PHP (English)
Ryo Yamasaki
 
PDF
Understanding PaaS
Alexander Khaerov
 
PDF
Google I/O 2016 Recap - Google Cloud Platform News Update
Simon Su
 
PDF
Google Cloud Platform 入門
Kah Wai Liew
 
Deploying to AppEngine
Alexander Khaerov
 
Google App Engine Developer - Day4
Simon Su
 
Cloud computing and security 01
Akash Kamble
 
appengine ja night #25 Google App Engine for PHP (English)
Ryo Yamasaki
 
Understanding PaaS
Alexander Khaerov
 
Google I/O 2016 Recap - Google Cloud Platform News Update
Simon Su
 
Google Cloud Platform 入門
Kah Wai Liew
 
Ad

Similar to The 90-Day Startup with Google AppEngine for Java (20)

PPT
LatJUG. Google App Engine
denis Udod
 
PPT
Talk 1: Google App Engine Development: Java, Data Models, and other things yo...
Singapore Google Technology User Group
 
KEY
Appengine Nljug
Paul Bakker
 
PDF
Java Support On Google App Engine
Xebia IT Architects
 
PDF
Developing, deploying and monitoring Java applications using Google App Engine
IndicThreads
 
PPT
Google App Engine for Java (GAE/J)
Lars Vogel
 
PPT
Google App Engine for Java
Lars Vogel
 
PDF
Google Developer Days Brazil 2009 - Java Appengine
Patrick Chanezon
 
PDF
I've (probably) been using Google App Engine for a week longer than you have
Simon Willison
 
PDF
Google App Engine With Java And Groovy
Ken Kousen
 
PDF
Google App Engine for Java
Lars Vogel
 
PDF
Google App Engine
Lennon Shimokawa
 
PDF
Google App Engine - exploiting limitations
Tomáš Holas
 
PPT
Developing Java Web Applications In Google App Engine
Tahir Akram
 
PDF
Google app engine - Soft Uni 19.06.2014
Dimitar Danailov
 
PDF
Google App Engine Developer - Day2
Simon Su
 
PDF
Cannibalising The Google App Engine
catherinewall
 
PPTX
Google app engine
Renjith318
 
PDF
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
IndicThreads
 
PPT
Google App Engine - Java Style
Peter Lind
 
LatJUG. Google App Engine
denis Udod
 
Talk 1: Google App Engine Development: Java, Data Models, and other things yo...
Singapore Google Technology User Group
 
Appengine Nljug
Paul Bakker
 
Java Support On Google App Engine
Xebia IT Architects
 
Developing, deploying and monitoring Java applications using Google App Engine
IndicThreads
 
Google App Engine for Java (GAE/J)
Lars Vogel
 
Google App Engine for Java
Lars Vogel
 
Google Developer Days Brazil 2009 - Java Appengine
Patrick Chanezon
 
I've (probably) been using Google App Engine for a week longer than you have
Simon Willison
 
Google App Engine With Java And Groovy
Ken Kousen
 
Google App Engine for Java
Lars Vogel
 
Google App Engine
Lennon Shimokawa
 
Google App Engine - exploiting limitations
Tomáš Holas
 
Developing Java Web Applications In Google App Engine
Tahir Akram
 
Google app engine - Soft Uni 19.06.2014
Dimitar Danailov
 
Google App Engine Developer - Day2
Simon Su
 
Cannibalising The Google App Engine
catherinewall
 
Google app engine
Renjith318
 
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
IndicThreads
 
Google App Engine - Java Style
Peter Lind
 
Ad

More from David Chandler (14)

PPTX
Taking Your GWT App to Tablets with GXT 4.0
David Chandler
 
PDF
StORM: a lightweight ORM for Android SQLite
David Chandler
 
PDF
Easy REST APIs with Jersey and RestyGWT
David Chandler
 
PDF
Cómo trabajan los Googlers
David Chandler
 
PDF
Life of an engineer
David Chandler
 
PDF
StORM preview
David Chandler
 
PDF
Google App Engine Update 2012
David Chandler
 
PDF
GWT Plus HTML 5
David Chandler
 
PDF
Scalable Apps with Google App Engine
David Chandler
 
PDF
What's New in GWT 2.2
David Chandler
 
PDF
Develop and Deploy Scalable Apps with Google App Engine
David Chandler
 
PDF
Secrets of the GWT
David Chandler
 
PPT
GWT MVP Case Study
David Chandler
 
PDF
Securing JSF Applications Against the OWASP Top Ten
David Chandler
 
Taking Your GWT App to Tablets with GXT 4.0
David Chandler
 
StORM: a lightweight ORM for Android SQLite
David Chandler
 
Easy REST APIs with Jersey and RestyGWT
David Chandler
 
Cómo trabajan los Googlers
David Chandler
 
Life of an engineer
David Chandler
 
StORM preview
David Chandler
 
Google App Engine Update 2012
David Chandler
 
GWT Plus HTML 5
David Chandler
 
Scalable Apps with Google App Engine
David Chandler
 
What's New in GWT 2.2
David Chandler
 
Develop and Deploy Scalable Apps with Google App Engine
David Chandler
 
Secrets of the GWT
David Chandler
 
GWT MVP Case Study
David Chandler
 
Securing JSF Applications Against the OWASP Top Ten
David Chandler
 

Recently uploaded (20)

PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 

The 90-Day Startup with Google AppEngine for Java

  • 1. The 90-Day Startup on Google AppEngine David Chandler [email_address] http://TurboManage.com
  • 2. Who is this guy? Wrote first book on running a Web site (1995) Written Web apps in perl, ksh, C with lex/yacc, ColdFusion, JSF, GWT Most recently, Web architect with Intuit on Internet banking products Patent on non-recursive SQL trees Working in a startup last 6 mos
  • 3. AppEngine for Java What is it? Getting started Where does it fit? Designing for AppEngine An architecture that works Unsolved problems Resources
  • 4. What is AppEngine? Business: Google’s cloud computing platform competing with Azure and AWS Technical: giant Web farm in front of world’s largest HashMap Java developer: easiest and most scalable Java hosting environment Startup developer: FREE to get started Enterprise developer: tools that make you drool, but Security will never allow it
  • 5. Let’s do it Sign up for AppEngine beta Download Google plugin for Eclipse Create new Google Web application Deploy it
  • 6. What didn’t we do? Install Tomcat Configure Tomcat Start Tomcat Stop Tomcat Install a database Configure a database Find a DBA to run scripts to populate a database…
  • 7. What didn’t we do? But what would we do differently to SCALE our Web tier? our data tier? our asynchronous service tier? For example, Azure: provision more SQL or IIS instances in admin console AWS: same, using Rightscale or similar AppEngine: see checklist…
  • 8.  
  • 9. Tradeoffs You have to build the AppEngine way BigTable is not a relational database Can’t start your own threads JRE whitelist Don’t forget quotas
  • 10. Working with the Datastore Hierarchical, not relational Entity may have child entities Entity + children = entity group Transactions only work within entity group But deeply nested entity graph limits perf Datastore can only write 5-10 updates / sec per entity group (instance, not class, thankfully) To update many entities in one request, they must be root entities
  • 11. Datastore APIs Native get(Key key), put(Entity e), etc. But…entities are not POJOs, so you need... JDO or JPA JDO supported first, seems to be Google’s favorite JPA well-supported now, Google is committed Objectify ( http://code.google.com/p/objectify-appengine ) Twig, SimpleDS, others
  • 12. Datastore limitations Some RDBMS features can be implemented in JDO / JPA drivers Lazy fetching (be careful) Cascading deletes Relationship modeling with Collections Others can’t Datastore doesn’t enforce FK relationships Query restrictions
  • 13. Query restrictions No OR clauses (requires separate trips to the Datastore) IN supported, but makes separate trips Inequality filters (<, >, !=) on one prop only Joins barely supported As of Feb 12, can do 2-way == joins with JDO or JPA only
  • 14. What IS supported? Fast, scalable index retrieval Remember, it’s a HashMap Define multi-property indexes in datastore-indexes.xml JDO + JPA auto-create them for you Merge-join AND clause on multiple properties AppEngine uses efficient zig-zag algorithm to satisfy AND conditions without multi-prop idx
  • 15. Datastore vs. RDBMS Banking application Forget it. You need transactions, enforced relationships Social networking application Absolutely! Latency, asynchronous writes OK List properties solve the million-fan-out problem General business app (issue tracker) Tx not so important, can solve for latency
  • 16. What are list properties? @Entity public class PrayerIndex { @Id private Long id; @Parent private Key<PrayerItem> parent; private List<Key<User>> followerKeys;
  • 17. Whoa--isn’t that bad design? Rules of normalization disallow repeating elements in a “column” Normally use intersection table to model a many-to-many relationship In fact, that’s what Datastore is doing Creates index row for each item in the list So you can do this: indexQuery.filter(&quot;followerKeys&quot;, followerKey);
  • 18. Joins revisited Query on list property can be used in place of a join with an intersection table Some things are much easier this way Example: find mutual friends of Joe and Sam SQL: SELECT FROM Friends a JOIN Friends b ON a.friend = b.friend WHERE… AppEngine: filter(“friends”, “Joe”).filter(“friends”, “Sam”)
  • 19. Datastore specialties List properties (Google I/O ’09, Brett Slatkin) Keys-only queries (avoids deserialization) Efficient batch gets: get(keys) And puts: put(entities) Ancestor queries--find all child entities Web-safe cursor! http://gae-java-persistence.blogspot.com/
  • 20. Why Objectify? Light 36k jar, no external dependencies Fast no bytecode enhancement on start Simple No PersistenceManager lifecycle means no DI required, no attach / detach to mess with @Cache (uses AppEngine Memcache) @Embedded (objects as list tuples)
  • 21. How to do background processing? Your application can’t start threads Causes problems for some frameworks See will-it-play-in-appengine wiki No, you can’t run WebSphere or JBoss on AppEngine AppEngine provides Task Queue API Servlet-based Allows throttling
  • 22. Queuing a Task Define queue in WEB-INF/queue.xml <queue> <name>mail</name> <rate>8/m</rate> </queue> Create worker servlet that handles task Queue the task queue.add(url(&quot;/mail&quot;).param(&quot;key&quot;, key)…)
  • 23. Is there an easier way?
  • 24. Is there an easier way? Vince Bonfanti’s Deferred task servlet Task throttling can help with quotas
  • 25. An architecture that works Objectify Guice Gwt-dispatch (GWT-RPC) QueuingBatchingCachingDispatchAsync
  • 26. Guice Google’s dependency injection framework Small, light, almost plain English See ServerModule DispatchServletModule DispatchTestModule ROAUserServiceImpl Used by gwt-dispatch, useful for unit tests
  • 27. gwt-dispatch GWT-RPC basics: every service = 3 classes Service interface (LoginService) Async version (LoginServiceAsync) Server impl (LoginServiceImpl) @RemoteServiceRelativePath(&quot;gwtlogin&quot;) public interface LoginService extends RemoteService { public LoginInfo login(String requestUri) throws UserNotRegisteredException; }
  • 28. gwt-dispatch Eclipse tooling auto-creates the asyncs What if you wanted to add a standard arg to every service call? Like a security token to prevent CSRF Would have to add to every interface, async, and impl UGH Or what if you wanted to cache data from service calls?
  • 29. gwt-dispatch Turn verbs (methods) into nouns (classes) loginService.login(p1,p2…,callback); dispatchService.execute(new LoginAction(), new AsyncCallback<LoginResult>() { handleSuccess(LoginResult result)… handleFailure(Throwable caught)… }
  • 30. gwt-dispatch Command pattern benefits Send security token in DispatchService and Actions don’t even have to know about it Actions and ActionHandlers can extend base classes Constructor params are saved with the cmd Caching! Batching! Queuing! Rollback!
  • 31. Unsolved problems Cold start Datastore latency
  • 33. One more thing AppEngine for Java < 1 yr old gwt-presenter, gwt-dispatch < 5 mos Many Datastore features < 2 mos Objectify barely 1 mo Bleeding edge : (t problem – t solution posted ) == 0 How close can you tolerate?
  • 34. How long did it really take? Deploy sample app 90s Ooh & aah at admin console 90m Wait for frameworks I needed 90d Learn how to use them 30d Write application code 60d Upgrade them constantly 90h
  • 35. Resources AppEngine docs (a little thin, but good) Forums http://groups.google.com/group/google-appengine-java (Google engineers monitor) http://groups.google.com/group/google-appengine-downtime-notify http://gae-java-persistence.blogspot.com / http://turbomanage.wordpress.com (Objectify, gwt-dispatch, gwt-presenter example code) Upcoming Google I/O conf

Editor's Notes

  • #6: While waiting for deploy, show web.xml, appengine-web.xml, servlet Go to appspot versions, check it out What did we do? Show logs Tweak security constraint and redeploy using command line While waiting, go back to system status Hit it again, login now required Show logs with username
  • #8: Sure, you say, it’s a toy
  • #10: Having said that…
  • #21: Examples ObjectifyDAO PrayerIndexDao
  • #24: Show SimpleTaskTest
  • #27: ServerModule DispatchServletModule DispatchTestModule ROAUserServiceImpl Speaking of unit tests, show BaseTest
  • #28: Backup why GWT-RPC Lets you send POJOs, handler serialization / deserialization Show RoaMvp also
  • #31: Demo cache hits Daily ROA, Home, Daily ROA Look at AddPrayerPresenter, search for refreshPrayerLists