什么是谷歌应用引擎(GAP)

 

转载自 https://developers.google.com/appengine/docs/whatisgoogleappengine

 

What Is Google App Engine?(什么是谷歌应用引擎)

Google App Engine lets you 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: 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/) usingGoogle Apps. Or, you can serve your app using a free name on theappspot.com 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'sJava runtime environment, you can build your app using standard Java technologies, including the JVM, Java servlets, and the Java programming language - or any other language using a JVM-based interpreter or compiler, such as JavaScript or Ruby. App Engine also features aPython runtime environment, which includes a fast Python interpreter and the Python standard library. App Engine also features aPHP runtime, with native support for Google Cloud SQL and Google Cloud Storage that work justs like using a local mySQL instance and doing local file writes. Finally, App Engine provides aGo 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.

With App Engine, you only pay for what you use. There are no set-up costs and no recurring fees. The resources your application uses, such as storage and bandwidth, are measured by the gigabyte, and billed at competitive rates. You control the maximum amounts of resources your app can consume, so it always stays within your budget.

App Engine costs nothing to get started. 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. When you enable billing for your application, your free limits are raised, and you only pay for resources you use above the free levels.


 

The 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  动态的Web 服务,完全支持常用Web 技术
  • persistent storage with queries, sorting and transactions 查询,排序和事物下的持久的存储
  • automatic scaling and load balancing 自动扩展和负载平衡
  • APIs for authenticating users and sending email using Google Accounts  验证用户的 API 以及使用谷歌账户的email 发送
  • 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 several runtime environments:

你的应用可以在以下运行环境中择一而行:

the Go environment, the Java environment, the PHP environment, and thePython environment. Each environment provides standard protocols and common technologies for web application development.

 

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.
  • Applications cannot write to the file system in any of the runtime environments. An application 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. The Python 2.7 environment allows bytecode to be read, written, and modified.
  • Application code only runs in response to a web request, a queued task, or a scheduled task, and must return response data within 60 seconds in any case. A request handler cannot spawn a sub-process or execute code after the response has been sent.

 

 

The PHP Runtime Environment

The PHP runtime for App Engine is an Experimental feature in Limited Preview. Our documentation and an early version of our SDK and local Development Server are available to anyone to develop and test applications locally. However for a limited period only whitelisted applications may be deployed on App Engine if they use the PHP runtime. When we lift these restrictions we will announce it onthe App Engine blog.

To enable your PHP applications to be deployed to App Engine, visit https://gaeforphp.appspot.com/ to register your application to be whitelisted. (PHP应用在谷歌的应用引擎上部署需要注册一下)

For information on using the PHP Runtime Environment, see our PHP Docs.

 

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 usingthe Java Servlet standard, and can use common web application technologies such asJavaServer Pages (JSPs).

The Java runtime environment uses Java 7. The App Engine Java SDK supports developing apps using either Java 6 or 7.

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. For instance, bytecode that attempts to open a socket or write to a file will throw a runtime exception.

Your app accesses most App Engine services using Java standard APIs. For the App Engine datastore, the Java SDK includes implementations of theJava Data Objects (JDO) andJava Persistence API (JPA) interfaces. Your app can usethe JavaMail API to send email messages with the App Engine Mail service. Thejava.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. See the documentation forthe datastore,memcache,URL fetch,mail,images andGoogle Accounts APIs.

Typically, Java developers use the Java programming language and APIs to implement web applications for the JVM. With the use of JVM-compatible compilersor interpreters , you can also use other languages to develop web applications, such as JavaScript, Ruby, or Scala.(采用和JAVA虚机兼容的编译器或解释器,就可以使用其它语言开发Web 应用)

 

For more information about the Java runtime environment, see The Java Runtime Environment

 

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 asDjango.

The Python environment includes the Python standard library. Of course, not all of the library's features can run in the sandbox environment. For instance, a call to a method that attempts to open a socket or write to a file will raise an exception. 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.

Application code written for the Python environment must be written exclusively in Python. Extensions written in the C language are not supported.

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 calledwebapp2 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.

For more information about the Python runtime environment, see The Python Runtime Environment.

 

The Go Runtime Environment

App Engine's Go runtime environment provides a convenient way to implement and deploy web applications written in theGo Programming Language.

The Go runtime environment runs the latest version of Go 1. 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. For example, attempts to open a socket or write to a file will return an os.EINVAL error.

The SDK includes an automated build service to compile your app, so you'll never need to invoke the compiler yourself. And—as 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 implmented in pure Go.

For more information about the Go runtime environment, see The Go Runtime Environment.

 

Storing Your Data 存储你的数据

The App Engine environment provides a range of options for storing your data:

  • App Engine Datastore provides a NoSQL schemaless object datastore, 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. For more information, see theJava,Python, and PHP docs for Cloud SQL. (云 SQL)( 指 SQL  as a Service? )
  • Google Cloud Storage provides a storage service for objects and files up to terabytes in size, accessible fromPython,PHP, andJava applications.

 

The Datastore 数据存储

App Engine provides a distributed NoSQL 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 betweentwo 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.

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 datastore interface include features for applying and enforcing structure within your app. Your app can also access the datastore directly to apply as much or as little structure as it needs.

The datastore provides ACID transactions usingoptimistic concurrency control. An update of an 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.

 

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.

 

Google Accounts

App Engine supports integrating an app with Google Accounts for user authentication. Your application can allow a user to sign in with a Google account, and access the email address and displayable name associated with the account. Using Google Accounts lets the user start using your application faster, because the user may not need to create a new account. It also saves you the effort of implementing a user account system just for your application.

If your application is running under Google Apps, it can use the same features with members of your organization and Google Apps accounts.

The Users API can also tell the application whether the current user is a registered administrator for the application. This makes it easy to implement admin-only areas of your site.

For more information about integrating with Google Accounts, see the Users API docs (Java,Python,PHP,Go).

App Engine Services 应用引擎的服务

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:下面的API就提供了讲到的这些服务:

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.

 

Scheduled Tasks and Task Queues 排产任务和任务队列

An application can perform tasks outside of responding to web requests. Your application can perform these tasks on a schedule that you configure, such as on a daily or hourly basis. Or, the application can perform tasks added to a queue by the application itself, such as a background task created while handling a request.

Scheduled tasks are also known as "cron jobs," handled by the Cron service. For more information on using the Cron service, see thePython orJava cron documentation.

Task queues keep track of tasks to handle in the background. The Python, Java, and Go runtime environments can use task queues. For information about the task queue service, seethe Python API documentation,the Java API documentation,the PHP API documentation, orthe Go API documentation.

 

 

Development Workflow 开发工作流

The App Engine software development kits (SDKs) for Java, Python, PHP, 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.

The Java SDK runs on any platform with Java 6 or Java 7. The SDK is available as a Zip file. If you use the Eclipse development environment, you can use theGoogle Plugin for Eclipse to create, test and upload App Engine applications. The SDK also includes command-line tools for running the development server and uploading your app.

The Python SDK is implemented in pure Python, and runs on any platform with Python 2.7, including Windows, Mac OS X and Linux. The SDK is available as a Zip file, and installers are available for Windows and Mac OS X.

The PHP SDK runs on any platform with PHP 5.4, including Windows, Mac OS X and Linux. The SDK is available as a Zip file, and installers are available for Windows and Mac OS X.

The Go SDK features an idiomatic, native Go API for using the App Engine services, and uses the same tools as the Python SDK (with some additional machinery for automatically compiling your Go apps). The Go SDK is stand-alone—you do not need to install Go separately—and is available as a Zip file for both Mac OS X and Linux (a Windows version will be available soon).

The Administration Console is the web-based interface for managing your applications running on App Engine. You can use it to create new applications, configure domain names, change which version of your application is live, examine access and error logs, and browse an application's datastore.

 

 

Quotas and Limits

Not only is creating an App Engine application easy, it's free! You can create an account and publish an application that people can use right away at no charge, and with no obligation. An application on a free account can use up to 1 GB of storage and up to 5 million page views a month. When you are ready for more, you can enable billing, set a maximum daily budget, and allocate your budget for each resource according to your needs.

You can register up to 10 applications per developer account.

Each app is allocated resources within limits, or "quotas." A quota determines how much of a given resource an app can use during a calendar day. In the near future, you will be able to adjust some of these quotas by purchasing additional resources.

Some features impose limits unrelated to quotas to protect the stability of the system. For example, when an application is called to serve a web request, it must issue a response within 60 seconds. If the application takes too long, the process is terminated and the server returns an error code to the user. The request timeout is dynamic, and may be shortened if a request handler reaches its timeout frequently to conserve resources.

Attempts to subvert or abuse quotas, such as by operating applications on multiple accounts that work in tandem, are a violation of theTerms of Service, and could result in apps being disabled or accounts being closed.

For a list of quotas and an explanation of the quota system, including which quotas can be increased by enabling billing, seeQuotas.

 

For More Information... 关于更详细的说明在这里

For more information about Google App Engine:

Welcome to Google App Engine!

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值