If you’re developing a Java application on App Engine you probably already know that you can use JPA and JDO, both standard Java persistence APIs, to interact with the datastore. What you may not know, and what I’m here to point out, is that for the past few months I’ve been accumulating a ...
If you’re developing a Java application on App Engine you probably already know that you can use JPA and JDO, both standard Java persistence APIs, to interact with the datastore. What you may not know, and what I’m here to point out, is that for the past few months I’ve been accumulating a collection of practical, real-world examples that can help you take full advantage of these powerful APIs.



In episode one I put together a working example of an owned, bidirectional, one-to-many relationship and demonstrated how you can persist child objects just by associating them with parent objects. In episode two I demonstrated how to perform a batch get by issuing a query that only filters on the primary key property of your model object. In episode three I explored the exciting world of “transparent persistence,” explaining how you can modify the persistent state of objects without making any explicit calls to repersist them. In episode four I issued a keys-only query and got the results back crazy-fast because the datastore skipped the extra scan that turns keys into full-fledged entities. And in episode five I demonstrated how serialized fields can help you store arbitrary objects in the datastore.



After episode five I got a little bit tired, but there was still so much more to say, so I pressed on.



In episode six I powered through a discussion of long-running transactions and unearthed the ancient secret of how you can use optimistic locking to prevent users from updating stale data. In episode seven I explained how using unindexed properties can speed up your writes and save you valuable CPU time. In episode eight I attempted (cautiously) to blow your mind with a solution for case-insensitive queries. And finally, in episode nine, mere hours after releasing support for != and IN query operators in the SDK, I dove under the hood of these operators to help you understand their performance characteristics.



Many of these topics were inspired by questions from you, our users, so if there are topics you’d like to see covered in the coming year please let me know via the forum. As long as you keep reading and asking questions, I’ll keep writing.



Today, we've very excited to release version 1.3.0 of the App Engine SDK, now available to both Java and Python developers. The newest SDK includes a new experimental Blobstore API for storage of files up to 50MB.
Today, we've very excited to release version 1.3.0 of the App Engine SDK, now available to both Java and Python developers. The newest SDK includes a new experimental Blobstore API for storage of files up to 50MB.



Store and Serve - Files can be uploaded and stored as blobs, to be served later in response to user requests. Developers can build their own organizational structures and access controls on top of blobs.



Pricing and Quotas - We include blob storage and transfer under the same datastore pricing and quotas you're already familiar with. For more information, see the App Engine quotas page.



The new Blobstore API is now available in both App Engine SDKs for local development. At this time it can only be used by applications that have enabled billing. There's a lot more information about the API and how it works in the Blobstore documentation (Python, Java) so please check that out and post any questions to the groups.



This release also includes some performance tweaks to the Java runtime. For example, we've sped up many reflective operations by up to 10x resulting in improvements on the order of 10% for applications based on dynamic languages. As always, there are a few other minor changes and bug fixes in this release, so make sure to read our release notes (Python, Java).



If you've been following the App Engine Java runtime group, you may have noticed some discussions about performance of the Java runtime. Many of you have complained about hard-to-predict DeadlineExceededExceptions, or unexpectedly slow requests that use a high amount of CPU. These issues often have the same root cause: App Engine is preparing a new instance of your code to respond an incoming request. We call this occurrence a "loading request". Since App Engine provides server resources on demand, there are several reasons why you might experience a loading request ...
If you've been following the App Engine Java runtime group, you may have noticed some discussions about performance of the Java runtime. Many of you have complained about hard-to-predict DeadlineExceededExceptions, or unexpectedly slow requests that use a high amount of CPU. These issues often have the same root cause: App Engine is preparing a new instance of your code to respond an incoming request. We call this occurrence a "loading request". Since App Engine provides server resources on demand, there are several reasons why you might experience a loading request:


  1. You just uploaded a new version of your application.

  2. Your application may have gotten no traffic recently.

  3. Your traffic has become high enough to need another JVM to scale.


You can expect that during the course of developing your application, you will often experience the first two scenarios. In comparison, for a production app receiving even a very small but steady amount of traffic, loading requests are relatively infrequent.



As an application developer, you can influence the length of your loading requests by controlling the amount of work done initializing your application and its dependencies. The App Engine team has also been working diligently on the Java runtime to reduce the time spent in loading requests.



First, we're introducing a new class-loading optimization in 1.2.8 called precompilation. Precompilation makes loading requests faster by doing class-loading work ahead of time in the App Engine environment. We've seen significant improvements with precompilation, but we've left it opt-in by default for 1.2.8. You can enable it for your application by adding precompilation-enabled to your appengine-web.xml:

<precompilation-enabled>true</precompilation-enabled>

Second, we've been profiling applications with longer loading requests. Often they include large dependencies like Groovy and JRuby. We're working directly with those teams to improve startup by spotting and reducing unnecessary initialization.



Finally, we're continuing to work on additional startup improvements we hope to unleash on the Java runtime in the future, and make it easier to identify loading requests in application logs. We will continue to pay close attention to performance issues that both Java and Python developers see, both through changes to our APIs and to our service.



For more information on how to understand the performance of your Java applications, check out the set of frequently asked questions we've collected and answered about performance characteristics of the Java runtime. Also check out Max Ross's recent post on the performance of the new != and IN filters in JDO and JPA.



The App Engine team has been hard at work tackling our the issues on our tracker, tweaking APIs and closing bugs. In addition to a ton of bug fixes, 1.2.8 also includes ...
The App Engine team has been hard at work tackling our the issues on our tracker, tweaking APIs and closing bugs. In addition to a ton of bug fixes, 1.2.8 also includes:



Enhanced Admin Console - Users will notice new tools for managing tasks and queues created with the Task Queue API, and more visibility into index processing.



Improved Java Compatibility - This release adds support for new filter operators and inheritance to JPA and JDO as well as support for JAXB, the single most requested feature for the Java SDK.



This was also the first release we "previewed" with developers before formally rolling out changes. Thanks very much to all the developers that gave us feedback on the preview release. And if you're interested in helping with future prereleases, please subscribe to the discussion groups to see preview release announcements.



1.2.8 is now available for both Python and Java developers. Take a look at our release notes for details on all the changes included in this release.