服务 · Analytics · 基于 CLF-C02
Amazon Athena
Serverless SQL on S3. You pay for data scanned, so use partitions, Parquet and compression.
本课尚未翻译,暂以英文显示。
你在云从业者中已学过
- Athena runs standard SQL directly on files in S3, with nothing to load.
- You pay per query, for the data it scans.
- Table definitions come from the Glue Data Catalog.
Parquet or ORC
- Reads only the columns needed
Compression
- Fewer bytes to scan
Partitions
- Filters skip whole folders
Larger files
- Less overhead per file
Workgroup limits
- Caps cost per query or team
| Technique | Why it helps |
|---|---|
| Parquet or ORC | Reads only the columns needed |
| Compression | Fewer bytes to scan |
| Partitions | Filters skip whole folders |
| Larger files | Less overhead per file |
| Workgroup limits | Caps cost per query or team |
是什么
Cost and speed follow the data scanned. Three habits cut both. First, use a columnar format such as Parquet or ORC, so a query reads only the columns it needs. Second, compress the files. Third, partition the data, for example by date, so a query with a filter on the partition skips whole folders. Avoid thousands of tiny files: fewer, larger files read faster.
是什么
Workgroups separate teams and workloads. Each workgroup has its own query results location in S3, can enforce encryption, and can cap the data a query may scan or the total per day. Federated queries use Lambda-based connectors to run SQL on other sources, such as RDS or DynamoDB, and join them with data in S3. Use Athena for ad hoc and occasional queries. For heavy, repeated BI queries with many users, Redshift fits better.
要记住
- Pay per TB scanned. Parquet or ORC, compression and partitions cut the scan.
- Fewer, larger files beat many small ones.
- Workgroups: separate results location, settings and data scanned limits per team.
- Federated queries reach other sources through Lambda connectors.
- Query results are written to an S3 location you choose.
考试中
- “Reduce Athena cost” points to Parquet, compression and partitioning.
- “Occasional SQL on logs in S3 with no infrastructure” points to Athena.
- “Limit the cost of a team’s queries” points to workgroup data scanned limits.
- “Join S3 data with a database in one query” points to Athena federated query.
别和这些弄混
Amazon RedshiftA columnar data warehouse for repeated, complex SQL and BI. Choose nodes, Serverless, Spectrum and keys.
Amazon OpenSearch ServiceSearch and log analytics on live data. Move older data to cheaper tiers.
Amazon EMRManaged Spark and Hadoop clusters. Use Spot task nodes, S3 storage and short-lived clusters to save money.