# AWS Glue

**AWS Glue** 是[亚马逊云科技](https://www.edgepedia.org/zh/amazon-web-services)（Amazon Web Services）推出的一项无服务器数据集成服务，用户无需预置或管理基础设施，即可发现、准备、移动和集成来自多个数据源的数据，用于分析、机器学习和应用开发。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup> 该服务于2017年8月14日正式全面可用，最初是一项全托管的提取、转换和加载（ETL）服务，此后已发展为覆盖 ETL、ELT 和流式工作负载的更广泛的数据集成平台。<sup>[2](https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/)</sup><sup> • </sup><sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup> 根据 Glue 团队2023年在 VLDB 上发表的论文，每月有数十万客户使用该服务。<sup>[3](https://www.amazon.science/publications/the-story-of-aws-glue)</sup>

| 关键事实 | 详情 |
|---|---|
| 发布 | 2017年8月14日宣布全面可用，定位为全托管、无服务器的 ETL 服务<sup>[2](https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/)</sup> |
| 范围 | 面向分析、机器学习和应用开发的无服务器数据集成，可连接70多个数据源<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup> |
| 作业类型 | Spark（批处理和流式）、Ray 和 Python shell 作业<sup>[4](https://docs.aws.amazon.com/glue/latest/dg/glue-version-support-policy.html)</sup> |
| 中央元数据 | AWS Glue 数据目录（Data Catalog），一个兼容 Hive 元数据存储的存储库，由自动推断模式的爬网程序填充<sup>[3](https://www.amazon.science/publications/the-story-of-aws-glue)</sup><sup> • </sup><sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> |
| 计费模式 | 按数据处理单元（DPU）按需付费；发布时，一个 DPU 提供 4 vCPU 和 16 GB 内存，在 us-east-1 区域每 DPU 小时收费 0.44 美元<sup>[2](https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/)</sup> |
| 当前版本 | AWS Glue 6.0 运行 Apache Spark 4.1.1、Python 3.13 和 Scala 2.13.17，并将每 DPU 小时价格相对 Glue 5.1 下调了30%<sup>[6](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-6-0-for-apache-spark/)</sup> |
| 使用规模 | 截至该服务2023年 VLDB 回顾论文，每月有数十万客户<sup>[3](https://www.amazon.science/publications/the-story-of-aws-glue)</sup> |

## 起源与设计原则

AWS Glue 于2017年在纽约举行的 AWS 峰会上发布，并于同年8月14日全面可用，最初在美国东部（弗吉尼亚北部）区域推出。<sup>[2](https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/)</sup><sup> • </sup><sup>[7](https://press.aboutamazon.com/2017/8/amazon-web-services-makes-aws-glue-available-to-all-customers)</sup> AWS 将其定位为手写 ETL 的替代方案，并援引内部分析称，数据集成在分析项目实施所需时间中占比可高达75%。<sup>[7](https://press.aboutamazon.com/2017/8/amazon-web-services-makes-aws-glue-available-to-all-customers)</sup>

该团队2023年的 VLDB 论文《AWS Glue 的故事》将设计原则描述为易用性、规模和可扩展性。Glue 的核心由面向 [Apache Spark](https://www.edgepedia.org/zh/apache-spark) 和 Python 的无服务器引擎组成，辅以自研的资源管理器，实现快速启动和自动扩缩容；它还提供 DynamicFrames，这是一种专为处理事件日志等杂乱、无模式的半结构化数据而设计的数据结构。<sup>[3](https://www.amazon.science/publications/the-story-of-aws-glue)</sup> DynamicFrame 扩展了 Apache Spark SQL DataFrame，使每条记录自带描述信息，初始无需定义模式。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup>

## 数据目录与爬网程序

AWS Glue 数据目录是一个集中式元数据存储库，用于管理跨数据源的数据资产，按数据库和数据表组织，另含爬网程序、分类器、连接和模式注册表等组件。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> ETL 作业运行时，会查询数据目录以理解数据并确保正确转换。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> 由于数据目录兼容 Hive 元数据存储，已编目的数据可立即通过 [Amazon Athena](https://www.edgepedia.org/zh/amazon-athena)、Amazon EMR 和 [Amazon Redshift](https://www.edgepedia.org/zh/amazon-redshift) Spectrum 进行搜索和查询。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup><sup> • </sup><sup>[3](https://www.amazon.science/publications/the-story-of-aws-glue)</sup>

**爬网程序**（crawler）连接数据存储，推断其模式，并在数据目录中创建或更新数据表。它们使用内置分类器识别数据格式，也可针对特定情况编写自定义分类器。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> 爬网程序支持基于文件的存储，包括 [Amazon S3](https://www.edgepedia.org/zh/amazon-s3)、Amazon DynamoDB、[Delta Lake](https://www.edgepedia.org/zh/delta-lake)、[Apache Iceberg](https://www.edgepedia.org/zh/apache-iceberg) 和 Apache Hudi；支持 JDBC 数据源，如 Amazon Redshift、Snowflake、Amazon Aurora、MariaDB、Microsoft SQL Server、MySQL、Oracle 和 PostgreSQL；还支持兼容 MongoDB 的存储，包括 MongoDB Atlas 和 Amazon DocumentDB。AWS Glue 不支持对数据流使用爬网程序。<sup>[8](https://docs.aws.amazon.com/glue/latest/dg/crawler-data-stores.html)</sup>

## ETL 引擎、作业与编排

AWS Glue 运行三种作业类型：用于批处理和流式处理的 Spark 作业、Ray 作业和 Python shell 作业。<sup>[4](https://docs.aws.amazon.com/glue/latest/dg/glue-version-support-policy.html)</sup> Spark 引擎通过内存处理将大数据工作负载分布到工作节点上。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> Python shell 适用于约10 GB 以内的小型或中型数据集的基本 ETL，可配置为1个 DPU（16 GB 内存）或0.0625个 DPU（1 GB 内存）。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup>

计算资源按工作节点类型划分：G.1X 每个工作节点提供 4 vCPU 和 16 GB 内存，计1个 DPU；G.2X 翻倍，计2个 DPU；G.4X 和 G.8X 面向高要求的转换任务，分别计4个和8个 DPU；G.025X（2 vCPU、4 GB）用于 Glue 3.0 及以上版本的低流量流式作业。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> 较新的 R 型、G.12X 和 G.16X 工作节点进一步扩展了大型 Spark 作业的选择范围。<sup>[9](https://aws.amazon.com/blogs/big-data/scale-your-aws-glue-for-apache-spark-jobs-with-r-type-g-12x-and-g-16x-workers/)</sup>

作业可按计划、按需或由事件触发调用，触发器可以串联依赖的作业和爬网程序；工作流将多个爬网程序、作业和触发器组合成一个可视化的执行流程。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup><sup> • </sup><sup>[10](https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html)</sup> 作业书签（job bookmark）跟踪已处理的数据，使后续运行只处理新数据。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> 编写方式包括 AWS Glue Studio 可视化界面、交互式会话和作业笔记本、AWS CLI 以及完整的 API。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup>

## 流式处理

Glue 支持在传输过程中清洗和转换流式数据，使其在数秒内即可在目标存储中用于分析。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup> Spark Structured Streaming 有两种执行模式。微批模式在所有 Glue 版本中可用，支持 Kafka 和 Kinesis 数据源、Python 和 Scala、有状态和无状态操作以及自动扩缩容，由于逐批调度的开销，典型最低延迟为1至2秒。实时模式在 AWS Glue 6.0 中引入，将端到端延迟降至亚秒级，符合条件的工作负载可达到毫秒级延迟，但仅限于 Kafka 数据源、Scala、无状态操作和固定工作节点数，且需通过作业参数 `--enable-real-time-mode` 显式启用。<sup>[11](https://docs.aws.amazon.com/us_en/glue/latest/dg/glue-streaming-execution-models.html)</sup>

## 版本与定价

每个 Glue 版本都固定了底层的 Spark、Python 和 Scala 运行时。Glue 5.1 运行 Spark 3.5.6、Python 3.11 和 Scala 2.12.18，附带[开放表格式](https://www.edgepedia.org/zh/open-table-format)库 Hudi 1.0.2、Iceberg 1.10.0 和 Delta Lake 3.3.2。<sup>[12](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-5-1-for-apache-spark/)</sup> Glue 6.0 升级至 Spark 4.1.1、Python 3.13 和 Scala 2.13.17，附带 Iceberg 1.11.0、Hudi 1.1.1 和 Delta Lake 4.2.0，并新增对 Apache Iceberg V3 规范的支持，包括带自动拆解的 VARIANT 类型、删除向量、行血缘跟踪、纳秒级时间戳和地理空间类型。<sup>[6](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-6-0-for-apache-spark/)</sup>

Glue 6.0 还将每 DPU 小时的使用费率相对 Glue 5.1 下调了30%。在 AWS 公布的 TPC-DS 基准测试中，使用30个 G.2X 工作节点对 Amazon S3 中的 Parquet 数据在3 TB 规模下测试，预估成本从 Glue 5.1 的8.87美元降至 Glue 6.0 的5.61美元，该公司称性价比提升最高达36%。<sup>[6](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-6-0-for-apache-spark/)</sup> 旧版本正在退役：Glue 0.9、1.0和2.0版本将于2026年4月1日终止支持，此后无法再在这些版本上创建新作业或启动作业运行。<sup>[13](https://docs.aws.amazon.com/glue/latest/dg/release-notes.html)</sup><sup> • </sup><sup>[4](https://docs.aws.amazon.com/glue/latest/dg/glue-version-support-policy.html)</sup>

## 相关服务与典型用法

Glue 处于更广泛的 AWS 分析技术栈之中。[AWS Lake Formation](https://www.edgepedia.org/zh/aws-lake-formation) 为数据目录资源增加细粒度访问控制，AWS Glue DataBrew 提供可视化的无代码数据准备功能。<sup>[1](https://docs.aws.amazon.com/glue/latest/dg/)</sup> 启用 Lake Formation 后，Glue 仅对 [Apache Hive](https://www.edgepedia.org/zh/apache-hive) 和 Apache Iceberg 表支持细粒度访问控制，且仅限 Spark 作业，每个作业仅限一个 Spark 会话。<sup>[14](https://docs.aws.amazon.com/glue/latest/dg/security-lf-enable-considerations.html)</sup>

有记录的客户案例展示了该服务的适用范围。GE Aviation 使用 AWS Glue ETL 配合数据目录，将批处理 CSV 文件转换为 Parquet，并对 S3 中的表应用变更数据捕获更新，将更新视为先删除后插入。<sup>[15](https://aws.amazon.com/blogs/big-data/how-ge-aviation-built-cloud-native-data-pipelines-at-enterprise-scale-using-the-aws-platform/)</sup> FinAccel 报告称使用 Glue 从其 S3 数据湖向 Amazon Redshift 执行日常 ETL，为商业智能工具和[信用评分模型](https://www.edgepedia.org/zh/credit-scoring-model)提供数据。<sup>[16](https://aws.amazon.com.cdn.amazon.com/glue/customers/)</sup>

从业者的反馈也指出了局限。作业启动需要数分钟而非数秒，成本由消耗的 DPU 小时驱动，因此大数据量更适合跨节点横向扩展。<sup>[5](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)</sup> 与 [Databricks](https://www.edgepedia.org/zh/databricks) 的比较通常认为，Glue 作为 AWS 原生的集成和编目层更强，而 Databricks 在交互式开发、声明式数据质量和列级血缘方面更强。<sup>[17](https://github.com/144853/retail-pipeline-databricks-glue/blob/main/docs/COMPARISON.md)</sup>

## References

1. [What is AWS Glue? AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/)
2. [Launch – AWS Glue Now Generally Available, AWS News Blog (August 14, 2017)](https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/)
3. [The Story of AWS Glue, Amazon Science (VLDB 2023)](https://www.amazon.science/publications/the-story-of-aws-glue)
4. [AWS Glue version support policy, AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/glue-version-support-policy.html)
5. [Getting started with serverless ETL on AWS Glue, AWS Prescriptive Guidance](https://docs.aws.amazon.com/pdfs/prescriptive-guidance/latest/serverless-etl-aws-glue/serverless-etl-aws-glue.pdf)
6. [Introducing AWS Glue 6.0 for faster and more cost-effective data integration, AWS Big Data Blog](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-6-0-for-apache-spark/)
7. [Amazon Web Services Makes AWS Glue Available To All Customers, Amazon Press Center (August 14, 2017)](https://press.aboutamazon.com/2017/8/amazon-web-services-makes-aws-glue-available-to-all-customers)
8. [Supported data sources for crawling, AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/crawler-data-stores.html)
9. [Scale your AWS Glue for Apache Spark jobs with R type, G.12X, and G.16X workers, AWS Big Data Blog (July 17, 2025)](https://aws.amazon.com/blogs/big-data/scale-your-aws-glue-for-apache-spark-jobs-with-r-type-g-12x-and-g-16x-workers/)
10. [Overview of workflows in AWS Glue, AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html)
11. [Streaming execution models, AWS Glue Developer Guide](https://docs.aws.amazon.com/us_en/glue/latest/dg/glue-streaming-execution-models.html)
12. [Introducing AWS Glue 5.1 for Apache Spark, AWS Big Data Blog (December 9, 2025)](https://aws.amazon.com/blogs/big-data/introducing-aws-glue-5-1-for-apache-spark/)
13. [AWS Glue versions, AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/release-notes.html)
14. [Considerations and limitations (Lake Formation with AWS Glue), AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/security-lf-enable-considerations.html)
15. [How GE Aviation built cloud-native data pipelines at enterprise scale using the AWS platform, AWS Big Data Blog (November 16, 2021)](https://aws.amazon.com/blogs/big-data/how-ge-aviation-built-cloud-native-data-pipelines-at-enterprise-scale-using-the-aws-platform/)
16. [AWS Glue Customers, Amazon Web Services](https://aws.amazon.com.cdn.amazon.com/glue/customers/)
17. [Detailed Comparison: Databricks DLT vs. AWS Glue, GitHub comparison document](https://github.com/144853/retail-pipeline-databricks-glue/blob/main/docs/COMPARISON.md)

---
*Initially written 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/aws-glue

English original: https://www.edgepedia.org/aws-glue
