# Google App Engine

**Google App Engine** 是一个全托管、无服务器的平台，用于大规模开发和托管网络应用，作为 Google Cloud 的一部分提供。开发者可以从多种受支持的语言和框架中进行选择，App Engine 会根据需求调配服务器并扩缩应用实例。<sup>[1](https://docs.cloud.google.com/appengine/docs)</sup> 它于2008年4月7日以预览状态推出，让开发者能够在 Google 的基础设施上运行网络应用。<sup>[2](https://googleblog.blogspot.com/2008/04/developers-start-your-engines.html?hl=en_GB)</sup>

| 关键事实 | 详情 |
|---|---|
| 推出 | 2008年4月7日发布预览版，以 Python 作为首个受支持的语言<sup>[2](https://googleblog.blogspot.com/2008/04/developers-start-your-engines.html?hl=en_GB)</sup><sup> • </sup><sup>[3](https://aaltodoc.aalto.fi/server/api/core/bitstreams/d9a083d2-7814-43ae-97e7-ae67c77477dd/content)</sup> |
| 环境 | 两种执行环境：标准环境（沙箱实例）和柔性环境（Compute Engine 虚拟机上的 Docker 容器）<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> |
| 缩容至零 | 标准环境在无流量时可缩容至零个实例；柔性环境每个活跃版本至少需要一个实例<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> |
| 实例启动 | 标准环境为秒级；柔性环境为分钟级<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> |
| 请求超时 | 柔性环境最长可达60分钟；标准环境取决于运行时和扩缩类型（自动扩缩为10分钟，手动或基本扩缩为24小时）<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup><sup> • </sup><sup>[5](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)</sup> |
| 存储 | 最初围绕 Datastore 构建，这是一个 NoSQL 存储系统；高复制 Datastore 配置于2011年1月公布<sup>[6](https://www.googblogs.com/reflecting-on-our-ten-year-app-engine-journey/)</sup><sup> • </sup><sup>[7](https://cloudplatform.googleblog.com/2011/01/announcing-high-replication-datastore.html)</sup> |
| 当前指引 | Google 建议新项目评估 Cloud Run，并将其作为新 Google Cloud 用户的首选替代方案<sup>[5](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)</sup> |

## 起源与早期增长

App Engine 于2008年4月发布预览版，使在 Google 的基础设施上创建和运行网络应用变得简便，其精神与 Blogger 让写博客变得简单如出一辙。<sup>[2](https://googleblog.blogspot.com/2008/04/developers-start-your-engines.html?hl=en_GB)</sup> 初始版本仅支持 Python。<sup>[3](https://aaltodoc.aalto.fi/server/api/core/bitstreams/d9a083d2-7814-43ae-97e7-ae67c77477dd/content)</sup> 2009年初加入了对 Java 的支持，此后原则上可以使用 Java 虚拟机支持的任何语言。<sup>[3](https://aaltodoc.aalto.fi/server/api/core/bitstreams/d9a083d2-7814-43ae-97e7-ae67c77477dd/content)</sup> 2011年5月，Google 宣布 Go 将成为 App Engine 继 Python 和 Java 之后的第三种语言；Go 应用可编译为原生代码，Google 将其定位为非常适合 CPU 密集型任务的选择。<sup>[8](https://developers.googleblog.com/the-go-programming-language-is-coming-to-google-app-engine/)</sup>

使用迅速普及。一篇 Google Developers 博客文章称，每月有超过10万名开发者使用 App Engine，它托管了超过20万个活跃应用，每日提供超过15亿次站点访问。<sup>[9](https://developers.googleblog.com/en/google-app-engine-a-new-version-and-a-preview-of-future-plans/)</sup> GCP 工程总监 Max Ross 在2018年的一篇回顾中，将 App Engine 描述为 [Google Cloud Platform](https://www.edgepedia.org/zh/google-cloud-platform) 最早的几项投资之一，是一个在企业广泛理解无服务器概念之前就已存在的全托管无服务器平台，并指出其零服务器管理、[事件驱动编程](https://www.edgepedia.org/zh/event-driven-programming)和仅为所用资源付费的核心理念在十年后仍然具有现实意义。<sup>[6](https://www.googblogs.com/reflecting-on-our-ten-year-app-engine-journey/)</sup>

## 两种环境

App Engine 上的应用运行在两种执行环境之一中，单个应用可以同时使用两者，让不同服务各自利用相应环境的优势。<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup>

**标准环境。** 应用实例在沙箱中运行，使用受支持语言的运行时。沙箱限制了应用能做的事情：它只允许有限的一组二进制库，应用除对 `/tmp` 目录的读写访问外不能写入磁盘。CPU 和内存选项也受到限制。这些限制适合快速响应 HTTP 请求的无状态网络应用。<sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup><sup> • </sup><sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> 标准环境被描述为最适合打算免费或极低成本运行的应用，因为无流量时实例可缩容至零；也适合会经历突发极端流量峰值、需要立即扩缩的应用。<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> 它使用专门设计的自动扩缩算法，可以非常迅速地从零个实例扩展到数千个。<sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup>

**柔性环境。** 应用在 Google Compute Engine 虚拟机上的 [Docker](https://www.edgepedia.org/zh/docker-software) 容器中运行，限制较少：可使用任何编程语言、可写入磁盘（临时性，每次虚拟机启动时磁盘会初始化）、可使用任何库、可运行多个进程，并可选用任何 Compute Engine 机器类型以获得更多内存和 CPU。<sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup><sup> • </sup><sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup> 运行时可通过 Dockerfile 修改，支持 SSH 调试，并支持后台进程。代价是实例启动和部署较慢（分钟级而非秒级），不支持缩容至零，扩缩使用 Compute Engine 自动扩缩器，对流量变化的响应可能较慢。<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup><sup> • </sup><sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup> 柔性环境的虚拟机实例每周重启一次，期间 Google 的管理服务会应用操作系统和安全更新。<sup>[4](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)</sup>

一种常见的架构模式将两者结合：现有的标准环境应用通过 HTTP、Cloud Tasks 或 Cloud Pub/Sub 调用小型的柔性环境服务，来处理那些需要更多 CPU、更多内存、专用库或沙箱不允许的能力的工作负载，例如使用 unoconv 之类的 Linux 工具将文件转换为 PDF。<sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup>

## 服务与 Datastore

在标准环境中，应用传统上通过内置的 `google.appengine` API 访问 Datastore 等服务；在柔性环境中这些 API 不可用，应用改用 Google Cloud 客户端库，这些库在任何地方都能用，使应用更具可移植性，无需大量修改即可在 Google Kubernetes Engine 或 Compute Engine 上运行。<sup>[10](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)</sup>

Datastore 是 App Engine 关联的 NoSQL 存储系统，它将数据分布在多台机器上，并在广阔的地理区域内进行同步复制。这种设计带来一个权衡：任何单个实体组的写入吞吐量被限制在每秒约一次提交，强一致性查询需要祖先过滤器，事务最多限于25个实体组。<sup>[11](https://docs.cloud.google.com/appengine/docs/standard/services/datastore/structuring-for-strong-consistency?tab=go)</sup> 在最初的 Master/Slave Datastore 出现可靠性问题后，Google 于2011年1月公布了高复制 Datastore，它使用 Paxos 算法在数据中心之间实时同步数据，以增加写入延迟和改变 API 中的一致性保证为代价，提供了更高的可用性。<sup>[7](https://cloudplatform.googleblog.com/2011/01/announcing-high-replication-datastore.html)</sup>

Memcache、Images、Mail 和 Task Queues 等旧版捆绑服务最初仅在初代运行时中可用。2022年，Google 将这些旧版捆绑服务的访问权限全面开放给第二代 Java 11/17、Python 3 和 Go 1.12+ 运行时，从而简化了从旧运行时版本的升级。<sup>[12](https://cloud.google.com/blog/topics/developers-practitioners/new-java-ruby-python-php-runtimes)</sup>

## 运行时与生命周期

标准环境运行时按语言版本标识，例如 Java 17 或 Python 3.10，并使用由其社区维护的开源组件。当某个语言版本不再由其社区积极维护时，App Engine 将停止为该运行时提供维护和支持。Google 会在应用到达支持终止日期前90天发出应用内通知；该日期之后，安全更新停止，现有工作负载继续运行，但无法再在不受支持的运行时上进行新部署。<sup>[13](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/runtime-lifecycle)</sup>

初代运行时于2024年1月30日或31日终止支持：Python 2.7、Java 8、Go 1.11 和 PHP 5.5 的支持终止日期均为2024-01-30或2024-01-31，弃用日期在2026年，计划于2027年停用。<sup>[14](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/support-schedule)</sup> 当前运行时包括 Java 21 和 25、Python 3.12 至 3.14、Node.js 22 和 24、PHP 8.3 至 8.5，以及 Ruby 3.3 和 4.0，支持窗口视版本不同延伸至2028年至2031年。<sup>[14](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/support-schedule)</sup>

## App Engine 与 Cloud Run

Google 将 Cloud Run 描述为 Google Cloud 无服务器的最新演进，它建立在十多年运行 App Engine 的经验之上，并运行在与 App Engine 标准环境大体相同的基础设施上。它结合了 App Engine 两种环境的特点，可以处理无法在 App Engine 上运行的工作负载。<sup>[5](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)</sup> 与标准环境一样，Cloud Run 支持缩容至零以及自动和手动扩缩；与 App Engine 不同的是，其请求超时可配置至最长60分钟，默认5分钟，且同一项目中的服务可以部署到不同区域，而在 App Engine 中一个项目内的所有服务共享一个区域。<sup>[5](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)</sup> Google 的指引指出，Cloud Run 以更低的价格提供 GPU 等高级能力，并建议新的 Google Cloud 用户将 Cloud Run 作为优于 App Engine 的首选替代方案。<sup>[5](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)</sup>

## 实践中的应用

客户案例研究展示了该平台的典型角色。总部位于伦敦的应用开发商 Appogee 使用高复制 Datastore 和 Task Queues 在 App Engine 上构建了其请假管理产品，于2011年6月上线，后来服务于50多个国家的组织。<sup>[15](https://cloud.google.com/customers/appogee)</sup> 香港的 GreenTomato 将其观影应用 Hong Kong Movie 的网站运行在 App Engine 上，其自动扩缩功能在突发流量峰值期间部署资源，在低流量时段缩减资源，该公司报告称节省了30%的云支出。<sup>[16](https://cloud.google.com/customers/gt-group)</sup>

## References

1. [App Engine documentation, Google Cloud](https://docs.cloud.google.com/appengine/docs)
2. [Developers, start your engines, Official Google Blog (7 April 2008)](https://googleblog.blogspot.com/2008/04/developers-start-your-engines.html?hl=en_GB)
3. [Google App Engine (Aalto University thesis)](https://aaltodoc.aalto.fi/server/api/core/bitstreams/d9a083d2-7814-43ae-97e7-ae67c77477dd/content)
4. [Choose an App Engine environment, Google Cloud Documentation](https://docs.cloud.google.com/appengine/docs/the-appengine-environments)
5. [Compare App Engine and Cloud Run, Google Cloud Documentation](https://docs.cloud.google.com/appengine/migration-center/run/compare-gae-with-run?hl=en)
6. [Reflecting on our ten year App Engine journey, googblogs.com (2018)](https://www.googblogs.com/reflecting-on-our-ten-year-app-engine-journey/)
7. [Announcing the High Replication Datastore for App Engine, Google Cloud Platform Blog (January 2011)](https://cloudplatform.googleblog.com/2011/01/announcing-high-replication-datastore.html)
8. [The Go programming language is coming to Google App Engine, Google Developers Blog (May 2011)](https://developers.googleblog.com/the-go-programming-language-is-coming-to-google-app-engine/)
9. [Google App Engine: a new version and a preview of future plans, Google Developers Blog](https://developers.googleblog.com/en/google-app-engine-a-new-version-and-a-preview-of-future-plans/)
10. [App Engine flexible environment for users of App Engine standard environment, Google Cloud Documentation](https://docs.cloud.google.com/appengine/docs/flexible/flexible-for-standard-users?hl=en)
11. [Structuring data for strong consistency, App Engine standard environment documentation](https://docs.cloud.google.com/appengine/docs/standard/services/datastore/structuring-for-strong-consistency?tab=go)
12. [New Java, Ruby, Python, and PHP runtimes for Google App Engine and Cloud Functions, Google Cloud Blog (April 2022)](https://cloud.google.com/blog/topics/developers-practitioners/new-java-ruby-python-php-runtimes)
13. [Runtime lifecycle, App Engine standard environment documentation](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/runtime-lifecycle)
14. [Runtime support schedule, App Engine standard environment documentation](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/support-schedule)
15. [Appogee: Perfect Rating, Google Cloud customer case study](https://cloud.google.com/customers/appogee)
16. [GT Group Case Study, Google Cloud](https://cloud.google.com/customers/gt-group)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Named software products and platforms › Cloud, virtualization, and containers

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/google-app-engine

English original: https://www.edgepedia.org/google-app-engine
