0% found this document useful (0 votes)
148 views26 pages

I - What Is G G App Engine ???

Google App Engine is a platform for developing and hosting web applications in Google's data centers. It allows applications to automatically scale to handle changes in traffic, and removes the need for server maintenance. Developers write applications using Google-supported languages and APIs to access services like datastore, memcache, and URL fetching. Applications run in a secure "sandbox" environment isolated from the underlying operating system.

Uploaded by

Shail Parikh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views26 pages

I - What Is G G App Engine ???

Google App Engine is a platform for developing and hosting web applications in Google's data centers. It allows applications to automatically scale to handle changes in traffic, and removes the need for server maintenance. Developers write applications using Google-supported languages and APIs to access services like datastore, memcache, and URL fetching. Applications run in a secure "sandbox" environment isolated from the underlying operating system.

Uploaded by

Shail Parikh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

I . What is Google App Engine ???

Google App Engine is basically a system that exposes various pieces of Google's scalable infrastructure so that you can write server-side applications on top of them. Google App Engine (often referred to as GAE or simply App Engine, and also used by the acronym GAE/J) is a platform as a service (PAAS) cloud computing platform for developing and hosting web applications in Googlemanaged data centres. It virtualizes applications across multiple servers. App Engine offers automatic scaling for web applications - as the number of requests increases for an application, App Engine automatically allocates more resources for the web application to handle the additional demand. It 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. It was first released as a beta version in April 2008, and out of beta recently in Sept 2011.

II. Why did Google develop the App Engine ???


They built App Engine because they want more web apps to get created. What they noticed is that, today, it's pretty hard to create one: there are significant upfront challenges to deploying even the simplest of web applications. You've got a lot of tasks to do. First, you have to write the code for your app, of course. But then, you also have to write your Apache web server configs and startup scripts, set up your SQL database, create all of its tables and hook up the passwords, set up monitoring so you can tell what's going on with your traffic and logs, decide how you'll push new versions of your code, and on, and on. That's the technical setup challenge that we noticed. And then, once you've done all that sysadmin work, you have another challenge: you have to actually go find machines you can use somewhere, physically or from a virtual provider, to run your app somewhere. Right now, that costs money: even for the smallest app, which you use a few times a week, you have to pay a pretty big upfront fee to run that app with a traditional hosting provider. So that's the financial or physical challenge. And then, once you've got the whole thing set up and working, and found and paid for a place to test it out, you've got another challenge: you've got to maintain it all as your app grows. Your machines crash, your configs have errors, your hard disks break, your traffic starts to grow, you have to rebuild your databases, set up more machines and on. Keeping everything going as your app grows is a hassle. Google is trying to abstract away all these with the App Engine.

III. Why use Google App Engine ???


Scalability Lower Cost of Ownership Rich Set of APIs Fully featured SDK for local development Ease of Development Web Administration Console and diagnostic utilities Scalable hosting is the ability to quickly and easily add resources to an existing network, i.e. More RAM or more servers. Google App Engine is free to a certain amount of resources. Fees are charged for additional storage, bandwidth, or CPU cycles required by the application. Google App Engine SDKs contain methods to locally test the web applications before deploying them to the online servers. The applications can be developed in three different environments JAVA, Python and GO. Each environment provides standard protocols and common technologies for web application development.

IV. The GAE Application Life Cycle

Google App Engine has a fairly simple life cycle compared to other scalable hosting services. It provides more infrastructure to write scalable applications but can only run a limited number of applications. The life cycle follows a very simple procedure. Building the actual code first, Testing the developed code locally, Deploying the code to a google hosted server linked to a google account, Managing the server via a given admin console and upgrading the code and resources as required.

V. The GAE Architecture

At top your request comes in and eventually you send your response back. The file system contains two different parts : One has the Python System Library and the other part has the source-code of your program. Then there is the Python Virtual Machine which is managed by a bunch of C++ codes that keeps it from doing other things. On the left and the bottom are the API's to other services that Google provides i.e. urlfetch, mail, images. The stateful API's do not just process on data and then deliver the result, but holds on to the data if you need it later. The memory based cache is shared by instances of an application. It is not guaranteed to store your data forever but it usually does. It is not guaranteed to be fast but is faster than the Datastore. Datastore is not a relational database although it has a query language and a number of concepts that are familiar from database territory.

VI. The 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. Examples of the limitations of the secure sandbox environment include:

An application can only access other computers on the Internet through the provided URL fetch and email services. 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. An app can read files, but only files uploaded with the application code. The app must use the App Engine datastore, memcache or other services for all data that persists between requests.

Application code only runs in response to a web request, a queued task, or a scheduled task, and must return response data within 30 seconds in any case. A request handler cannot spawn a sub-process or execute code after the response has been sent.

VII. The GAE Datastore


App Engine provides a distributed data storage service that features a query engine and transactions. Just as the distributed web server grows with your traffic, the distributed datastore grows with your data. You have the choice between two different data storage options differentiated by their availability and consistency guarantees. The App Engine datastore is not like a traditional relational database. 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. The datastore is strongly consistent and uses optimistic concurrency control. An update of a entity occurs in a transaction that is retried a fixed number of times if other processes are trying to update the same entity simultaneously. Your application can execute multiple datastore operations in a single transaction which either all succeed or all fail, ensuring the integrity of your data. Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers. Many projects at Google Store data in Bigtable, including web indexing, Google Earth, and Google Finance. The datastore has a SQL-like syntax called "GQL". GQL intentionally does not support the Join statement, because it seems to be inefficient when queries span more than one machine.

VIII. Diff. between GAE and other hosting Services


Compared to other scalable hosting services such as Amazon EC2, App Engine provides more infrastructure to make it easy to write scalable applications, but can only run a limited range of applications designed for that infrastructure.

App Engine's infrastructure removes many of the system administration and development challenges of building applications to scale to hundreds of requests per second and beyond. Google handles deploying code to a cluster, monitoring, failover, and launching application instances as necessary.

While other services let users install and configure nearly any *NIX compatible software, App Engine requires developers to use only its supported languages, APIs, and frameworks. Current APIs allow storing and retrieving data from a BigTable non-relational database; making HTTP requests; sending e-mail; manipulating images; and caching. Most existing Web applications can't run on App Engine without modification, because they require a relational database. But with the new pricing format , GAE is likely to be more expensive to users than other hosting services like AWS etc. One positive thing is that with the high-replication datastore, GAE provides a redundant, multihomed, fault tolerant system that can transparently survive whole data-center crashes.

IX. Services provided by GAE


App Engine provides a variety of services that enable you to perform common operations when managing your application. The following APIs are provided to access these 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 inmemory 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.

10

X. The GAE 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

task queues for performing work outside of the scope of a web request scheduled tasks for triggering events at specified times and regular intervals

Your

application

can

run

in

one of

three

runtime

environments:

the Go environment, the Java environment, and Python environment. Each environment provides standard protocols and common technologies for web application development. They are explained individually in the following pages. Although for an example we will be using the Python SDK for developing a web application for local development. It is relatively quite simple and easy to comprehend.

11

XI. The Go Runtime Environment


App Engine's Go runtime environment provides a convenient way to implement and deploy web applications written in the Go Programming Language. The SDK includes the Go compiler and standard library, so it has no additional dependencies. As with the Java and Python environments, not all the standard library's functionality is available inside the sandbox. The SDK includes an automated build service to compile your app, so you'll never need to invoke the compiler yourself. Andas with the Python SDK your app will be automatically re-built whenever you change the source. This keeps you productive by making the edit-compile-run cycle refreshingly short. The Go environment provides idiomatic Go APIs for most of the App Engine services. You can upload other third-party libraries with your application, as long as they are implemented in pure Go.

What exactly Go programming language is : It is an experimental programming language that has been introduced by Google and is on the path to becoming an important programming language under the influence of Google. Go combines the performance and safety of a compiled language like C+ + but with the speed and dynamism of Python.

The mascot of Go

12

XII. The Java Runtime Environment


You can develop your application for the Java runtime environment using common Java web development tools and API standards. Your app interacts with the environment using the Java Servlet standard, and can use common web application technologies such as JavaServer Pages (JSPs). 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. An app can use any JVM bytecode or library feature, as long as it does not exceed the sandbox restrictions. Your app accesses most App Engine services using Java standard APIs. 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 java.net HTTP APIs access the App Engine URL fetch service. App Engine also includes low-level APIs for its services to implement additional adapters, or to use directly from the application. Java developers use the Java programming language and APIs to implement web applications for the JVM. With the use of JVM-compatible compilers or interpreters, you can also use other languages to develop web applications, such as JavaScript, Ruby, or Scala.

13

XIII. The Python Runtime Environment


With App Engine's Python runtime environment, you can implement your app using the Python programming language, and run it on an optimized Python interpreter. App Engine includes rich APIs and tools for Python web application development, including a feature rich data modeling API, an easy-to-use web application framework, and tools for managing and accessing your app's data. You can also take advantage of a wide variety of mature libraries and frameworks for Python web application development, such as Django. The Python environment includes the Python standard library. Of course, not all of the library's features can run in the sandbox environment. For convenience, several modules in the standard library whose core features are not supported by the runtime environment have been disabled, and code that imports them will raise an error. The Python environment provides rich Python APIs for the datastore, Google Accounts, URL fetch, and email services. App Engine also provides a simple Python web application framework called webapp to make it easy to start building applications. You can upload other third-party libraries with your application, as long as they are implemented in pure Python and do not require any unsupported standard library modules.

14

XIV. Developing a basic Web Application


The main purpose of going through a detailed synopsis of any hosting service is to create an application and test it on your own. Enclosed with this report you will find a CD-ROM that contains a video of how to develop a basic web application using the programming language PYTHON and the Google App Engine SDK based on Python. The program that is explained here is fairly simple but the basic purpose is not to teach Python Coding, but the successful deployment of an Application via Google App Engine. We will just be concentrating on developing a Webapplication framework for any general application. Using the Datastore and other advanced features of GAE are explained at the following link : www.code.google.com/intl/en/appengine/docs/python/gettingstarted

Firstly you need the Python framework on your computer, so visit the following link and download whatever version that matches your system specifications :

http://python.org/download Next you need the Google App Engine SDK that is available on the following / link. The Python SDK includes a web server application that simulates the App Engine environment, including a local version of the datastore, Google Accounts, and the ability to fetch URLs and send email directly from your computer using the App Engine APIs. http://code.google.com/intl/en/appengine/downloads.html

15

Step 1 : Installing the Python Framework on your computer


Install python from the file that you just downloaded from the website. The process should look something like this:

After this is done install the SDK that you downloaded from the Google Code website. The process should look somewhat like this:

16

Step 2 : Creating the file directory


Create a directory named "Helloworld" anywhere you wish. For instance let us take it as "C:/Helloworld"

Step 3 : Creating a simple request handler


Now in the above directory create a new text document and write the following code in python inside it.
print 'Content-Type: text/plain' print '' print 'Hello, world!'

Name the file as helloworld.py, changing the extension from .txt to .py This Python script responds to a request with an HTTP header that describes the content, a blank line, and the message "Hello, world!".

17

Step 4: Creating the configuration file


An App Engine application has a configuration file called "app.yaml". Among other things, this file describes which handler scripts should be used for which URLs. Inside the helloworld directory, create a file named "app.yaml" with the following contents:
application: helloworld version: 1 runtime: python api_version: 1 handlers: - url: /.* script: helloworld.py

The application identifier is "helloworld". When you register your application with App Engine in the final step, you will select a unique identifier, and update this value. This value can be anything during development. This is version number 1 of this application's code. If you adjust this before uploading new versions of your application software, App Engine will retain previous versions, and let you roll back to a previous version using the administrative console. This code runs in the python runtime environment, version "1". Additional runtime environments and languages may be supported in the future. Every request to a URL whose path matches the regular

expression /.* (all URLs) should be handled by the helloworld.py script.

18

Step 5 : Testing the Application


With a handler script and configuration file mapping every URL to the handler, the application is complete. You can now test it with the web server included with the App Engine SDK. After you have installed the Google App Engine SDK. Go to the Desktop of your computer and search for a shortcut named "Google App Engine Launcher". Click on this and the launcher starts for the first time. A message is displayed on the screen on the first start-up like this :

19

Then you have to click "OK" and go to Edit and the last tab "Preferences" and then enter the path of Python.exe that you had installed in the space provided.

Now click on "OK" to start the process of deploying a local test server. Click on File -> Add an existing application and then choose the directory "Helloworld". Select the application in the app list and then press "RUN" to start the application.

20

Then after the server has started go to your browser and then type the following address in your address bar to check if the application has been deployed properly. http://localhost:8080 The web server is now running, listening for requests on port 8080.

21

Step 6: Uploading the Application


You create and manage applications in App Engine using the Administration Console. Once you have registered an application ID for your application, you can upload your application by clicking the Deploy button.

Registering the Application You create and manage App Engine web applications from the App Engine Administration Console, at the following URL: https://appengine.google.com/ Sign in to App Engine using your Google account. If you do not have a Google account, you can create a Google account with an email address and password. 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. If you elect to use the free appspot.com domain name, the full URL for the application will be "http://application-id.appspot.com/". You can also purchase a top-level domain name for your app, or use one that you have already registered. Edit the "app.yaml" file, then change the value of the application: setting from "helloworld" to your registered application ID.

22

Uploading the application Click "Deploy" on the Google App Engine Launcher to upload your finished application. Enter your Google username and password at the prompts. You can now see your application running on App Engine. If you set up a free appspot.com domain name, the URL for your website begins with your application ID: https://app-id.appspot.com/

Finally we have our own web application hosted by GAE!

23

XV. Recent Changes in GAE


Google is changing the way it charges for App Engine. Previously, you were charged for three things: Bandwidth in/out Data stored in the datastore CPU time of all your programs

The new billing model charges you for: Bandwidth in/out Data stored in the datastore Wall-clock time spent running application server instances Number (and type) of requests to the datastore

In addition, there is a 15-minute charge ($0.02) every time* an instance starts and $9 per application per month (as a minimum spend) if you enable billing. The most significant change to the pricing model is that instead of billing you for CPU time consumed by your frontend web application, you will now be charged for every minute of wall-clock time that each instance runs, irrespective of how much CPU it consumes. As App Engine has matured, it has gone from being a low-end hosting solution to a high-end hosting solution. Compared to building your own Hardware, App Engine is still comically cheap. The good news is that Google says that higher prices will allow them to increase their commitment to App Engine and devote more resources to its development. To the extent that more money means more features sooner, paying more might be worth it. Time will tell.

24

XVI. Conclusion
Google App Engine is an excellent hosting service that has been provided by Google for enterprises to host their web applications online at a minimal price. In the hosting market it has several competitors but most of them lack the number of features that it has to offer. Features like more infrastructure, scalability, etc.

App Engine requires developers to use only its supported languages, APIs, and frameworks. Current APIs allow storing and retrieving data from

a BigTable non-relational database; making HTTP requests; sending e-mail; manipulating images; and caching.

All in all, App Engine is an excellent cloud computing platform as a service and has a great future ahead. It would probably be used only by people who are in business, but may not be used by developers who only do it as a hobby.

25

XVII. References
http://en.wikipedia.org/wiki/Google_App_Engine http://code.google.com/intl/en/appengine/ http://slideshare.net http://googleappengine.blogspot.com Campfire One Videos on Google App Engine http://youtube.com http://arstechnica.com http://stanford.edu

26

You might also like