Google_App_Engine

advertisement
2008.10.07 Yoo Hyunjeong

Google web application platform
◦ Easy to build, easy to maintain, and easy to scale as
user’s traffic and data storage needs grow
◦ No servers to maintain, with App Engine : just
upload an application, and it’s ready to serve your
users.


Providing a platform including database
호스팅을 GAE에서 담당하여 개발자로 하여금 서
비스 개발에 집중할 수 있도록 제공

GAE에서 제공하는 기능
◦
◦
◦
◦
◦
Python이 제공하는 기본 기능
BigTable/GFS 기술이 뒷받침하는 견고한 Datastore
확장성을 제공하는 호스팅 공간
Google account
SDK를 이용한 로컬 개발 및 테스트

App Engine을 통해 웹 서비스 개발자들은 또 다
른 “Web Development that doesn’t hurt”(Ruby
on Rails’s 모토) 고통 없이 개발할 수 있는 선택권
을 갖게 된다. 다만, 이 선택에는 세가지의 제약이
따른다.
◦ 1. 모든 코드는 반드시 Python으로 작성해야 한다.
◦ 2. 사용량 제한을 통해 비용 지불의 가능성이 존재한다.
◦ 3. 모든 데이타는 구글 플랫폼에서 움직이며 구글이 갖게
된다는 점이다. 이는, 구글 플랫폼에 종속된 어플리케이
션은 쉽게 구글 플랫폼을 벗어나지 못하게 할 것이다.

Google App Engine makes it easy to build an
application that runs reliably, even under heavy
load and with large amounts of data. The
environment 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



Application 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 sendbox isolates your application.

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 and APIs. Other computers can only connect to
the application by making HTTP(s) 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 for all data that persists between requests.
◦ Application code only runs in response to a web request,
and must return response data within a few seconds. A
request handler cannot spawn a sub-process or execute
code after the response has been sent.




App Engine provides a runtime environment
that uses the Python programming language.
Python version 2.5.2.
App Engine also provides a simple Python
web application framework called webapp to
make it easy to start building applications.
App Engine also includes the Django web
application framework, version 0.96.1


Providing a powerful distributed data storage
service
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.

The following APIs are provided to access the
se services:
◦ URL Fetch
 Applications can access resources on the Internet usin
g App Engine's URL fetch service. The URL fetch service
retrieves web resources using the same high-speed Go
ogle infrastructure that retrieves web pages for many o
ther Google products.
◦ Mail

The following APIs are provided to access the
se services:
◦ Memcache
 providing your application with a high performance inmemory key-value cache that is accessible by multiple
instances of your application.
 useful for data that does not need the persistence and
transactional features of the datastore, such as tempor
ary data.
◦ Image Manipulation



Developing and uploading applications for
Google App Engine using the App Engine
software development kit (SDK).
The 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.
The SDK runs on any computer with Python 2.5,
and versions are available for Windows, Mac OS X
and Linux.

Creating a simple request handler
 Helloworld.py

Creating the Configuration File
 App.yaml

Testing the Application
◦ Start web server
 Dev_appserver.py
 Appcfg.py
◦ Dev_appserver.py hyunjeong/



The CGI standard is simple, but it would be
cumbersome to write all of the code that uses
it by hand.
Web application frameworks handle these
details for you, so you can focus your
development efforts on your application's
features.
App Engine includes a simple web application
framework of its own, called webapp.

A webapp application has three parts:
◦ one or more RequestHandler classes
◦ a WSGIApplication instance
◦ a main routine

Edit Helloworld.py

Testing

Edit Helloworld.py
Download