Table of Contents
Google App Engine
Google App Engine was first released as a beta version in April 2008. It is a platform for developing and hosting web applications in Google-managed data centers. Google’s App Engine opens Google’s production to any person in the world at no charge. Much like Google gives us all free email with an amazing amount of long term storage, we now have the ability to run the software that we write in Google’s data centers.
Google App Engine lets you run your web applications on Google’s infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it’s ready to serve your users.
You can serve your app from your own domain name (such as http://www.example.com/) using Google Apps. Or, you can serve your app using a free name on the appspot.com domain. You can share your application with the world, or limit access to members of your organization.
Google App Engine supports apps written in several programming languages. With App Engine’s Java runtime environment, you can build your app using standard Java technologies, including the JVM, Java servlets, and the Java programming language—or any other language using a JVM-based interpreter or compiler, such as JavaScript or Ruby. App Engine also features a dedicated Python runtime environment, which includes a fast Python interpreter and the Python standard library. The Java and Python runtime environments are built to ensure that your application runs quickly, securely, and without interference from other apps on the system.
With App Engine, you only pay for what you use. There are no set-up costs and no recurring fees. The resources your application uses, such as storage and bandwidth, are measured by the gigabyte, and billed at competitive rates. You control the maximum amounts of resources your app can consume, so it always stays within your budget. App Engine costs nothing to get started. All applications can use up to 500 MB of storage and enough CPU and bandwidth to support an efficient app serving around 5 million page views a month, absolutely free. When you enable billing for your application, your free limits are raised, and you only pay for resources you use above the free levels.
Cloud computing becomes more popular day by day. The “dream” of users to “to get rid” of administrators, huge investments on expensive hardware and human resources becomes true. The goal of this paper is to present a general overview of the new coming service offered by Google Company – Google App Engine. “What is it for?”, “What can I do with the system?” and “How does it work?” are some of the questions on which this paper will try to give an answer. In addition, brief overview and description of “cloud computing” and comparison of Google App Engine with other similar products will be provided to the reader as well.
Google App Engine is cloud computing technology. Google App Engine is software that facilitates the user to run his web applications on Google infrastructure. It is more reliable because failure of any server will not affect either the performance of the end user or the service of the Google. It virtualizes applications across multiple servers and data centers. Other cloud-based platforms include offerings such as Amazon Web Services and Microsoft’s Azure Services Platform.
Why App Engine Only?
Google App Engine enables you to build web applications on the same scalable systems that power Google applications. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it’s ready to serve to your users.
Services Provided By GAE
1) The Datastore : A powerful distributed data storage service is present by App Engine. A query engine and transactional storing accessible through a simple API, both running on Google’s scalable infrastructure is provided with the App Engine datastore. This Python interface includes a data modeling API and similar to Structured Query Language (SQL) called GQL. Using these features developing data dependent applications should not be more difficult than creating it using normal web hosting service.
Similar like distributed web servers which grow with the amount of traffic, the distributed datastore grows as well when the amount of data raise. Unlike other traditional datastore, the App Engine datastore supports set of properties in data objects also known as “entities” . Like any other data filters, data can be extracted from tables using queries filtered by property values.
Data modeling interface which can define structure for datastore entities is included in the Python API for the datastore. This data model specifies if property value must be within a given preset range or will assign a default value to it if not given. User application supports as much as needed little structure of data. The Integrity of data is very well guaranteed. Each application can execute multiple datastore operations in a single transaction which either succeed or fail. Concurrency control is very well ensured as well. Update to the any single data record occurs if another process is trying to access the same data record in the same time.
2) Google Accounts : A service API which integrates with Google Accounts is included in App Engine as well, and it provides better user control. Customer’s applications can allow users to sign in their product by using Google accounts instead of implementing their own user account system. User can also distinguish whether the signed person is a simple user or a registered administrator for the application. Benefits of this are faster deployment of the product and faster and easier access to it.
3) Url Fetch : Resources on the internet, like web service or other data for example, can be accessed by any user application thanks to App Engine’s URL fetch service. This service is fast as other Google services and can retrieve other web sources by using high-speed Google infrastructure. It allows App Engine applications to exchange data with other hosts using HTTP requests.
4) Mail : Every user application can send message using App Engine’s mail service, which also uses Google’s company infrastructure. This is very useful way for applications to communicate with users and notify other users for any activity or updates.
5) Memcache : Distributed in-memory data cache in front of or in place of reliable constant storage is often use by high performance scalable web applications for some tasks. Because of this reason Google App Engine supports memory cache service. The Memcache service assures user applications with a high performance in-memory key-value cache that is available by numerous instances of the applications.
Data that does not need the persistence and transactional features of the datastore, like for example a temporary data or data copied from the datastore to the cache for high speed access, which makes most of the Memcache service usage.
6) Image Manipulation : Google provide as well and Image service which supports manipulating image functions, like resize, crop, rotate and flip images both in JPEG and PNG formats. This is very useful service for customer’s applications which are dealing with photographs or just provide users with a service to prepare their avatars.
Google App Engine Supported Features
1) Runtimes and Frameworks : Currently, the supported programming languages are Python, Java (and, by extension, other JVM languages such as Groovy, JRuby, Scala, Clojure, Jython and PHP via a special version of Quercus), and Go. Google has said that it plans to support more languages in the future, and that the Google App Engine has been written to be language independent.
Python web frameworks that run on Google App Engine include GAE framework, Django, CherryPy, Pylons, Flask, web2py and webapp2, as well as a custom Google-written webapp framework and several others designed specifically for the platform that emerged since the release. Any Python framework that supports the WSGI using the CGI adapter can be used to create an application; the framework can be uploaded with the developed application. Third-party libraries written in pure Python may also be uploaded.
Google App Engine supports many Java standards and frameworks. Core to this is the servlet 2.5 technology using the open-source Jetty Web Server, along with accompanying technologies such as JSP. Java Server Faces operates with some workarounds. Though the datastore used may be unfamiliar to programmers, it is easily accessed and supported with JPA. JDO and other methods of reading and writing data are also provided. The Spring Framework works with GAE; however the Spring Security module (if used) requires workarounds. Apache Struts 1 is supported, and Struts 2 runs with workarounds.
The Django web framework and applications running on it can be used on App Engine with modification. Django-nonrel aims to allow Django to work with non-relation databases and the project includes support for App Engine.
Applications developed for the Grails web application framework may be modified and deployed to Google App Engine with very little effort using the App Engine Plugin.
2) Reliability and Support : All billed High-Replication Datastore App Engine applications have a 99.95% uptime SLA. App Engine is designed in such a way that it can sustain multiple datacenter outages without any downtime. This resilience to downtime is shown by the statistic that the High Replication Datastore saw 0% downtime over a period of a year.
Paid support from Google engineers is offered as part of Premier Accounts. Free support is offered in the App Engine Groups and Stack Overflow, however assistance by a Google staff member is not guaranteed.
3) Bulk Downloading : SDK version 1.2.2 adds support for bulk downloads of data using Python. The open source Python projects gaebar, approcket, and gawsh also allow users to download and backup App Engine data. No method for bulk downloading data from GAE using Java currently exists.
GAE Background Working
This section provides more detailed information about how the system actually works, and what kind of requirements it has to create an application.
- The Sandbox – All user applications operate in a secure environment. This environment has a limited access to the underlying operating system. Because of these limitations, App Engine is able to distribute application’s web requests across various servers, which allows starting and stopping the servers to meet traffic demand. The sandbox separates the application in its own protected and reliable environment which is independent of the operating system, hardware or the physical location of the web server. Here are some of the restrictions which are included in the sandbox environment:
- An application can only access other computers on the Internet through the provided URL fetch and email services and APIs. Other computers can only connect to the application by making HTTP (or HTTPS) requests on the standard ports.
- An application cannot write to the file system and can read files, but only files uploaded with the application code. The application must use the App Engine datastore for all data that persists between requests.
- Application code only runs in response to a web request, and must return response data within 30 seconds. A request handler cannot spawn a sub-process or execute code after the response has been sent.
Google App Engine Application Environment
With this new service provided by Google it is really easy to create reliably applications which runs under heavy load and which use large amounts of data. Several key features are included in the environment:
- Dynamic web serving, with full support for common web technologies
- Persistent storage with queries, sorting and transactions
- Automatic scaling and load balancing
- APIs for authenticating users and sending email using Google Accounts
- +A fully featured local development environment that simulates Google App Engine on user’s computer.
Implementation of Google App Engine applications is done under Python programming language or java programming language. Full Python language support along with most of the Python standard library comes with standard runtime environment. Currently Python and java are the only supported languages by Google App Engine, but improvements to support other languages are in progress.
Your application can run in one of two runtime environments: the Java environment, and the Python environment. Each environment provides standard protocols and common technologies for web application development.
GAE POLICIES
To uphold the quality and reputation of Google products and services, Google App Engine (the “Service”) is subject to program policies. If you are found to be in violation of Google policies at any time, as determined by Google in its sole discretion, Google may warn you or suspend or terminate your account.
Restrictions
- Developers have read-only access to the file system on App Engine. Applications can use only virtual file systems, like gae-filestore.
- App Engine can only execute code called from an HTTP request (scheduled background tasks allow for self-calling HTTP requests).
- Users may upload arbitrary Python modules, but only if they are pure-Python; C and Pyrex modules are not supported.
- Java applications may only use a subset (The JRE Class White List)of the classes from the JRE standard edition.
- Does not support ‘naked’ domains (without www) like http://example.com. The required alias to ghs.google.com is implemented with a DNS CNAME record in order for changes in Google server IP addresses not to impact the service. This record cannot be used with other DNS records (RFC 1034 section 3.6.2, RFC 1912 section 2.4), including the required Start of Authority for the example.com DNS zone. Suggested workaround is to use the domain registrar HTTP redirection to a subdomain, e.g. “www.example.com”.
- Datastore cannot use inequality filters on more than one entity property per query.
- A process started on the server to answer a request can’t last more than 60 seconds. (with the 1.4.0 release, this restriction does not apply to background jobs anymore)
- Does not support sticky sessions (a.k.a. session affinity), only replicated sessions are supported including limitation of the amount of data being serialized and time for session serialization.
Prohibited Content
The Content displayed and/or processed through your Application or other web site utilizing the Service shall not contain any of the following types of content:
- Content that infringes a third party’s rights (e.g., copyright) according to applicable law
- Pornographic, obscene or excessively.profane content;
- Hate-related or violent content
- Content advocating racial or ethnic intolerance
- Content intended to advocate or advance computer hacking or cracking;
- Gambling;
- Other illegal activity, including without limitation illegal export of controlled substances or illegal software;
- Drug paraphernalia
- Phishing;
- Malicious content
- Other material, products or services that violate or encourage conduct that would violate any criminal laws, any other applicable laws, or any third-party rights.
Prohibited Actions
In addition to (and/or as some examples of) the violations described in the Terms, you may not and may not allow any third party, including your end users, to:
- Generate or facilitate unsolicited commercial email (“spam“). Such activity includes, but is not limited to:
- Sending email in violation of the CAN-SPAM Act or any other applicable anti-spam law;
- Imitating or impersonating another person or his, her or its email address, or creating false accounts for the purpose of sending spam;
- Data mining any web property (including Google) to find email addresses or other user account information;
- Sending unauthorized mail via open, third-party servers;
- Sending emails to users who have requested to be removed from a mailing list;
- Selling, exchanging or distributing to a third party the email addresses of any person without such person’s knowing and continued consent to such disclosure; and
- Sending unsolicited emails to significant numbers of email addresses belonging to individuals and/or entities with whom you have no preexisting relationship.
- Send, upload, distribute or disseminate or offer to do the same with respect to any unlawful, defamatory, harassing, abusive, fraudulent, infringing, obscene, or otherwise objectionable content
- Intentionally distribute viruses, worms, defects, Trojan horses, corrupted files, hoaxes, or any other items of a destructive or deceptive nature;
- Conduct or forward pyramid schemes and the like;
- Transmit content that may be harmful to minors;
- Impersonate another person (via the use of an email address or otherwise) or otherwise misrepresent yourself or the source of any email;
- Illegally transmit another’s intellectual property or other proprietary information without such owner’s or licensor’s permission;
- Use the Service to violate the legal rights (such as rights of privacy and publicity) of others;
- Promote or encourage illegal activity;
- Interfere with other users’ enjoyment of the Service;
- Sell, trade, resell or otherwise exploit the Service for any unauthorized commercial purpose;
- Modify, adapt, translate, or reverse engineer any portion of the Service;
- Remove any copyright, trademark or other proprietary rights notices contained in or on the Service.
- Use the Service in connection with illegal peer-to-peer file sharing;
- Display any content on the Service (including but not limited to the customizable login page) that contains any pornographic, hate-related or violent content or contain any other material, products or services that violate or encourage conduct that would violate any criminal laws, any other applicable laws, or any third party rights; or
- Modify the Google logo or any other Google Brand Features.
- Use the Service, or any interfaces provided with the Service, to access any Google product or service in a manner that violates the terms of service or other terms and conditions for use of such Google product or service.
Advantages and Disadvantage of Google App Engine
Advantage
- Easy to get Started
- The reliability, performance and security of Google’s infrastructure
- Cost efficient hosting
- Risk free trial period
Disadvantage
Does Google gives any service guarantees of any kind? Google is prone to occasionally change its algorithms and mechanisms in a very opaque and downright secretive manner. Everyone in the field of search engine optimization will know the story. Google tweaks their page ranking algorithms and suddenly your site appears below the fold or (gasp!) not even on the first page any more. Your business literally might evaporate in an instance. What if something similar happens with App Engine? What if they change the service levels your site receives? What if they suddenly decide that your site actually doesn’t need that great request latency you have been enjoying and they change their scaling methods in a way that suddenly impacts your user’s experience negatively? Also, do you know what Google does with your data? Do you want Google to know? What if you have a good idea that competes with some of Google’s many activities? Do you want to be dependent on their infrastructure – and worse – their APIs? Changing hosts is always painful. But with something like Amazon’s VM hosting service (EC2), you at least know that you can deploy your app as it is on another VM hosting environment (as long as you didn’t start to rely on Amazon’s S3, at least). But once your APIs are bound to Google’s, your cost of switching becomes much higher, since you will need to make Changes to your source code.
- Developers have read-only access to the filesystem on App Engine.
- App Engine can only execute code called from an HTTP request
- Java applications may only use a subset (The JRE Class White List) of the classes from the JRE standard edition.
- Java applications cannot create new threads.
- Does not support ‘naked’ domains (without www) like http://example.com.
- A process started on the server to answer a request can’t last more than 30 seconds
Conclusion
App Engine is a great “engine” for building highly scalable web applications backed by a world-class infrastructure, but it’s our responsibility to use the tools provided as effectively and efficiently as possible. A large part of this is designing your data model to leverage the core strengths of App Engine’s underlying datastore.