OpenCms and Google App Engine
Especially with the new JPA driver for OpenCms by Georgi Naplatanov the question of running OpenCms on Google App Engine came up quite often at the OpenCms Days 2009. I had the same Idea when I first heard of the Java support for App Engine and did some quick research on how to do this. The research showed that running OpenCms on Google App Engine would require a huge rewrite of some OpenCms core functionalities.
The problem with OpenCms and App Engine is that the applications on App Engine run in a restricted sandbox which limits what you can do in terms of Java API functionality. There’s also a JRE whitelist which limits the classes you can access in your application. If you look at the scalability model promoted by App Engine these limitations make a lot of sense but unfortunately they make running OpenCms on there nearly impossible. You can find a detailed description of the App Engine runtime at Google code. The main problems are:
- No filesystem access: OpenCms uses the filesystem for some very important tasks:
- The JSP files are exported into the WEB-INF directory to be executable. This means there could be no dynamic updates or adds of JSP files through the workplace.
- The configuration is stored in the filesystem and dynamically updated if e.g. the search configuration is updated or a module is installed. The configuration would have to be stored in the database.
- The search index is stored in the filesystem. This could be circumvented if a Lucene database store like the one shipped with Compass is used. Nevertheless this would have to be implemented.
- No threading: OpenCms makes uses of threading for scheduled tasks, publishing and other tasks. Since App Engine doesn’t allow threads this would have to be implemented otherwise.
- Response-Time-Limit: App Engine imposes a time limit to handle request on the application. Escpecially the publishing mechanism in OpenCms causes very long response times. These parts would have to be rewritten.
- Persistent data has to be stored in the datastore: OpenCms uses an in memory HashMap to store the locking information (file locks). This makes it difficult to cluster OpenCms and also limits the use in Googles App Engine. This also affects the Flex-Cache: Publishing events would have to be propagated and I’m not sure if this would work with App Engine (comments are very welcome on this point).
I had a short talk with Alexander about this topic and it at least seemed to us that making OpenCms run on the App Engine would be an enormous task and is currently not worth doing without excessive sponsoring.
Tags: App Engine, Development, Google, Java, OpenCms
