Royal Wedding Bells in the Cloud

As the centuries pass, waves of change wash over us - the invention of the steam engine, photography, space travel, the Internet. We may think these inventions change everything. But some things stay the same. Like our world-wide romantic fascination with a Princess finding her Prince, and their First Royal Kiss.









And so it was only fitting that the highest traffic levels ever on Google App Engine occurred at the moment of the first (and second!) kiss between The Duke and Duchess of Cambridge.




The Royal Household announced in March, that the Royal Wedding would have its own official web site, and it would be hosted on Google App Engine. The site was a great team effort between The Royal Household, Accenture, who built the site, the web design agency Reading Room who led on the design and creative work, and the Google App Engine team.




The Official Royal Wedding web site generated over 2,000 requests per second, serving 15 million page views from 5.6 million visitors on the day of the wedding. Despite this load, the web site ran smoothly, serving off Google’s shared platform without disturbing the other 200,000+ apps, which collectively serve over 1.5 billion views per day.




However, from a load perspective, the really busy Google App Engine app was the YouTube Royal Channel site. This app's traffic peaked at 32,000 requests per second (!) - with an additional 10,000 requests per second during the 10 seconds around the kiss(es).




Whilst others were watching for a glimpse of The Dress, we were watching for a cloud platform non-event: the Google App Engine platform continued to operate normally. Both our wishes came true.




If you’re planning an event of similar scale yourself, we’d love to hear about it.




Our congratulations to the Royal Couple, and best wishes for the future!




Peter S Magnusson

Engineering Director

On behalf of the App Engine and Google team

Who's at Google I/O: Elastic Path

This post is part of Who's at Google I/O, a series of guest blog posts written by developers who are appearing in the Developer Sandbox at Google I/O. It's also cross-posted to the Google Code blog which has similar posts for all sorts of Google developer products.



Elastic Path develops a very flexible enterprise ecommerce platform. Many global brands rely on the Elastic Path platform to power their ecommerce solutions.



Many ecommerce sites are actually complex web applications. Catalog management, shopping cart functionality, promotion engine, order fulfillment, and backend integrations are just some of the challenges involved in running a full-fledged online store.



Since 2008, our Java-based platform has been the ecommerce backbone of a couple of online stores that are being migrated to run on App Engine. Like many complex web applications, these stores used to run in a multi-server environment (Apache Tomcat with a MySQL database) hosted in a colocation center.






As the diagram above shows, our goal is to have Elastic Path running entirely on the App Engine cloud. The storefronts have already been migrated, and the database and remaining parts of the Elastic Path platform will be fully on the cloud soon.



Why are we doing this? There are many benefits to being on App Engine:


  • Increased security

  • Easier deployments and operations

  • Scalability

  • Cost-effectiveness

  • Built-in monitoring


We can only undergo this migration because App Engine supports enterprise-grade Java applications, and because Elastic Path is very flexible.



Our migration’s high-level approach was to move everything except the persistence layer onto App Engine, and then resolve issues with the technical limitations such as the class whitelist and request length. We also had to modify some third-party libraries to work around App Engine’s restrictions on operations such as class loading, threads, and sockets.



We didn’t migrate the persistence layer because Elastic Path uses a relational database; converting our entire object graph to the Datastore is not feasible now. We are working closely with Google on alternatives. In the interim, we are still using a MySQL database and have kept our persistence layer running within a Tomcat application in the colo. We implemented a creative solution: the non-persistence layers of Elastic Path run on App Engine and communicate with the Tomcat-hosted persistence services via Spring Remoting. The back-and-forth remoting was expensive and impacted the performance of our application so we implemented some data caching. For this, we turned to App Engine’s Memcache, which improved performance by an order of magnitude (less than 2 seconds average response times vs. 2 minutes or more without Memcache).



Other App Engine technologies we use heavily include AppStats for performance tuning, URL Fetch for the Spring Remoting described above, and the fantastic Maven GAE plugin that we use for packaging and automated deployments. As we continue to push our platform up to the cloud, we hope to utilize more of App Engine’s cool features. If you’d like to learn more about Elastic Path, how we are migrating our Java platform to run on the cloud, and how you might be able to migrate your application to App Engine, drop by our booth in the App Engine section of the Developer Sandbox. See you there!



Come see Elastic Path Software in the Developer Sandbox at Google I/O on May 10-11.



Eddie Chan is an ecommerce developer at Elastic Path Software in beautiful Vancouver, Canada. He and his brilliant team work closely with Google and are currently focused on migrating existing online stores to App Engine.



Posted by Scott Knaster, Editor

Who's at Google I/O: Mojo Helpdesk

This post is part of Who's at Google I/O, a series of guest blog posts written by developers who are appearing in the Developer Sandbox at Google I/O. It's also cross-posted to the Google Code blog which has similar posts for all sorts of Google developer products.



Mojo Helpdesk from Metadot is an RDBMS-based Rails application for ticket tracking and management that can handle millions of tickets. We are migrating this application to run on Google App Engine (GAE), Java, and Google Web Toolkit (GWT). We were motivated to make this move because of the application’s need for scalability in data management and request handling, the benefits from access to GAE’s services and administrative tools, and GWT’s support for easy development of a rich application front-end.



In this post, we focus on GAE and share some techniques that have been useful in the migration process.



Task failure management



Our application makes heavy use of the Task Queue service, and must detect and manage tasks that are being retried multiple times but aren’t succeeding. To do this, we extended Deferred, which allows easy task definition and deployment. We defined a new Task abstraction, which implements an extended Deferrable and requires that every Task implement an onFailure method. Our extension of Deferred then terminates a Task permanently if it exceeds a threshold on retries, and calls its onFailure method.



This allows permanent task failure to be reliably exposed as an application-level event, and handled appropriately. (Similar techniques could be used to extend the new official Deferred API).







From the existing Mojo Helpdesk: a view of a user’s assigned tickets.



Appengine-mapreduce



Mojo Helpdesk needs to run many types of batch jobs, and appengine-mapreduce is of great utility. However, we often want to map over a filtered subset of Datastore entities, and our map implementations are JDO-based (to enforce consistent application semantics), so we don’t need low-level Entities prefetched.
 So, we made two extensions to the mapper libraries. First, we support the specification of filters on the mapper’s Datastore sharding and fetch queries, so that a job need not iterate over all the entities of a Kind. Second, our mapper fetch does a keys-only Datastore query; only the keys are provided to the map method, then the full data objects are obtained via JDO. These changes let us run large JDO-based mapreduce jobs with much greater efficiency.



Supporting transaction semantics



The Datastore supports transactions only on entities in the same entity group. Often, operations on multiple entities must be performed atomically, but grouping is infeasible due to the contention that would result. We make heavy use of transactional tasks to circumvent this restriction. (If a task is launched within a transaction, it will be run if and only if the transaction commits). A group of activities performed in this manner – the initiating method and its transactional tasks – can be viewed as a “transactional unit” with shared semantics.



We have made this concept explicit by creating a framework to support definition, invocation, and automatic logging of transactional units. (The Task abstraction above is used to identify cases where a transactional task does not succeed). All Datastore-related application actions – both in RPC methods and "offline" activities like mapreduce – use this framework. This approach has helped to make our application robust, by enforcing application-wide consistency in transaction semantics, and in the process, standardizing the events and logging which feed the app’s workflow systems.







From the existing Mojo Helpdesk: a view of the unassigned tickets for a work group.



Entity Design



To support join-like functionality, we can exploit multi-valued Entity properties (list properties) and the query support they provide. For example, a Ticket includes a list of associated Tag IDs, and Tag objects include a list of Ticket IDs they’re used with. This lets us very efficiently fetch, for example, all Tickets tagged with a conjunction of keywords, or any Tags that a set of tickets has in common. (We have found the use of "index entities" to be effective in this context). We also store derived counts and categorizations in order to sidestep Datastore restrictions on query formulation.



These patterns have helped us build an app whose components run efficiently and robustly, interacting in a loosely coupled manner.



Come see Mojo Helpdesk in the Developer Sandbox at Google I/O on May 10-11.



Amy (@amygdala) has recently co-authored (with Daniel Guermeur) a book on Google App Engine and GWT application development. She has worked at several startups, in academia, and in industrial R&D labs; consults and does technical training and course development in web technologies; and is a contributor to the @thinkupapp open source project.



Posted by Scott Knaster, Editor

Google Earth optimized for Android-powered tablets

Cross-posted from the Official Google Blog

When we launched Google Earth in 2005, most of us were still using flip phones. At the time, the thought of being able to cart around 197 million square miles of Earth in your pocket was still a distant dream. Last year, that dream came to fruition for Android users when we released Google Earth for Android. With the recent release of tablets based on Android 3.0, we wanted to take full advantage of the large screens and powerful processors that this exciting new breed of tablets had to offer.

Today’s update to Google Earth for Android makes Earth look better than ever on your tablet. We’ve added support for fully textured 3D buildings, so your tour through the streets of Manhattan will look more realistic than ever. There’s also a new action bar up top, enabling easier access to search, the option to “fly to your location” and layers such as Places, Panoramio photos, Wikipedia and 3D buildings.

Moving from a mobile phone to a tablet was like going from a regular movie theatre to IMAX. We took advantage of the larger screen size, including features like content pop-ups appearing within Earth view, so you can see more information without switching back and forth between pages.

One of my favorite buildings to fly around in Google Earth has always been the Colosseum in Rome, Italy:



With the larger tablet screen, I can fly around the 3D Colosseum while also browsing user photos from Panoramio. The photos pop up within the imagery so I can interact with them without losing sight of the Colosseum and its surroundings. Also, by clicking on the layer button on the action bar, I can choose which layers I want to browse.

This version is available for devices with Android 2.1 and above. The new tablet design is available for devices with Android 3.0 (Honeycomb) and above. Please visit the Google Earth help center for more information.

To download or update Google Earth, head to m.google.com/earth in your device’s browser or visit Android Market. Enjoy a whole new world of Google Earth for tablets!