What Is Google App Engine?
Google App Engine lets users run 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: Users
just need to upload your application, and it's ready to
serve other users.
Users can serve your app from your own domain name
(such as [Link] using Google Apps.
Or, you can serve your app using a free name on
the [Link] 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 JVM, Java servlets, JVM-based interpreter
or compiler, such as JavaScript or Ruby.
App Engine also features two dedicated Python
runtime environments, each of which includes a fast
Python interpreter and the Python standard library.
GAE provides a Go runtime environment that runs
natively compiled Go code.
These runtime environments are built to ensure that
your application runs quickly, securely, and without
interference from other apps on the system.
All applications can use up to 1 GB of storage and
enough CPU and bandwidth to support an efficient
app serving around 5 million page views a month,
absolutely free.
Architecture of GAE
Pricing
[Link]
• $0.10 - $0.12 per CPU core-hour
• $0.15 - $0.18 per GB-month of storage
• $0.11 - $0.13 per GB outgoing bandwidth
• $0.09 - $0.11 per GB incoming bandwidth
Application Environment
Google App Engine makes it easy to build an application
that runs reliably, even under heavy load and with large amounts
of data.
App Engine includes the following features:
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 your computer
Your application can run in one of three runtime
environments: the Go, Java environment,
Python environment
Sandbox
Applications run in a secure environment that
provides limited access to the underlying operating
system.
These limitations allow App Engine to distribute web
requests for the application across multiple servers,
and start and stop servers to meet traffic demands.
The sandbox isolates your application in its own
secure, reliable environment that is independent of
the hardware, operating system and physical location
of the web server.
Java Runtime Environment
You can develop your application for the Java runtime
environment using common Java web development
tools and API standards.
use common web application technologies such
as Java Server Pages (JSPs).
The Java runtime environment uses Java 6.
The App Engine Java SDK supports developing apps
using either Java 5 or 6.
The environment includes the Java SE Runtime
Environment (JRE) 6 platform and libraries.
The restrictions of the sandbox environment are
implemented in the JVM.
For the App Engine datastore, the Java SDK includes
implementations of the Java Data Objects (JDO)
and Java Persistence API (JPA) interfaces.
Your app can use the JavaMail API to send email
messages with the App Engine Mail service.
The [Link] HTTP APIs access the App Engine URL
fetch service.
Storing Your Data
The App Engine environment provides a range of
options for storing your data:
App Engine Data store provides a NoSQL
schemaless object data store, with a query engine and
atomic transactions.
Google Cloud SQL provides a relational SQL
database service for your App Engine application,
based on the familiar MySQL RDBMS.
Google Cloud Storage provides a storage service for
objects and files up to terabytes in size, accessible
from Python and Java applications.
Data Store
App Engine provides a distributed NoSQL
data storage service that features a query
engine and transactions.
Data objects, or "entities," have a kind and a
set of properties.
Queries can retrieve entities of a given kind
filtered and sorted by the values of the
properties.
Property values can be of any of the
supported property value types.
Datastore entities are "schemaless."
The structure of data entities is provided by and
enforced by your application code.
The Java JDO/JPA interfaces and the Python data
store interface include features for applying and
enforcing structure within your app.
Your app can also access the data store directly to
apply as much or as little structure as it needs.
The datastore is strongly consistent and
uses optimistic concurrency control.
Your application can execute multiple datastore
operations in a single transaction which either all
succeed or all fail, ensuring the integrity of your
data.
The datastore implements transactions across its
distributed network using "entity groups."
A transaction manipulates entities within a single group.
Entities of the same group are stored together for efficient
execution of transactions.
Your application can assign entities to groups when the
entities are created
App Engine Services
URL Fetch
Applications can access resources on the Internet, such as
web services or other data, using App Engine's URL fetch
service.
The URL fetch service retrieves web resources using the
same high-speed Google infrastructure that retrieves web
pages for many other Google products.
Mail
Applications can send email messages using App Engine's
mail service.
The mail service uses Google infrastructure to send email
messages.
Memcache
The Memcache service provides your application with
a high performance in-memory key-value cache that
is accessible by multiple instances of your application.
Memcache is useful for data that does not need the
persistence and transactional features of the
datastore, such as temporary data or data copied from
the datastore to the cache for high speed access.
Image Manipulation
The Image service lets your application manipulate
images. With this API, you can resize, crop, rotate
and flip images in JPEG and PNG formats.
Development Workflow
The App Engine software development kits (SDKs)
for Java, Python, and Go each include a web server
application that emulates all of the App Engine
services on your local computer.
Each SDK includes all of the APIs and libraries
available on App Engine.
The web server also simulates the secure sandbox
environment, including checks for attempts to access
system resources disallowed in the App Engine
runtime environment.
Each SDK also includes a tool to upload your
application to App Engine.
Once you have created your application's code, static
files and configuration files, you run the tool to
upload the data.
The tool prompts you for your Google account email
address and password.
When you build a new major release of an application
that is already running on App Engine, you can
upload the new release as a new version.
The old version will continue to serve users until you
switch to the new version.
You can test the new version on App Engine while
the old version is still running.
Java SDK
You develop and upload Java applications for
Google App Engine using the App Engine Java
software development kit (SDK).
The SDK includes software for a web server that
you can run on your own computer to test your
Java applications. The server simulates all of the
App Engine services, including a local version of
the datastore, Google Accounts, and the ability to
fetch URLs and send email from your computer
using the App Engine APIs.
Trying a Demo Application
The App Engine Java SDK includes several demo
applications in the demos/ directory. The final version of
the guest book application you will create in this tutorial is
included under the directory guestbook/.
Start the guest book demo in the development server by
running the following command at a command prompt:
appengine-java-sdk\bin\dev_appserver.cmd appengine-
java-sdk\demos\guestbook\war
The development server starts, and listens for requests on
port 8080. Visit the following URL in your browser:
[Link]
Running and Testing the Application
The App Engine SDK includes a web server
application you can use to test your application.
The server simulates the App Engine environment
and services, including sandbox restrictions, the
datastore, and the services.
[Link]
Registering the Application
You create and manage App Engine web applications from the App
Engine Administration Console, at the following URL:
[Link]
Sign in to App Engine using your Google account.
To create a new application, click the "Create an Application" button.
Follow the instructions to register an application ID, a name unique to
this application.
Edit the [Link] file, then change the value of
the <application> element to be your registered application ID.
You should probably elect to use the free [Link] domain name,
and so the full URL for the application will
be[Link]
Uploading Your Application
You create and manage applications in App Engine
using the Administration Console.
Once you have registered an application ID for your
application, you upload it to App Engine using either
the Eclipse plugin, or a command-line tool in the
SDK.
Accessing Your Application
You can now see your application running on App
Engine. If you set up a free [Link] domain
name, the URL for your website begins with your
application ID:
[Link]