<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mr Blog &#187; appengine</title>
	<atom:link href="http://mrblog.org/tag/appengine/feed/" rel="self" type="application/rss+xml" />
	<link>http://mrblog.org</link>
	<description>Mr Blog.  Very technical, or silly, sometimes absurd.</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:37:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Wow am I happy now that I didn&#8217;t deploy serious apps on Google App Engine</title>
		<link>http://mrblog.org/2011/09/13/wow-am-i-happy-now-that-i-didnt-deploy-serious-apps-on-google-app-engine/</link>
		<comments>http://mrblog.org/2011/09/13/wow-am-i-happy-now-that-i-didnt-deploy-serious-apps-on-google-app-engine/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 20:54:46 +0000</pubDate>
		<dc:creator>MrBlog</dc:creator>
				<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[google app engine]]></category>

		<guid isPermaLink="false">http://mrblog.org/?p=1435</guid>
		<description><![CDATA[First released in 2008, Google App Engine (GAE or AppEngine) was Google&#8217;s first attempt to compete with Amazon Web Services in providing cloud computing platform services for developers. In earlier posts, I took some heat for concluding that Google App Engine was not ready for &#8220;serious&#8221; applications, even when it was &#8220;free&#8221;. Recently, Google announced shocking new pricing [...]]]></description>
			<content:encoded><![CDATA[<p>First released in 2008, <strong>Google App Engine</strong> (GAE or AppEngine) was Google&#8217;s first attempt to compete with <a title="Amazon Web Services" href="http://en.wikipedia.org/wiki/Amazon_Web_Services">Amazon Web Services</a> in providing cloud computing platform services for developers. In earlier <a href="http://mrblog.org/2009/10/16/twitmart-ported-off-of-google-app-engine/">posts</a>, I took some heat for concluding that Google App Engine was not ready for &#8220;serious&#8221; applications, even when it was &#8220;free&#8221;.</p>
<p>Recently, Google announced shocking new pricing for appengine that has its <a title="Keep it short: Who is forced to leave GAE?" href="https://groups.google.com/d/topic/google-appengine/obfGjbIkOTI/discussion" target="_blank">users reeling</a>. In short, the new pricing means:</p>
<ul>
<li>“Free” quotas have been drastically reduced</li>
<li>Pricing of paid apps increased significantly</li>
<li>SLA and operational support available for a premium</li>
</ul>
<p>Google has provided a tool so customers can compare their current bills versus expected billis under the new pricing and customers report anywhere from 3x to 30x price increases, leaving many scrambling for alternatives.</p>
<p>Two of the most common complaints from customers are lack of notice and the uncertainty of the pricing (lack of control over costs).</p>
<p>In terms of cost control, the only way to know how much your costs are, is to ask Google, after you have already incurred those costs (and built and deployed your app). It&#8217;s impossible to map users or usage directly to cost. Google&#8217;s pricing scheme is as inscrutible as the worst telephone company billing.</p>
<p>The pricing was originally planned to take effect in September, which only gave customers a few weeks to react. Google has provided optimization guidelines for customers to try to reduce their costs, but given the short notice, customers simply do not have time to make major changes to their apps. Companies already had their development resources planned out. They aren&#8217;t sitting around waiting for Google to throw a wrench at them. And it&#8217;s not clear how much further optimization will really save you anyway since a lot of apps have already received cost-cutting optimizations.</p>
<p>To me, I think this goes a long way to confirm some of my concerns about Google as a cloud platform vendor and as an enterprise vendor in general. A lot of people think anything Google touches is golden (especially Google, just ask them), but I think this shows how they still just don&#8217;t get it when it comes to providing commercial grade services. I have asked before, regarding many Google products, whether Google was serious this time. This is the risk to me of doing any business with Google. All these other non-search products are simply &#8220;tests&#8221; for them. A few billion here, a few billion there, throw it out and see what sticks. The problem is, if you latch on to one of these products and then it becomes critical to your business, you just never know when Google might, on a whim, go in a different direction, hanging you out to dry.</p>
<p>And that appears to be how a lot of customers feel about this move by Google, such as expressed in this <a title="App Engine is finished, here's why" href="http://groups.google.com/group/google-appengine/browse_thread/thread/9a20d89a23ea18e0/695c8642e4fbb703?lnk=raot&amp;pli=1" target="_blank">post</a> on the mailing list:</p>
<blockquote><p><strong>App Engine is finished, here&#8217;s why</strong></p>
<p>What has always been the biggest concern about App Engine? Lock-in. You&#8217;re at the mercy of Google. Sure there&#8217;s TyphoonAE etc&#8230; but really those are not alternatives.</p>
<p>What does Google go ahead and do? They do exactly what their critics said they would do and what us GAE adopters hoped like hell they would never do, screw us over.</p>
<p>App Engine is finished not because we&#8217;re all going to move off to EC2, but because people who are considering using App Engine will see exactly what has gone on here with the pricing, think about the lock-in argument against GAE, and decide not to use GAE. There will be a drop off in new apps, and eventually Google is going to see GAE isn&#8217;t really panning out and pull the 3 year plug.</p></blockquote>
<p>Thankfully, I don&#8217;t operate any services on GAE with high costs, but even as it is, I feel ripped-off for my investment in AppEngine. I do run some services on it, some of which I would rather not have to shut down, so I might have to move those elsewhere. And there are some apps I will simply shut down because they are not worth the trouble to port elsewhere. Some of those apps were potentially interesting and gathering users &#8211; in that sense, I&#8217;m glad this move by Google is happening now, before these apps got big enough to have to now decide what to do with them.</p>
<p>What&#8217;s worse for me though, is simply all the time invested in learning AppEngine. What a waste of time that appears to have been. As one developer <a href="http://news.ycombinator.com/item?id=2955813">says</a>:</p>
<blockquote><p>The biggest complaint is that when my friends and peers objected to App Engine, its strange requirements and its potential lock in, <em>they were right and I am a fucking naive idiot</em>. And I really don&#8217;t like to be proven a naive idiot. I put my faith in Google&#8217;s engineers and they have <em>utterly destroyed my credibility</em>. THIS more than anything is the <em>cost</em> to me.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mrblog.org/2011/09/13/wow-am-i-happy-now-that-i-didnt-deploy-serious-apps-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Twitmart ported OFF of Google App Engine</title>
		<link>http://mrblog.org/2009/10/16/twitmart-ported-off-of-google-app-engine/</link>
		<comments>http://mrblog.org/2009/10/16/twitmart-ported-off-of-google-app-engine/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 16:39:45 +0000</pubDate>
		<dc:creator>MrBlog</dc:creator>
				<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[appengine]]></category>

		<guid isPermaLink="false">http://mrblog.org/?p=1004</guid>
		<description><![CDATA[I discussed a few weeks ago how I had ported the Twitmart.org site to Google App Engine for Java as an experiment.  This was an excellent learning experience.  Unfortunately, the performance on App Engine was simply unacceptable, so now the site is back off of App Engine and running on one of my own servers [...]]]></description>
			<content:encoded><![CDATA[<p>I discussed a few weeks ago how I had <a href="http://mrblog.org/2009/10/01/experimenting-with-google-appengine-for-java/">ported the Twitmart.org site to Google App Engine for Java</a> as an experiment.  This was an excellent learning experience.  Unfortunately, the performance on App Engine was simply unacceptable, so now the site is back off of App Engine and running on one of my own servers again.</p>
<p>You can actually compare the difference side-by-side by comparing the performance on a native Java web server (Jetty) platform vs. the exact same code running on App Engine:</p>
<p style="padding-left: 30px;">Java Jetty &#8211;&gt; <a href="http://twitmart.org" target="_blank">http://twitmart.org</a><br />
Google App Engine &#8211;&gt; <a href="http://" target="_blank">http://twitmart.appspot.com</a></p>
<p>This shows pretty clearly that the performance issues aren&#8217;t Twitter (most of the time) nor are they in my Java webapp implementation. The same code is running on both platforms. Nor is it hardware &#8211; the machine running Twitmart.org is a very modest server that is hosting a large number of other sites.</p>
<p>The showstopper problem for <strong>Twitmart</strong> on App Engine is that Twitmart.org is a Twitter mashup using the the Twitter API. It turns out that Twitter API calls from App Engine fail frequently. I&#8217;m not sure why. It should not be due to throttling as the app uses authentication but on the other hand it could possibly be that Twitter is overwhelmed by API calls from the App Engine platform and therefore throttles the entire Google infrastructure. I think the most likely answer is just that App Engine has problems making API calls (HTTP requests) in general, because I&#8217;ve seen this same problem to other APIs besides Twitter from App Engine, such as the <a href="http://mrblog.org/2009/01/30/google-app-engine-teases-but-ultimately-doesnt-deliver/">issues we had with the Taglets API</a>.</p>
<p>Regardless, it&#8217;s bad for App Engine and Twitter Mashups. It means Google&#8217;s platform is not useful for Twitter mashups or any kind of mashups. That sucks and makes the platform much less useful in general.</p>
<p>Beyond that showstopper issue for Twitmart.org (and all Twitter mashups considering using Google App Engine), is the performance / consistency in general. For no clear reason, about 20% of requests just take a ridiculous amount of time on App Engine, even to do the simplest thing. E.g. a url that simply renders a template, that usually takes sub 100ms, will about 20% of the time, take 3-5 seconds or more. That&#8217;s simply too high of a &#8220;near-fail&#8221; rate for a &#8220;serious&#8221; application.</p>
<p>I hope that Google does address these issues and start to take serving &#8220;important&#8221; applications seriously. The idea of cloud computing in general, and Google&#8217;s &#8220;App Engine&#8221; approach specifically, is really cool. It&#8217;s very attractive to have someone else taking care of the servers, the network, patches, etc. However, there is a certain performance bar the service has to meet too, and unfortunately, Google isn&#8217;t making it yet, even for the price of &#8220;free&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrblog.org/2009/10/16/twitmart-ported-off-of-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Introducing Quick Bit Notes</title>
		<link>http://mrblog.org/2009/10/12/introducing-quick-bit-notes/</link>
		<comments>http://mrblog.org/2009/10/12/introducing-quick-bit-notes/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 04:59:15 +0000</pubDate>
		<dc:creator>MrBlog</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://mrblog.org/?p=970</guid>
		<description><![CDATA[I&#8217;ve released Quick Bit Notes (QBN) as an experiment in an unconventional method of person-to-person asynchronous communication. One person drops off a personal note for another person. That note is stored and presented in image form to the recipient. The actual text is never stored on QBN and never transferred over the wire when the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released <a href="http://quickbitnotes.appspot.com/">Quick Bit Notes </a> (QBN) as an experiment in an unconventional method of person-to-person asynchronous communication. One person drops off a personal note for another person. That note is stored and presented in image form to the recipient. The actual text is never stored on QBN and never transferred over the wire when the recipient views the message.</p>
<p><img class="alignnone size-full wp-image-978" title="twoposts" src="http://mrblog.org/wp-content/uploads/2009/10/twoposts.png" alt="twoposts" width="472" height="49" /></p>
<p>QBN offers an alternative to complicated software, shared keys, and so on. All one needs to use the service is a browser and Gmail email account.</p>
<p><img class="alignnone size-full wp-image-980" title="personal" src="http://mrblog.org/wp-content/uploads/2009/10/personal.png" alt="personal" width="548" height="90" /></p>
<p>The service is running on <a href="http://mrblog.org/2009/10/01/experimenting-with-google-appengine-for-java/">Google App Engine for Java</a> and is available as open-source on Google code: <a title="Quick notes-as-images messaging system" href="http://code.google.com/p/quickbitnotes" target="_blank">http://code.google.com/p/quickbitnotes</a>. It should be relatively easy to deploy in your own App Engine appspot &#8220;slot&#8221; (refer to the README in the source archive).  If you want to be an SVN contributor to the code, just let me know.</p>
<p><img class="alignnone size-full wp-image-985" title="encryption" src="http://mrblog.org/wp-content/uploads/2009/10/encryption.png" alt="encryption" width="526" height="76" /></p>
<p>In the process of developing Quick Bit Notes, I also created a small Java text-rendering library, based on NETpbm, that operates within the constraints of the Google App Engine JRE &#8220;white list&#8221;.  This is a stand-alone JAR that can be used with other App Engine projects and is also available as open source on Google Code: <a title="Lite Java package for rendering of text into a bitmap using simple bitmap fonts" href="http://code.google.com/p/litetext/" target="_blank">http://code.google.com/p/litetext/</a></p>
<p><img class="alignnone size-full wp-image-993" title="madrid" src="http://mrblog.org/wp-content/uploads/2009/10/madrid.png" alt="madrid" width="563" height="220" /></p>
<p>If you&#8217;ve followed along, by now you may see some applications of QBN for your own personal communications.  If you&#8217;re not seeing it yet, QBN is probably not for you, so please don&#8217;t waste your time or mine spending time on it. And, please, dear god, don&#8217;t ask me questions like &#8220;what&#8217;s the distribution strategy&#8221; or tell me all the reasons why this service will never take off and how Twitter is so much better. <img src='http://mrblog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mrblog.org/2009/10/12/introducing-quick-bit-notes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Experimenting with Google AppEngine for Java</title>
		<link>http://mrblog.org/2009/10/01/experimenting-with-google-appengine-for-java/</link>
		<comments>http://mrblog.org/2009/10/01/experimenting-with-google-appengine-for-java/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 00:10:12 +0000</pubDate>
		<dc:creator>MrBlog</dc:creator>
				<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[appengine]]></category>

		<guid isPermaLink="false">http://mrblog.org/?p=933</guid>
		<description><![CDATA[A while back, I noted that Google had announced that they would be supporting Java on their AppEngine cloud computing platform. I finally got around to working on a significant AppEngine for Java project (something beyond &#8220;hello world&#8221; or the demo &#8220;Guestbook&#8221; app). Working with my friend and colleague, and serious Java guru, Mark Petrovic [...]]]></description>
			<content:encoded><![CDATA[<p>A while back, I noted that Google had announced that they would be supporting Java on their AppEngine cloud computing platform. I finally got around to working on a significant AppEngine for Java project (something beyond &#8220;hello world&#8221; or the demo &#8220;Guestbook&#8221; app).</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/4nqMmG3TYtM&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/4nqMmG3TYtM&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Working with my friend and colleague, and serious Java guru, <a href="http://radioae6rt.wordpress.com/" target="_blank">Mark Petrovic </a> we decided that a good &#8220;Goldilocks&#8221; candidate, that was neither too big, nor too trivial, was the experimental service <a title="Twitmart is a free classifieds marketplace using Twitter." href="http://www.twitmart.org/about/factsheet" target="_blank">Twitmart.org</a>, a classifieds marketplace mashup, using Twitter APIs.</p>
<p>We decided that &#8220;porting&#8221; an existing web-based application rather than inventing a new one made more sense because this way we really didn&#8217;t have to think a lot about the design or functional specifications.  We already had them. We just had to think about how to implement to those specifications on a Java-based web application platform, and specifically, the Google AppEngine for Java platform.</p>
<p>With the <strong>Twitmart</strong> application, the first thing to address was that the site uses Restful-style urls (as opposed to a fully Restful architecture, for you Rest weenies). This introduces a number of issues. The AppEngine for Java platform implements the venerable, but now decade-old, <a title="the Java Servlet standard " href="http://java.sun.com/products/servlet/" target="_blank">Java Servlet API</a>. Servlets don&#8217;t naturally support the clean urls that are essential in modern web applications.</p>
<p>Bad =&gt; <code>/post.jsp?type=area&amp;hash=forsale&amp;postid=hKqo1</code><br />
Good =&gt; <code>/post/area/forsale/hKqo1</code></p>
<p>One way to go about this is to do it the old fashioned hard-coded way and manually parse urls and forward to servlets for the action. We considered doing so, as a last resort, but it would be painful and potentially a maintenance nightmare.</p>
<p>We had hoped to use <a title="Reference Implementation for building RESTful Web services" href="https://jersey.dev.java.net/" target="_blank">Jersey </a>but found that it was <a title="Thread on Jersey and Google App Engine" href="http://n2.nabble.com/Jersey-and-Google-App-Engine-update-td3668720.html" target="_blank">not quite there yet</a> in terms of compatibility with Google AppAngine, although it looks like there is progress and we will see at least a subset of Jersey supported on AppEngine at some point. For this project, we decided that the outstanding issues with Jersey on AppEngine were more than we wanted to deal with. Since <strong>Twitmart</strong> is a <em>web site</em> rather than a <em>web service API</em>, perhaps Jersey isn&#8217;t quite the right platform anyway.</p>
<p>Regardless, we went with <a title="Restlet Lightweight REST framework" href="http://www.restlet.org/" target="_blank">Restlet</a>, which does <a title="Restlet edition for Google App Engine" href="http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.html" target="_blank">support AppEngine in their latest unstable releases</a>. Going with Restlet meant that we also needed a compatible template engine to replace JSP. We went with <a href="http://freemarker.org/" target="_blank">Freemarker</a> which is supported as a <a href="http://www.restlet.org/documentation/snapshot/jse/ext/org/restlet/ext/freemarker/package-summary.html" target="_blank">Restlet extension</a>.</p>
<p>There are many Java libraries for accessing Twitter APIs. We went with <a href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4J</a> which appears to be the most AppEngine friendly (and it&#8217;s a nice, clean API too).</p>
<p>With all of these building blocks in place, the port of <strong>Twitmart</strong> to AppEngine for Java was mostly a matter of grinding it out. Here&#8217;s a bunch of stuff we learned in the process:</p>
<p style="padding-left: 30px;"><strong>Restlet, Freemarker, and Twitter4J work on AppEngine</strong></p>
<p style="padding-left: 30px;">The <strong>Twitmart</strong> application doesn&#8217;t exercise every part of any of these tools, but the basics clearly work. That&#8217;s nice to know. We will use these again on future projects.</p>
<p style="padding-left: 30px;"><strong>Servlets and Restlets can co-exist</strong></p>
<p style="padding-left: 30px;">A few of the operations that <strong>Twitmart</strong> does were better suited to traditional servlets. With some effort, we probably could have made them work as Restlets, but it was much quicker and easier to make them servlets, so that&#8217;s what we did. And it works. Servlet urls are directed to servlet classes in the usual way in the <code>web.xml</code> config while everything else is passed through the Restlet adapter/router class.</p>
<p style="padding-left: 30px;"><strong>The AppEngine Text class overcomes the 500-character limit of Strings in the datastore</strong></p>
<p style="padding-left: 30px;">The datastore will only accept Strings of up to 500 characters. To store larger text, one must use blobs. AppEngine provides a Text class that makes this pretty easy &#8211; but it does make your application more AppEngine specific. A Text object cannot be viewed in the datastore viewer (admin panel) and they cannot be indexed or queried.</p>
<div style="margin: 10px 60px 10px 60px; padding: 20px; background: #E0EEB6; border: 2px solid #666"><code>@Persistent(defaultFetchGroup = "true")<br />
private Text desc;</code></div>
<p style="padding-left: 30px;"><strong>It&#8217;s not that hard to put arbitrary Java objects into the datastore</strong></p>
<p style="padding-left: 30px;">The <strong>Twitmart</strong> application accepts images uploaded by users to display with classified ad postings. Since AppEngine has no writeable file system, these &#8220;image files&#8221; must be placed into (and retrieved from) the datastore.  This turns out to be pretty easy, as long as the size of the data conforms to AppEngine&#8217;s limits &#8211; e.g. 1MB per datastore entity (see <a href="http://code.google.com/appengine/docs/java/datastore/overview.html" target="_blank">http://code.google.com/appengine/docs/java/datastore/overview.html</a>)</p>
<div style="margin: 10px 60px 10px 60px; padding: 20px; background: #E0EEB6; border: 2px solid #666"><code>@Persistent(serialized = "true")<br />
private ImageFile imgfile1;</code></div>
<p style="padding-left: 30px;"><strong>Objects in the datastore have unexpecetd dependencies</strong></p>
<p style="padding-left: 30px;">I don&#8217;t know if  Java bytecode ends up in the datastore or not, but it kind of feels like it does. When we rearranged some classes, we discovered that datastore records using those classes failed with <code>ClassNotFound</code> errors. I guess we should have expected this, but it&#8217;s something to keep in mind &#8211; once something is written to the datastore, never move the class.</p>
<p>As I&#8217;ve <a href="http://mrblog.org/2009/01/30/google-app-engine-teases-but-ultimately-doesnt-deliver/">noted before</a>, the AppEngine datastore is not an RDBMS, despite providing a query capability that might make you think otherwise at first glance. The AppEngine datastore is based on the <a href="http://labs.google.com/papers/bigtable.html" target="_blank">BigTable</a> storage system. BigTable follows a very different philosophy than traditional RDBMS and, as a result, imposes <a href="http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html" target="_blank">many important restrictions</a>. Knowing this from prior work on <a href="http://www.taglets.org">Taglets.org</a> and <a href="http://www.facebook.com/apps/application.php?id=75215734266">other projects</a> on AppEngine for Python, I knew about these restrictions and, in fact, the <strong>Twitmart</strong> application <strong>doesn&#8217;t make any queries at all</strong>; it always <a href="http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Getting_an_Object_By_Key" target="_blank">retrieves objects (records) by key</a> and never via query.</p>
<p>Another lesson from our experience with the Python AppEngine was <em>&#8220;be prepared to move off AppEngine&#8221;</em> (for any number of reasons). This means trying to structure your application such that moving to a standard platform will not require a complete re-write. One place to start is to avoid any <code>com.google.appengine.*</code> imports. In the case of this <strong>Twitmart</strong> app, the only place we do that is for the special <code>com.google.appengine.api.datastore.Text</code> class (in order to store text strings larger than 500 characters). This is isolated to a couple of Java classes in this application, but in a larger app, or if such things found their way into too many places, it would be best to write abstraction libraries of some kind to make it easier to separate out AppEngine dependencies later.</p>
<p>The <strong>Twitmart</strong> app, as written, should run on any standard Java web application platform, such as Jetty, pretty easily. However, that said, while using JDO as the data management interface works, in theory, as a way to make your application work on AppEngine and on a standard platform, it might not turn out to be the best way, or the most common technique for managing data on standard web application platforms, in practice. In many cases, you would probably want to add an abstraction layer around your data models to make it easier to swap in different low-level APIs. I think in general, the AppEngine for Java platform makes this easier and more natural than the AppEngine for Python platform, where it takes a lot more effort to keep your app standard-platform ready.</p>
<p>The <strong>Twitmart</strong> port is not done. There are few functions left to implement and a few things still to fix in terms of better exception handling and related cleanup and enhancement, but the primary functionality is operational.  In practice, even with light usage, it is slower on AppEngine than it was on my own server, but I guess that&#8217;s the price you pay for &#8220;free&#8221; &#8211; so much for scaleable. I guess the theory is, on AppEngine it will show similarly poor performance for a dozen users as it does for 100,000 users. <img src='http://mrblog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Summary</strong></p>
<p>If I develop more AppEngine apps, I&#8217;m going to use the Java AppEngine for sure over the Python AppEngine. Unless there is some really compelling reason (like a specific library I want to use) I don&#8217;t see me writing another App Engine app in Python ever again.</p>
<p>While I still don&#8217;t think Google AppEngine is ready for anything too important yet, if it ever will be, having a Java version is a big step in expanding the possible uses of Google&#8217;s cloud computing platform, IMHO, and I will almost certainly deploy more experimental applications like <a href="http://twitmart.org">Twitmart</a> using AppEngine for Java in the future.</p>
<p><strong>References:</strong></p>
<ul>
<li> <a href="http://code.google.com/appengine/docs/java/overview.html">Google App Engine for Java</a></li>
<li><a href="http://www.restlet.org/">Restlet</a></li>
<li><a href="http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.html">Restlet edition for Google App Engine</a></li>
<li><a href="http://freemarker.org/">Freemarker</a></li>
<li> <a href="http://www.restlet.org/documentation/snapshot/jse/ext/org/restlet/ext/freemarker/package-summary.html">Freemarker extension for Restlet</a></li>
<li><a href="http://yusuke.homeip.net/twitter4j/en/index.html">Twitter4J</a></li>
<li><a href="http://twitmart.org">Twitmart.org</a></li>
</ul>
<p><strong>UPDATE October 16, 2009:</strong> The performance on App Engine was so poor that we had to move the Twitmart.org site off of App Engine and back to one of our own servers.  Details <a href="http://mrblog.org/2009/10/16/twitmart-ported-off-of-google-app-engine/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrblog.org/2009/10/01/experimenting-with-google-appengine-for-java/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

