Cataloguing Data with the AWS Glue Data Catalog and Crawlers
This lesson explains the AWS Glue Data Catalog, the shared, Hive-compatible metadata layer that AWS analytics services use to find and understand data in the lake, and the crawlers that populate it.
Learning outcomes
After completing this lesson, you will be able to:
- Describe databases, tables and partitions in the Data Catalog.
- Configure crawlers to create and update tables.
- Use partition indexes and partition projection for tables with many partitions.
- Define tables without crawlers.
The Data Catalog
The AWS Glue Data Catalog is the central metadata store for data on AWS. It stores databases, which group related tables; tables, which record a dataset's schema, location and format; partitions; and connections to data stores. There is one catalogue per account in each Region.
Its value is that many services share it. Amazon Athena, Amazon EMR, Redshift Spectrum, Glue jobs, AWS Lake Formation and Amazon SageMaker AI all read the same table definitions, so a table defined once can be queried by any of them. Metadata and connection passwords can be encrypted with AWS KMS. Access is controlled with IAM, with catalogue resource policies, which also allow cross-account access, and with Lake Formation for fine-grained permissions.
The following diagram shows the Data Catalog and the services that share its definitions.

The Glue Data Catalog
Crawlers
A Glue crawler connects to a data store, such as Amazon S3, a JDBC database or Amazon DynamoDB, examines the data and creates or updates tables and partitions in the Data Catalog. Classifiers determine each dataset's format and infer its schema; built-in classifiers recognise common formats, and custom classifiers handle unusual ones.
When a crawler finds that a schema has changed, its schema change policy decides what happens: update the table definition, add new columns only, or only log the change for review. For large S3 datasets, S3 event mode uses S3 event notifications delivered through Amazon SQS to crawl only the folders that changed since the last run, which is much faster and cheaper than re-crawling everything.
The following diagram compares the tables a Glue crawler creates from two folder layouts.

Crawler behaviour
Tables with many partitions
A table partitioned by several columns, such as date and hour, can have hundreds of thousands of partitions, and query engines then spend a long time just listing which partitions to read. Partition indexes on the Glue Data Catalog let engines find matching partitions quickly instead of listing them all. Athena partition projection goes further: Athena calculates the partition locations from configured rules, such as a date range, without reading the catalogue at all. For Iceberg tables, catalogue optimisers keep tables healthy automatically by compacting small files, expiring old snapshots and deleting orphaned files. The following table summarises the features.
| Feature | Benefit |
|---|---|
| Partition indexes | Speed up partition filtering |
| Athena partition projection | Calculates partitions from configuration instead of reading the catalogue |
| Iceberg catalogue optimisers | Compaction, snapshot retention and orphan file deletion |
The following diagram compares the three ways an engine can find the partitions a query needs.

Many partitions
Other ways to define tables
Crawlers are convenient, but tables can also be defined without them, and often should be. Tables can be created with Athena DDL statements such as CREATE EXTERNAL TABLE, through the Glue API, or in AWS CloudFormation templates alongside the rest of a pipeline's infrastructure. ETL jobs can update the catalogue as they write, with the enableUpdateCatalog option, so new tables and partitions appear without a separate crawl. Partitions can be added with MSCK REPAIR TABLE or ALTER TABLE ADD PARTITION.
Defining schemas explicitly avoids surprises from inferred types, such as a column that a crawler infers as a number in one run and as a string in the next because of a few unusual values.
Defining tables without crawlers
A crawler that creates hundreds of tables
A crawler over s3://lake/raw/events/ creates a separate table for every date folder instead of one partitioned table.
| Cause | Fix |
|---|---|
Folders use 2026-10-01/ instead of dt=2026-10-01/, and schemas differ slightly between days | Use Hive-style partition folders |
| Inconsistent file formats or headers across folders | Fix the producer or exclude bad files |
| Crawler grouping behaviour | Enable "Create a single schema for each S3 path" |
For tables that receive a new partition every hour, the team stops re-running the crawler and uses partition projection instead, so new partitions are queryable in Athena immediately without any catalogue updates.
How can a crawler process only newly added files?
Show answer
With S3 event mode, which crawls only the changes reported by S3 events instead of the whole location.
Exam Tips
Remember for the exam
- To discover schemas automatically, use a Glue crawler.
- For incremental crawls of only new files, use S3 event mode.
- To speed up queries on tables with many partitions, use partition indexes or partition projection.
- For fine-grained table, column and row permissions, use Lake Formation on the Data Catalog.
- A single metadata store for Athena, EMR and Redshift Spectrum is the Glue Data Catalog.