Google App Engine Introduction

Source: Internet
Author: User
Tags java se
ArticleDirectory
    • Sandbox
    • Java Runtime Environment
    • Python Runtime Environment
    • Data storage Zone
    • Google account
    • App Engine service
    • Scheduled tasks

After experiencing the Google App Engine, I would like to introduce this powerful stuff. Thanks to coderzh and the Google coders, we have once again experienced the power of python !!

What is Google App Engine?

Google App Engine allows you to run your network applications on Google's infrastructureProgram. App Engine Applications are easy to build and maintain, and can be easily expanded based on your traffic and data storage needs. With the Google App Engine, you no longer need to maintain the server: you only need to upload your application, it can immediately provide services for your users.

You can use the Google enterprise application suite through your own domain name (for exampleHttp://www.example.com/) Provides applications. Alternatively, you can useAppspot.comFree domain name on the domain to provide services for your application. You can share your applications with people all over the world, or restrict access to your organization only.

Google App Engine supports severalProgramming LanguageCompiled applications. With the Java Runtime Environment of App Engine, you can use standard Java technology (including JVM, Java Servlet, and Java programming language, or use a JVM-based interpreter or any other language of the interpreter, such as JavaScript or Ruby, to build an application. App Engine also provides a dedicated Python runtime environment, which includes a quick Python interpreter and Python standard library. Java and Python runtime environments are built to ensure that applications run quickly and securely without being disturbed by other applications on the system.

In App Engine, you only need to pay for the resources you use. No setup cost, no repeated fees. Resources used by your application, such as storage space and bandwidth, are measured in gigabytes and charged at competitive rates. You can control the maximum amount of resources that your application can consume to keep it within budget.

You can start using the app engine for free. All applications can use up to 500 mb of storage space, as well as enough CPU and bandwidth to support about 5 million page views per month, completely free of charge. After you enable the payment option for your application, your free quota is increased. You only need to pay for resources that exceed the free quota.

Application Environment

With the Google App Engine, you can easily build applications that can run securely even when the load is heavy and the data volume is large. App Engine provides the following functions:

    • Dynamic network service, providing full support for common network technologies
    • Persistent storage space that supports query, classification, and transactions
    • Automatic scaling and load balancing
    • API used to authenticate users and send emails using Google accounts
    • A fully functional local development environment that can simulate Google App Engine on your computer
    • Scheduled tasks used to trigger events at specified time and periodically

Your application can run in one of the following runtime environments: Java environment and Python environment. All environments provide standard protocols and common technologies for network application development.

Sandbox

Applications run in a secure environment, which only provides limited access to the basic operating system. These restrictions allow the App Engine to distribute application network requests among multiple servers, and enable and disable the server to meet the traffic requirements. Sandbox isolates your applications in its own secure and reliable environment, which has nothing to do with the hardware, operating system, and physical location of the network server.

Examples of restrictions on the secure sandbox environment include:

    • Applications can only access other computers on the Internet through the provided web page capture and email service. Other computers can only connect to the application by making HTTP (or HTTPS) requests on the standard port.
    • Applications cannot be written to the file system. Applications can only read data from applicationsCodeThe uploaded file. The application must use the App Engine data storage area, memcache, or other services to store all the data that persists between requests.
    • The application code runs only in response to a network request or cron job and must return response data within 30 seconds under any circumstances. The request processing program cannot generate sub-processes or execute code after the response is sent.
Java Runtime Environment

You can use common Java Network development tools and API standards to develop applications running in the Java Runtime Environment. Your applications use the Java Servlet standard and environment interaction, and you can use common network application technologies, such as the assumerver page (JSP ).

Java 6 is used in the Java Runtime Environment. App Engine Java SDK supports developing applications using Java 5 or 6.

This environment includes the Java SE Runtime Environment (JRE) 6 platform and library. Restrictions on the sandbox environment are implemented in JVM. Any JVM bytecode or library function can be used as long as the application does not exceed the sandbox limit. For example, opening a socket or writing bytecode to a file will cause a runtime exception.

Your applications use java standard APIs to access most App Engine Services. For App Engine data storage, Java SDK includes Java Data Objects (JDO) and Java persistence API (JPA) interfaces. Applications can use the javamail API to send emails through the App Engine mail service.Java.netThe http api accesses the App Engine URL capture service. App Engine also includes low-level APIs to implement additional adapters using its services or to use them directly from applications. See documents about data storage area, memcache, web page capture, email, images, and Google account APIs.

Generally, Java developers use Java programming languages and APIs to implement JVM network applications. By using a JVM-compatible interpreter or interpreter, you can also use other languages to develop network applications, such as JavaScript, Ruby, or Scala.

For more information about the Java Runtime Environment, see Java Runtime Environment.

Python Runtime Environment

Through the python runtime environment of App Engine, you can use the python programming language to implement applications and run on the optimized Python interpreter. App Engine includes a wide range of APIs and tools developed for python network applications, it includes rich data modeling APIs, easy-to-use network application frameworks, and tools for managing and accessing your application data. You can also use a variety of mature libraries and frameworks developed for python network applications, such as Django.

Python 2.5.2 is used in the runtime environment. Additional support for python 3 will be considered in future versions.

The Python environment includes the python standard library. Of course, not all functions of the database can be run in the sandbox environment. For example, an exception occurs when you call a method to open a socket or write data to a file. For convenience, multiple modules in the standard library that are not supported by the runtime environment have been disabled, and the Code for importing these modules will cause errors.

The application code written for the python environment can only be written in Python. Extensions written in C language are not supported.

The Python environment provides a wide range of Python APIs for data storage areas, Google accounts, website crawling, and email services. App Engine also provides a simple Python network application framework called webapp, allowing you to easily start building applications.

As long as other third-party libraries are implemented in Python only and do not require any unsupported standard library modules, you can use your applications to upload these libraries.

For more information about the python runtime environment, see Python runtime environment.

Data storage Zone

App Engine provides a powerful Distributed Data Storage Service, including query engine and transaction functions. Just as the distributed network server increases with the access traffic, the distributed data storage area also increases with the data.

The App Engine data storage zone is different from the traditional relational database. Data Objects (or "entities") have one class and one group of attributes. You can search for objects of the specified type filtered and categorized by attribute values. The property value can be any of the supported property value types.

The data storage area entity is "unstructured. The structure of data entities is provided and executed by application code. Java JDO/JPA interfaces and Python data storage area interfaces include the functions used to apply and execute structures in your applications. Your applications can also directly access the data storage area to have more or less application structures as needed.

Highly consistent data storage areas and Optimistic Concurrency Control. If another process tries to update an entity and the entity is in a transaction that retries at a fixed number of times, the entity is updated. An application can perform multiple data storage area operations in a transaction (all or all failed to ensure data integrity ).

The data storage area uses the "entity group" to implement transactions through its distributed network. A transaction operates on entities in a group. Objects in the same group are stored together to efficiently execute transactions. Applications can assign objects to groups when they are created.

Google account

App Engine supports integration of applications with Google accounts used for user authentication. The application allows you to log on to your Google account and access the email addresses and displayed names associated with the account. Using a Google account allows you to start using your application more quickly, because you do not need to create a new account. Google accounts also save the trouble of implementing the user account system only for your applications.

If your application is running under Google Enterprise Application Suite, it can use the same features as members of your organization and members of the Google Enterprise Application Suite account.

The user API can also tell the application whether the current user is the registration administrator of the application. In this way, only the administrator can access the region on your site.

For more information about integration with a Google account, see user api reference.

App Engine service

App Engine provides a variety of services that allow you to perform common operations while managing applications. The following APIs are provided to access these services:

Web crawling

Applications can use the web address of the App Engine to capture services to access resources on the Internet, such as network services or other data. The Web crawling Service uses the high-speed Google infrastructure that retrieves web pages of many other Google products to retrieve network resources.

Email

Applications can use the mail service of App Engine to send emails. Email Service uses Google infrastructure to send emails.

Memcache

Memcache provides a high-performance memory key-value cache for your applications. You can access this cache through multiple instances of the application. Memcache is useful for data that does not require persistent storage and transaction functions in the data storage area (such as temporary data or data that is replicated from the data storage area to the cache for high-speed access.

Image operations

Image Service allows your applications to operate images. This API allows you to scale, crop, rotate, and flip JPEG and PNG images.

Scheduled tasks

The cron service allows you to schedule tasks to run at specified intervals. For more information about this service, see the python or Java cron documentation.

Development Workflow

App Engine sdks for Java and Python respectively include network server applications that can simulate all App Engine Services on your local computer. Each SDK includes all the APIs and libraries in the App Engine. The network server can also simulate a secure sandbox environment, including checking whether to access system resources that are not allowed in the App Engine runtime environment.

Each SDK also includes tools that can upload your applications to the App Engine. After the code, static files, and configuration files of your application are created, you can run the tool to upload data. This tool will prompt you to provide the email address and password of your Google account.

When you build a new major release of an application running on the app engine, you can upload the new release as a new version. Before you use the new version, the old version can continue to provide services to users. You can test the new version on the App Engine while the old version is still running.

The Java SDK runs on any platform with Java 5 or Java 6. The SDK is provided as a zip file. If you use the eclipse development environment, you can use the eclipse Google plug-in to create, test, and upload an App Engine application. The SDK also includes command line tools used to run development servers and upload applications.

Python SDK is implemented in Python only. It can run on any platform with Python 2.5 installed (including windows, Mac OS X, and Linux. The SDK is provided as a zip file and an installer for Windows and Mac OS X.

The Management Console is a network-based interface used to manage applications running on the App Engine. You can use it to create new applications, configure domain names, change the current version of your applications, check access permissions and error logs, and browse the application data storage area.

Quotas and limits

Creating an App Engine application is not only simple, but also free! You can create an account and publish an application that users can use immediately without any fees or responsibilities. Applications released through a free account can use up to 500 mb of storage space and up to 5 million page views per month. When you need more resources, you can enable payment, set the daily maximum budget, and allocate the budget for each resource as needed.

Each developer account can register up to 10 applications.

Each application allocates resources within the limit or "quota. The quota determines the amount of resources that an application can use in a calendar day. You will soon be able to adjust some of these quotas by purchasing other resources.

Some features impose quota-independent restrictions to protect system stability. For example, when an application is called to provide services for a network request, the application must send a response within 30 seconds. If the application takes too long, the process is terminated and the server returns the error code to the user. Response timeout is dynamic. If the request handler times out frequently, the request timeout can be shortened to save resources.

Another example of service restrictions is the number of returned results. A query can return up to 1,000 results. For a query that should have returned more results, only the maximum value can be returned. In this case, it is impossible for a request to execute such a query to return a request before timeout, but the restriction still exists to save resources in the data storage area.

Attempts to corrupt or misuse quotas (such as operating applications on multiple accounts at the same time) violate the terms of service and may cause the application to be disabled or the account to close.

For the Quota List and descriptions of the quota system, including which quotas can be increased by enabling payment, see quota.

From: http://code.google.com/intl/zh-CN/appengine/docs/whatisgoogleappengine.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.