CFML on Google App Engine for Java

Yesterday I gained access to the Google App Engine for Java, early release program, and as any CFML developer would do, I tried getting a CFML server (both Railo and OpenBD) to run on it. I posted some of my experiences on twitter, unfortunately I was unsuccessful.
You may have noticed that I didn't try running Adobe ColdFusion on there, there. I think it would be a license violation, since app engine runs on multiple servers I wouldn't know how many licenses I would need in order to run it legally (ps - Adobe if you want to send me a couple hundred licenses, I am fine with that).
So why doesn't it work?
Google has implemented a pretty tight security model on Google App Engine, as such you can't write to the file system, it is readonly. You can only store data using the Google Datastore API. This seams like an awful restriction, but when you consider that the servers are clustered, it makes sense, as they would have some expensive replication processes going on constantly.
Both Railo and OpenBD assume that they can create temporary files, write configuration, etc.
When you deploy an app and try to run a CFM, google simply serves the CFML source code back to you, which means the Servlet mapping is not working. I am guessing that is because it couldn't init() the CFML Servlet, but maybe there is also an issue with Servlet Mappings?
It's interesting to note that Google App Engine does support JSP, which is typically compiled into class files dynamically written to a temp directory. Google App Engine pre-compiles JSP files into class files when you deploy your application, so this dynamic compilation step is eliminated.
How do we get around it?
There are a couple ways I see that you can get around these issues to get CFML running on Google App Engine:
- Pre-Compiled CFM - ColdFusion 7 and 8 support sourceless deployment, which turns your CFM / CFC files into java class files. You should be able to get something like that working on App Engine.
- Custom Classloader - You could write a custom class loader, which would reimplement all of the Java File IO classes to use the Google DataStore API. This would not be terribly easy, but I think it would be pretty useful, and I wonder why Google hasn't provided such a mechanism? It could possibly be mapped to a special path, eg: /google-datastore/myfile.txt
- Modify the CFML Engine - The final option would be to modify the CFML engine to not rely on the filesystem, or to use the Google Datastore API.
The Race is on
I have talked to Mark Drew at Railo, and Matt Woodward of OpenBD, both have investigating it. Who will be the first to get it running?
Update: OpenBD has been successful in getting it to run on Google App Engine. They have a separate build you can download for use on Google App Engine.
Related Entries
- Serializing CFC's in ColdFusion 8 - August 6, 2007
- Reverse IP Address Lookup with ColdFusion + Java - January 10, 2007
- How to Design a Good API and Why it Matters - March 20, 2006
- Null Java References in CF 6 vs 7 - January 10, 2006
- DNS Query with ColdFusion - October 27, 2005
Trackbacks
Trackback Address: 697/FA258B48664D4849270D34CDE1972AA7
Comments
On 04/10/2009 at 9:19:48 AM EDT Steve Judd wrote:
1
I'd be very interested in this. I learned a bit of Python so that I could write an AppEngine application. You need to make changes to your mentality, vs CFML. Datastore access is relatively expensive in terms of CPU, especially for writes. I made extensive use of memcache (CF equivalent for AppEngine?) And as you said, there would need to be a connector to get cfquery to work with big table.
It'll be fun to see who can get it to work, unfortunately, I don't have the java chops to tackle it...
On 04/10/2009 at 9:24:12 AM EDT Pete Freitag wrote:
2
@Steve - thanks for posting, its good to see that there is interest for this. I think that is one thing that people from both Railo, and OpenBD are looking for. Before they invest a lot of time in this, they want to see the interest.
So folks if you are interested please post a comment.
On 04/10/2009 at 10:06:29 AM EDT Phil wrote:
3
This is very interesting, thanks for posting your findings.
I'm very curious what the advantages GAE offer us as CF devs over AWS.
Given that CF is running fine in Amazon's cloud - especially through value added services Stax.net and Mor.ph. Why would I want or need to run on GAE? (I even have relational DB support on those)
That answer should also give priority for openBD and Railo to add support to GAE, if there isn't a killer reason I'd rather have them working on issues/enhancements.
And who knows, maybe the issues will fix fix themselves on the Google end.
On 04/10/2009 at 2:24:40 PM EDT Richard Davies wrote:
4
Thanks for sharing this. I also was recently approved for the Java GAE beta, and wanted to try this. But I didn't have time to try it yet, so thanks for saving me some time. ;-)
On 04/11/2009 at 2:31:11 AM EDT Ian Buzer wrote:
5
Don't know if this will help but Gert Franz blogged some time ago about getting Railo to run on a CDROM, therefore overcoming the need to write to disk:
http://www.railo.ch/blog/index.cfm/2007/7/26/Railo-Readonly--Start-Railo-from-a-CD
Ian
On 04/12/2009 at 6:38:21 PM EDT Alain Yap wrote:
6
Anybody know of some post comparing how this turns out using AWS thru Mor.ph or Stax?
Thanks, Pete!
Best.
On 04/12/2009 at 8:45:11 PM EDT Joey wrote:
7
I just tried the CD-Rom Version on the app engine with no results. Very interested in getting the appengine working with CF. Groovy got it done.
On 04/13/2009 at 7:30:27 AM EDT Pete Freitag wrote:
8
Vince Bonfanti posted a message on the OpenBD mailing list saying he has heavily modified OpenBD to get it working on the GAE. http://groups.google.com/group/openbd/browse_thread/thread/a9da36320b64d5d6
On 04/13/2009 at 7:34:24 AM EDT Pete Freitag wrote:
9
@Phil - I think the main differences between GAE and solutions like Stax (which looks pretty cool BTW) will be price points. GAE has a free initial pricing model right now, we don't know how Stax will be priced yet, but to me that looks like an advantage for GAE since developers can play and deploy for free.
I think the main advantage for stax is that the developer doesn't feel locked into proprietary technology, as you might on Google App Engine.
Either way, this will be very interesting to follow.
On 05/28/2009 at 7:01:06 AM EDT zhou wrote:
10
I agree with Pete, free certainly got my attention. With SDK for Java 1.2.1 is out, I hope there is a solution soon for CF
Post a Comment
Recent Entries
- Cache Template in Request Setting Explained
- What Version of Java is ColdFusion Using?
- ColdFusion 9 Performance Brief from Adobe
- Request Filtering in IIS 7 Howto
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion
It'll be fun to see who can get it to work, unfortunately, I don't have the java chops to tackle it...
So folks if you are interested please post a comment.
I'm very curious what the advantages GAE offer us as CF devs over AWS.
Given that CF is running fine in Amazon's cloud - especially through value added services Stax.net and Mor.ph. Why would I want or need to run on GAE? (I even have relational DB support on those)
That answer should also give priority for openBD and Railo to add support to GAE, if there isn't a killer reason I'd rather have them working on issues/enhancements.
And who knows, maybe the issues will fix fix themselves on the Google end.
http://www.railo.ch/blog/index.cfm/2007/7/26/Railo-Readonly--Start-Railo-from-a-CD
Ian
Thanks, Pete!
Best.
I think the main advantage for stax is that the developer doesn't feel locked into proprietary technology, as you might on Google App Engine.
Either way, this will be very interesting to follow.



add to del.icio.us



