Google App Engine for Java — First Impressions

April 9th, 2009

Today’s big news is Google’s announcement for Java support on the App Engine. At Ringful, our hardware strategy is two words: cloud computing. We have multiple apps on both Amazon EC3/S3 and GAE.

EC2 is obviously more flexible since it provides a virtualized Linux environment, where you can do anything you want. GAE, on the other hand, feels much more restrictive since it is basically an app server in a scalable infrastructure. For instance, up until today, Python on Django is the only application model supported on GAE. However, as we use both services, I have grown to like GAE a lot more than EC2:

  • GAE provides automatic scaling that would just add in more resources based on the real time load of your app; EC2 requires you to actually monitor the load and bring up additional servers yourself.
  • GAE’s restrictive programming model also forces you to write apps that are horizontally scalable; With EC2, you could well write apps that cannot scale at all no matter how many server instances you start. In another word, with EC2, there could be well a false sense of scalability — until you really hit a traffic spike …
  • GAE is truly usage based — it only charges for CPU cycles that are actually used, as opposed to EC2 which charges CPU time as long as your virtual machine is up, even if it is idle. That makes GAE potentially a lot more cost effective for small apps.

So, in short, I am very excited that Java finally comes to GAE. I immediately applied for Java support in GAE accounts and wrote a couple of small apps to try it out. Overall, it feels great. I am definitely porting my Python apps to GAE Java as soon as I get around to do it. :) Here is a short summary of my first impression.

The good

* It is based on the standard JDK — not the mutilated Android Java stuff as once rumored.

* Standard servlet + JSP + JSTL stack for web apps. The same kind of setup Tomcat ships out of the box, and should be sufficient for a lot of apps.

* GWT integration if you want an advenced web framework to use with your app.

* JPA support for data persistence in Google’s BigTable.

* Standard WAR deployment. That allows developers to use any tool of their choice — ANT, Maven, Eclipse, NetBeans — as long as it can build standard WAR files.

* Most JVM languages, such as JRuby, Jython, Groovy, and Scala, are already working since the runtime is standard JDK-based.

* A lot of frameworks are already working — or can be made to work with some tweak.

* Cron and scheduler support out of the box. It is a lot better than EJB Timer.

* Direct integration with Google’s data APIs for user authentication, email sending, image manipulation and much more!

The bad

* Most of the Java EE stuff is not supported. Noticeably missing are RMI, JDNI, and JDBC. That means commonly used frameworks such as session beans and Hibernate are not supported. I have heard that JSF 1.2 does not work out of box. I do not expect Seam to work out of the box either. Bummer.

* The persistence store is not a SQL database. I understand that a non-relational data store is needed to support the kind of scalability Google needs. But, BigTable does not even provide full text search! This is Google we are talking about! The lack of SQL supports means that you probably need to re-write significant amount of code if you are porting an app to/from GAE.

* The lack of access to file system would break a lot frameworks that uses XML configuration files — think Struts! But I expect this can be fixed with tweaks in the frameworks.

* The lack of the ability to create and manage threads is probably not a big deal, since technically you should not create threads yourself in a Java EE container anyway. But still, it would be nice to create threads that processes data in the background.

* The HTTP session support in the Java runtime uses BigTable to store session data as opposed to in-memory cache. There got to be a performance for this … But I guess they have to do it this way. In a truly load balanced environment, replicating in-memory sessions is a very complicated task.

* What is the deal with JDO? They really should focus the effort on getting better JPA support. ;)

* No JMS support is a bummer.

The ugly

There is really none I can think of! Despite my numerous mis-givings, Google did a great job bringing Java into a scalable infrastructure and provide very low hosting options for the masses. I look forward to developing more apps on this platform!

Win a free book at JavaRanch

March 31st, 2009

Jacob and I are promoting our “Seam Framework” book at JavaRanch this week. Stop by and ask a question in the JBoss Forum to win a free copy of the book. :) See you there!

Mobile Monday Austin Talk on iPhone app stores

February 24th, 2009

We had a very good Mobile Monday meeting tonight at Motive! The topic is rich applications and app stores. I did a presentation on the iPhone App Store. Due to popular demand, the presentation is here!

In the meanwhile, the Pinch Media presentation I was talking about is here: (I just find it remarkable that PinchMedia concluded that the majority of apps would not be supported by Ads — coming from a company that sells ads to make money!)

http://www.pinchmedia.com/appstore-secrets/

Additional resources on app store marketing:

* Ringtone apps and Financial Realities of the App Store

* Raising prices and Dropping prices

* But all those “ringtone app” complaints ignore the long tail in the app store

And finally, here are some stories from people who “made it” — it is actually not all that uncommon to strike it rich in the app store.

* iPhone game saves a family’s home

* $30,000 per day for iFart

* Austin-based small shop Pangea produced two iPhone games that have generated more than $1 million apiece

12,000 new users per day

February 18th, 2009

As iPhone developers, we all heard of success stories of people selling 10,000+ copies of their apps per day in the app store, making hundreds of thousands of dollars in mere weeks. I always wondered what it is like to have a truly popular application in the app store. Well, now I know. :)

Just a week after we released Hook Mobile’s Multimedia Messaging app, it’s download number has skyrocketed to 12,000+ / day, and it is still accelerating! At this rate, we will have one million users in a quarter. Those are not your average “web users” — they are people who downloaded the application to their phone, and confirmed their phone numbers with us!

Okay, the Multimedia Messaging app is free and we are not exactly making a load of money yet. And, as the reviews indicate, there are a fair amount of problems (partly because we never anticipated this amount of traffic to hit our servers and support staff in such short time!) But to me, this is an eye opener on what a successful iPhone application can do. A lot of lessons learned that can hopefully help us market other for-pay applications. :)

Onward!

“Seam Framework” Finally came out in Paperback (and spotted in China)

February 7th, 2009

I just received a hard copy of my book “Seam Framework” from my publisher today. That means you should be able to get it from Amazon and Barnes and Noble very soon. :)

The book is the “second edition” of the original JBoss Seam book I wrote back in 2006, which was a JavaOne and Amazon best seller. But, it is much more than a “sequel” of the original book, my co-author Jacob Orshalick has made many major contributions to the book to address the latest and greatest features in Seam and WebBeans. Check it out!

The picture shows both the original “JBoss Seam” book and the “Seam Framework” book side by side — the photo on the cover of the original book was taken by Ju during our trip to the Death Valley in 2005.

Two books

In a related story, my friend Norman Richards (also a core developer on the Seam team) spotted the Chinese translation of the original Seam book while he was in vacation in China last month. Now, anyone in China wants to buy one and send to me? :)

iPhone Pwning notes

January 27th, 2009

Okay, I finally bit the bullet and pwned an iPhone. No, I did not try yellowsn0w to jailbreak my 3G iPhone — although I might do it now since I enjoy the jailbroken iPhone so much. :) What I did was to jailbreak a brand new unused 1st-gen iPhone and update to firmware v2.2. The result is a jailbroken iPhone that can be used with any SIM card or even without a SIM card (to function as a Wifi device). This sounds simple but it is not. I just want to share some notes here in case other people encounter similar issues.

I first tried the obvious: QuickPwn. The issue with QuickPwn is that it does not actually update the firmware. It just jailbreak whatever firmware that is already on the iPhone. Since I want firmware v2.2 and the iPhone is shipped with v1.x, I have to upgrade the firmware somehow. To make matters worse, iTunes 8.0.3 no longer gives the option to “update” an iPhone firmware without activating it. The first screen I see when I plug the iPhone to iTunes is the activation screen. Fine. I just put my iPhone into DFU mode (the “hold both Home and Power for 10 sec, and then hold just Home for another 10 sec, while the phone is plugged in” maneuver), and plugged the DFU iPhone to iTunes. Now, iTunes detects the iPhone in “recovery mode” and offers the option to “restore and update”. I proceeded to update to v2.2.

Next is to run QuickPwn 2.2. It ran smoothly, showed the “ihaz success” message, and rebooted the iPhone. Good? No. The first sign of problem is that the iPhone still showed Apple logo instead of the Pineapple logo when it rebooted. Sure enough, it only shows the “emergency call” screen after booting up. The phone is NOT activated. I am not sure what went wrong in the process. Maybe the iPhone is too old to be jailbroken by the latest QuickPwn? I downgraded the iPhone to 1.1.4 and tried QuickPwn 1.1 again — no luck, same result.

If QuickPwn does not work, I am left with the good old but more complicated Pwnage Tool. Make sure that you download one of the firmware from the same download page as well, since Pwnage Tool actually modifies the firmware and uses iTunes to re-flash the iPhone. Naturally, I downloaded firmware v2.2. It is actually quite straightforward to run the Pwnage Tool. I ran it in the “expert mode” so that I can confirm all the selected options (e.g., I need to make sure that “Activate the iPhone” box is checked!). Once Pwnage builds a new firmware and saves the ipsw file to your disk, it will instruct you to put your iPhone into DFU mode again. Then in iTunes, you “opt click” on the “restore” button, and choose the firmware you just saved from Pwnage to restore.

The first time I did this, iTunes complained a “1600 error”. So, I went back to Pwnage and re-build a new ipsw without selecting the “replace Bootneuter” option — I do not really know what it does, just some random experiment. ;) This time iTunes worked without any error. The restore process takes a while. After it is done, the phone reboots and re-flashes itself. Done! Jailbroken, unlocked, and activated iPhone with Cydia installed!

So, how do I like the jailbroken iPhone? Well, that will be the topic for the next post …

How much can a top earning iphone developer make from app store?

November 15th, 2008

The answer is 3 to 20 million dollars per year.

I had the chance to sit on the iPhone panel with Brian Greenstone at InnoTech a couple of weeks ago. Brian runs a very small (one man?) development shop that has so far produced 3 iPhone games that are in the top 10 list. His game Cro-mag Rally was the #1 iphone game for many weeks. So, he speaks with authority when it comes to sales figures of top iPhone app store applications.

According to Brian, the #1 paid app in the app store generates around 8000 downloads per day. The number drops to around 2000 per day if you are #25. Consider that many top apps have been selling for between $5 to $10 a piece. Considerring that apple takes 30% from the top, you can see how I arrive at the 3 to 20 million range for profits.

Of course, a big assumption is that your app can stay in top 25 all year long. That is difficult but not impossible. In the end, it is relatively simple to write an iPhone app (as opposed to a PS3 game or a full enterprise app). As Brian has demonstrated, given the talent, it is possible to have multiple hits from even a one man shop.

And we have not even touched free apps in the app store. Free apps see much higher download numbers than paid apps. But their revenue is hard to measure since it indirect. My guess would be that a lot of those popular free apps are also making decent money via “off deck” subscription payment and advertisement. In fact, that is exactly what I plan to do with my “yet to be approved” iPhone apps. Stay tuned! :)

Why do I support Obama for President?

November 1st, 2008

Ever since we put an Obama campaign sign in our front yard, I kept getting questions from neighbours and friends: why do you go against your own self interest to support Obama? Haven’t you read his tax plan? Indeed, my own short term financial interests suggest that I should NOT support Obama:

* He already said that he will raise tax for families making $250k per year (or, was it $200k?). Either way, we can fully anticipate our income tax to go up under Obama.

* Obama’s tax plan is also not very friendly to small businesses. As I am starting my own company in a reccession, this is the last thing I need.

I hate higher tax as much as the next guy. But, I am supporting Obama since he at least is honest about the tax sitution. Bush has created a trillion dollar debt for the country. The US borrowed so much money from China –it is not even funny. The money to pay the debt and it’s interest will have to come from somewhere. What alternative do we have?

Let’s say that McCain keeps his promise not to raise tax on anyone. Let’s say that he manages to cut all the $18B / yr so-called “pork spending”. He is still not nearly close to find the money to pay the debt. Let alone the fact that McCain would like to spend $120B / yr of tax money indefinitely in Iraq. The pork McCain talks about so much is a rounding error for what he wants to spend on the useless war.

So, under the McCain plan, the only choice would be to let the US dollar slide in value — as it did all through the Bush years. This way, we run a cruel scam on China — the debt China holds will be worth much less since it is calculated in US dollars. Do you think China will continue to lend money to the US if this happens?

A much weaker dollar also has very bad consequences for everyone living in America. Think about higher costs for everything, and drastically reduced the standard of living.

In the end, Obama might have to raise tax and borrow even more money to create government spending that compensates the weak consumer spending. He may even need to raise tax on people making less than $250k a year. None of these is pretty. But it at least is a honest plan.

I truely believe that we need a president who can talk about shared sacriface to get us through the crisis, as opposed to someone who promise even more fantasy of “tax cuts”.

Busy conference schedule next week

October 12th, 2008

Next week is a busy week for me. I will be attending both the Texas Wireless Summit and InnoTech conferences. I am invited to participate in the Seed Stage Form at TWS and an iPhone panel at InnoTech. Ping me if you are in town for either events and would like to meet up!

To see more details on exactly what I will be talking about, please visit my new blog focusing on mobility and mobile / social mashup technonologies.

http://www.mobilitymashups.com/

I also plan to update this blog more often to discuss Java / Seam / server-side related topics. Stay tuned for both blogs! :)

Vote for sessions you want to see in SXSW interactive

August 9th, 2008

The SXSW interactive conference has this great tradition of letting “the crowd” have a say in shaping up the conference programs. You can do so by getting on to the panel picker web app and rate the 1200+ proposals they have received for SXSW 2009.

I went over the proposals and found many great session ideas. This definiately gonna be a great conference!

In the menwhile, please vote up my proposals on iPhone related talks! :)

Speaking in JSF One conference

August 9th, 2008

I will be speaking in the JSF One conference in the Washington DC area next month. I will speak on the topics of Seam and iPhone web development with JSF. See y’all there!

First post from the wordpress iphone client

August 9th, 2008

I finally upgraded my wordpress to v2.6 so that I can blog from my iPhone wordpress application. Horray!

Multi-modal and iPhone presentation at Mobile Monday

April 17th, 2008

I gave a talk at this week’s Mobile Monday on how to adapt web applications in the age of the iPhone. Quite a few people liked enough to ask me for the slides. :) So, here you go …

MobileWeb-momo-2008.pdf

BTW, do not forget to join the Austin iPhone developer group, if you are interested in iPhone dev:

http://groups.google.com/group/iphone-austin

It is a mailing list for now. But we will have face to face meetings (probably in junction with Mobile Monday) in the future …

TheServerSide (TSS) Java Symposium on your phone

March 19th, 2008

TheServerSide Java Symposium is one of the premium conferences in enterprise Java. No matter whether you are attending the conference or not (I certainly hope you do attend and come to my talk on Friday :)), you can now keep track of the latest happenings in the conference on your mobile phone.

For conference attendees, you will get instant access to

* the session schedule
* speaker’s blogs
* TSS front page stories / comments / tech articles
* community reactions
* Las Vegas local information (news and show schedules)
* and more …

All these on your iPhone / Blackberry / Windows Mobile / Nokia, without taking out your laptop and struggling with the often flaky hotel wiki. For those of you who do not attend but still want to keep track of the latest happenings, this is a great tool to keep yourself updated (and entertained) when you are at lunch or in public transit.

All access is free and no registration is required. Here is what you do. You can load the following URL directly on your mobile phone. It displays differently on different phones and automatically adapt to a format that is most suitable for your phone.

http://WebClip2Go.com/tssjs (Try web-based iPhone emulator, Safari and Firefox only)

Or, if you do not want type the long URL. Send a SMS text message tssjs to phone number 41411 and open the link in the returned text message. iPhone users: do not forget to bookmark the site on your home screen!

Picture 51.pngScreenshot0119.jpg

Finally, the entire application is written in the enterprise Java stack (JSF + Seam, no less). The underlying technology is WebClip2Go — a community effort sponsored by eZeeLabs to bring the regular web to all mobile phones. I will discuss it in detail in my presentation in TSSJS.

Please send me any comments you have about this conference guide. If you are a speaker and do not see your blog on my list, please contact me and I will get you added in time for the conference!

Keep track of SXSW parties on your phone!

March 8th, 2008

One of the great things about SXSW is the vibrant party scene! There are literally over a hundred vendor parties during that week in places all over the Austin downtown. How do you keep track of all these parties? Well, with the SXSW Mobile Companion http://webclip2go.com/sxsw08 (try iPhone), you can track those parties right there on your phone!

First off, we make it really easy to view the conference’s “official” parties on your phone. Just click on the “Official SXSW Parties” link from the web page. Here is how it shows on my Nokia.

nokia-parties.png

Of course, the official parties are only a tiny portion of the SXSW party scene. A good place to find all SXSW parties is the Upcoming.org service from Yahoo. We adapted the upcoming service for mobile and displays SXSW related parties by day as they are announced or changed. Here is how it looks on the iPhone.

iphone-parties.png

Keep track of your parties!