What is Google App Engine (GAE) ?
Google App Engine is a PaaS (Platform as a Service) product that provides its customers to host their web applications on Google's infrastructure. Whenever we discuss PaaS, we mean services that provide us with the infrastructure and a platform or runtime environment on which developers can upload and manage their applications. Developers need not worry about storage, resource allocation or network requirements of their app, all these are provided by the PaaS provider itself.
Applications written for the App Engine are required to be in some specific languages such as Java, Python, Go and Php. Storage is provided through Google App Engine DataStore, Google Cloud Storage and BigTable. The query language used is Google Cloud SQL, based on SQL.
Google provides a unique incentive to developers - Google App Engine is free up to limited resource usage. Developers can get 1 GB of storage and 5 million page views per month for free. On exceeding the minimum threshold for its free services, one can upgrade by paying for extra resources.
Apps can be served either from your own domain or the free appspot.com domain name.
Some prominent features of Google App Engine are
- Persistent storage with queries, sorting, and transactions.
- Automatic scaling and load balancing.
- Asynchronous task queues for performing work outside the scope of a request.
- Scheduled tasks for triggering events at specified times or regular intervals.
- Integration with other Google cloud services and APIs.
- Services are fetched using HTTP or HTTPS over standard well-known ports.
- There is a 30 second time-out for any HTTP request.
As already mentioned, GAE has a free version and paid version. Developers can start from the free version and then pay for any of the extra resources they want as per their app's performance and requirements. There is hardly any other service provider that gives away these services for free. It is very useful if you want to test your apps first, or have very small or not very resource-intensive applications.
Pricing Scheme of GAE
Resource | Free Default Limit | Billing Enabled Default Limit |
Default Google Cloud Storage Bucket Stored Data | 5 GB | First 5 GB free; no maximum |
Blobstore Stored Data | 5 GB | First 5 GB free; no maximum |
Code & Static Data Storage | First 1 GB | Exceeding 1 GB |
Stored Data | 1 GB | 1 GB free; no maximum |
Number of Indexes | 200 | 200 |
Read, Write etc. Operations | 50,000 | Unlimited |
More details about pricing and quotas for each plan (free vs paid) can be found at the official page.
Security in GAE
- GAE runs your application in a sandbox environment, ensuring that all applications are isolated from each other and from the infrastructure provided.
- Direct write access to the file system is not allowed.
Storage in GAE
There are two types of storage - temporary (eg- memcache) and persistent (eg - google cloud datastore). Access to these storage systems should be specifically designed for concurrency control in case of shared access.
Memcache
Memcache is a high performance temporary storage feature of the App Engine that allows quick retrieval of data, such as latest datastore queries. Data stored in memcache is not permanent and can be cleared any time. Memcache works pretty much the same way as cache - any new query is first directed to memcache, and on failing to retrieve results from memcache, the datastore is queried. There are two types of memcache - shared and dedicated. Shared memcache system is free, but it comes with a disadvantage - data of your application stored in the shared memcache storage can be cleared anytime. Dedicated memcache system is paid, as it reserves some memory as cache allocated for your application.
Datastore
The High Replication Datastore is Google's schemaless, highly scalable, reliable and fault-tolerant persistent data storage system. The datastore follows distributed architecture. It stores data objects not in relational format, but as entities in an almost hierarchical structure. Queries to the datastore retrieve entities based on specific set of conditions and filters on the entities' properties and key values and return zero or more results. These properties can include boolean values, strings, datetime, blobs, float etc.
Getting Started with Development
Below is a brief overview on what all you need to download in order to get started with development of your first app, followed by a link from where you can head over to a step-by-step tutorial on building a Hello World app from Google itself. You'll need to download the SDK for developing apps for GAE. There are several options for SDK - for different languages and for different platforms. Languages supported are Java, Python, Go and PHP. Platforms supported include the 3 major operating systems - Windows, Mac and Linux.
Here's the download link :
Download SDK for AppEngine. You can select any one language to your liking, and there are not much differences between the platforms.
In this tutorial, I have downloaded the Google App Engine for Python for the Windows platform.
After downloading, run the installer. For Windows, you'll need Python installed on your system. You can get this from here. I chose the version 2.7.11. You can select any version you are comfortable with.
Now, simply follow the instructions from the installer. After everything is installed, click on the Google App Engine Launcher icon from your desktop.
Next, you'll see a plain window with a menu bar on top horizontal, and a '+' and '-' icon. Click on the '+' to add a new project. You will be prompted with another small window.
Let's name this project engineapp and specify a parent directory of your choice.
Click on Create. Your first app is now listed on the white area in the window. You can now edit, deploy and manage your apps by using the buttons in the top menu bar.
You are now set to develop your own apps and host them on the Google App Engine! To create your first app, refer to this comprehensive tutorial from Google.
Here is a list some recommended readings for those who can't have enough :
Cloud Computing Bible
Google App Engine