This document discusses porting a 100k line Java application called Portofino to run on Google App Engine (GAE). It describes some of the main difficulties in porting to GAE including limitations of core platforms, startup time constraints, and sandbox limits. It outlines changes made such as using Cloud SQL instead of MySQL, the User API for authentication, and the Blobstore for file attachments. While some services like Datastore and Images were not used, Task Queues and Memcached could provide future benefits. Overall porting to GAE required architectural changes but gained the advantages of scalability and integration with Google services.
Driving Behavioral Change for Information Management through Data-Driven Gree...
Moving 100k Lines of Code to Google Cloud Platform
1. 2013.10.09 DevFest Lombardia 2013 @ Milano
How to put 100k lines of code in the (Google) cloud:
storms and rainbows
carlo.bonamico@nispro.it
paolo.predonzani@manydesigns.com
7. Who is using Google AppEngine and PaaS?
SaaS
Startups
Services in
marketplaces and
social network
eco-systems
IT departments
Cost savings,
scalability
Integration
(Gmail, Drive, etc)
Private cloud
7
8. GAE in private cloud
TCK (Test Compatibility Kit)
Google
CapeDwarf
Google AppEngine
API su JBoss AS7
JBoss
RedHat OpenShift
8
9. GAE architecture
Admin & accounting
Webapp
Datastore
Requests
Load balancers
Blobstore
Webapp
Webapp
Fetch API
Email
Search
Webapp
Images
Capabilities
Webapp
...
Dynamic instances
User API
...
Services
9
10. Development vs deployment environments
Deploy
Eclipse
IntelliJ Idea
GAE plugin (ufficiale)
GAE plugin
Develop
GAE SDK
10
11. Pros and cons: a matter of design priorities
Open vs proprietary
Scalability
Standards & compatibility
Reliability
Platform independence
11
12. Portofino: project overview
Name: Portofino
Type: Enterprise Application Platform
License: LGPL
Maintainer: ManyDesigns srl
Language: Java, Groovy, jsp
Stable version: 4.0.10
Development version: 4.1.beta5
Community members:
~100 on English mailing list
~60 on Italian mailing list
Total downloads: 35k
12
15. Portofino: a web-based development platform
The developer can edit db metadata,
create and configure pages,
set security, and edit Groovy,
all via web
An application wizard allows to
connect to an existing database in
30 seconds...
15
16. Porting P4 to GAE: main difficulties
Versions of core platforms and API:
Java 5 vs 6 vs 7
Servlet API 2.5 vs 3.0
Startup time:
Every request must complete in 60s
The first request includes the instance startup delay
Sandbox limits:
No java.awt.*
No threads
Readonly file-system
16
17. Porting P4 to GAE: what we have changed (1)
Java 5 -> Java 6 (with GAE <= 1.7.7.1)
Oracle/Postgresql/MS SQLServer -> forget it!
MySQL -> Google Cloud SQL
Authentication -> User API
Temporary files -> File Service
Scheduling: Quartz (internal) -> cron (external)
Charting: JFreeChart -> HTML 5/JS/SVG (client-side)
Pdf: iText -> PDFJet
Planned
Planned ?
Blobs: file -> Blobstore
Planned
17
18. Porting P4 to GAE: what we have changed (2)
Wizard, admin, online configuration -> only in development
Startup time reduction! -> modularization
optional features disabled
Object in session -> Serializable
Email: local queue -> direct using java.mail
Minor differences between MySQL and Cloud SQL
18
19. GAE: what we have used
Java (and indirectly Groovy)
Cloud SQL: as a relational DB
User API: user info, login/logout links
File Service: temporary files
URL Fetch API: transparent through java.net.*
Blob Store: for attachments
Planned
Task Queue & backends: useful for pdf generations, batch, etc
Memcached: cache for hibernate and HTML
Planned
Planned
19
20. GAE: what we haven’t used
Datastore: interesting using JPA or JDO but the migration from
Hibernate is expensive
Images: not applicable but pdf support would be nice
Python and other languages
Capabilities API: service availability
Channel API: “push” communications
Multitenancy
Search
20