cloud service provider

15
8 rules to build web app on top of Google AppEngine effectively Lessons learned www.comvai.com

Upload: appengine

Post on 12-Nov-2014

227 views

Category:

Technology


2 download

DESCRIPTION

Cloud service provider

TRANSCRIPT

  • 1. 8 rules to build web app on top of Google AppEngine effectivelyLessons learnedwww.comvai.com

2. Google App Engine Keep in mind Google AppEngine supportssubset of Java EE specifications. Check athttp://code.google.com/p/googleappengine/wiki/Wwww.comvai.com 3. 1. Design Data model as simple aspossible The App Engine Datastore is not traditional relational SQL database andthere are several important differences. AppEngine datastore is schemaless. Entities of the same kind can havedifferent properties. The application itself is responsible for ensuring thatentities conform to it. If you want to migrate your existing data model to App Engine you willprobably need it to redesign. Data-model consistency will be split to the data-model and application. Check app engine datastore limitations to understand it. It gives you betteroverview regarding your future data-model design.http://code.google.com/appengine/articles/datastore/overview.html www.comvai.com 4. How to Use recommended High Replication Datastore HRD. Use Objectify with JPA annotations over built-in JPA or JDO. Prefer to use unowned relationships between entities. Forget about count entities over filtered query result. Design your UI sothat count is not being required. If you need statistic calculations, do it on entity update. Note: Building data model on top of built-in either JPA or JDO doesntguarantee that application will be vendor independent because of differentbehavior of AppEngine datastore in some cases. Even it doesnt mean thatsnot possible to do so just requires understanding of AppEngine datastorebehavior. www.comvai.com 5. 2. Handle your data model via non default version of your GAE app The AppEngine allows you to deploy more than one non default version ofyour application. Deploy specifically designed application to perform updateof your data model only as a non default version to be independent fromyour main application release cycle.www.comvai.com 6. 3. Price shields tips Use Appstats out of the box tool to detect datastore bottleneck. Just plugin. It helps you to find the hidden unnecessary datastore operations that aredragging you down. Use memcache. Datastore operations costs money and caching of "static"data could save you from using unnecessary datastore operations. Use as many static files as possible. Static files are handled with highperformance static front-end servers (CDN) which are highly optimized forthis type of content. See morehttp://www.gregtracy.com/revisiting-google-app-engines-pricing-changeswww.comvai.com 7. 4. Improve cold startup time AppEngine instances starts quite often thus cold startup time (known aswell as warmup request, loading request) is more important than intraditional Java EE application. Good startup time improves user experience. Minimize number of your application java library dependencies as much aspossible. Make sure if all your libs are really needed. Otherwise it will slowyour cold startup time down. Dont use JSP if you are already using another Frontend framework Using JSPs will add additional libraries into your lib directory that are usedfor processing of JSP.http://www.listry.com/blog/2010/03/google-app-engine-cold-start-tip-dont Use Objectify over built-in JPA or JDO.http://www.listry.com/blog/2010/03/google-app-engine-cold-start-guide-for www.comvai.com 8. 5. Prefer Google Guice as DI framework Its simple, small in size and powerful library and you probably wont needmore.www.comvai.com 9. 6. Use GWT for your desktop like webapp GWT together with GAE offers lot of built-in technics to improve yourweb app performance. Built-in features coming as advice from the bookHigh Performance Web Sites. Its better to have only one framework for the UI even it means to buildsome components yourself. Among other things it means less dependenciesand simplified upgrade process.www.comvai.com 10. How to GWT Use built-in optimization technics with help of GWTs ClientBundles. ClientBundles and ImageResource makes using images more efficient. CssResource for CSS minification, CSS image strips and much more, seedocs for ClientBundles (DataResource, TextResource,ExternalTextResource). Switch on minification and obfuscation of the Java-JavaScript compiler.www.comvai.com 11. How to GAE Content Delivery Network CDN Gzip compression Memcachewww.comvai.com 12. 7. Use GWT MVP pattern Its not easy to work with but worth of time. GWT has built-in support forMVP pattern. www.comvai.com 13. Benefits Well suited for large scale application. Separation of functionality into components. Helps simplify UI unit testing. Built-in browser history management. MVP is not concerned with browserhistory management, but Activities and Places may be used very well withMVP development. Built-in event bus as a central point for app events. Caching all of your code books via GWT event bus as a central pipe to goto the backend. www.comvai.com 14. 8. Use Apache Wicket for website The component based web framework. Version 1.5 or higher optimized forGoogle AppEngine In Java ecosystem there is a lot of front-end frameworks thus to choose theright one depends on many varying factors. We like Apache Wicket becauseits Java, feature rich component-oriented framework with good API. Asversion 1.5 it very well operates on App Engine. So its up to you and yourrequirements but ones Apache Wicket is good fit for you we recommend it. Add wicketstuff-gae-initializer dependency along side with wicket coredependencies Alternative Play framework as it has specific module for App Engine. www.comvai.com 15. Visit http://www.comvai.com/google-app-engine-development and registeryourself to get development of your Google AppEngine projects Proof ofConcept for free. Validate suitability of your project to be built on top of Google App Engine.www.comvai.com