Preparing metadata for the AWS Glue Data Catalog
AWS Glue Data Catalog brings your Aurora databases into a single, governed catalog alongside your other AWS data, giving your teams and AI agents a shared, current view of your data estate. When you enable data discovery and cataloging in your account, resource metadata such as resource identifiers, engine versions, and endpoints for your Aurora PostgreSQL-Compatible Edition and Aurora MySQL-Compatible Edition clusters become available in the catalog automatically. AWS keeps this metadata current as resources are created and changed, with no crawlers, or discovery pipelines to manage. In preview, you can also choose which Aurora PostgreSQL clusters make schema metadata available in the Glue Catalog, including databases, schemas, tables, and columns. You and your AI agents can then start from a business question, find which databases hold the relevant data, and understand what that data represents.
Metadata that Amazon RDS prepares
Resource metadata describes your Aurora DB clusters and the DB instances in them. The Data Catalog builds it from the configuration of each resource. It does not require any collection on your database.
Schema metadata (Preview) describes the databases, schemas, tables, views, materialized views, and foreign tables inside an Aurora PostgreSQL DB cluster. Amazon RDS prepares it by running a collection process that reads only the system catalog of the database engine.
After you turn on auto-discovery for your account, the Data Catalog populates metadata for your resources in the background over time, with no further action from you.
Resource metadata is available in all AWS Regions where AWS Glue Data Catalog is available. Schema metadata is available in preview in the following AWS Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Malaysia), Asia Pacific (Mumbai), Asia Pacific (Thailand), Asia Pacific (Tokyo), Europe (Ireland), and Europe (Spain).
Eligibility for schema metadata collection
Schema metadata is available only for Aurora PostgreSQL. The requirements in this section apply to schema metadata, not to resource metadata. The service collects schema metadata for a DB cluster that meets all of the following requirements, which it evaluates in no particular order.
-
Status: A DB cluster and its DB instances are eligible once creation finishes and remain eligible until deletion starts. A resource in a terminal state, such as a storage failure or one of the incompatible states, is not eligible.
-
Database engine: Aurora PostgreSQL is eligible. For Aurora MySQL, Amazon RDS prepares resource metadata only.
-
Engine major version: Aurora PostgreSQL version 13 and higher is eligible.
-
Aurora PostgreSQL Limitless Database: A DB cluster that uses Aurora PostgreSQL Limitless Database is not eligible.
-
DB instances: The DB cluster has at least one DB instance.
Being a replica has no effect on eligibility. Aurora Replicas, secondary DB clusters in an Aurora global database, and cross-Region read replica DB clusters are all eligible when they meet the preceding requirements.
In addition to these requirements, you control collection with the following two settings:
-
Auto-discovery – Your AWS account must have auto-discovery turned on.
-
Opt-out tag – The DB cluster must not have the opt-out tag. For the tag and how to apply it, see Turning off schema metadata collection.
If either of these settings stops a collection, Amazon RDS records the reason in the AWS CloudTrail event for the DescribeSchemas request. If a resource doesn't meet one of the preceding requirements, Amazon RDS doesn't report a reason.
Turning off schema metadata collection
To stop Amazon RDS from collecting schema metadata for an Aurora DB cluster, add the tag key DataModelPreviewOptOut with the tag value true to it. The following AWS CLI example adds the tag.
aws rds add-tags-to-resource \ --resource-name arn:aws:rds:us-east-1:111122223333:cluster:my-aurora-cluster \ --tags Key=DataModelPreviewOptOut,Value=true
For more information about tagging, see Tagging Amazon Aurora andAmazon RDS resources. To turn collection back on, remove the tag or change its value.
When Amazon RDS collects schema metadata
Amazon RDS doesn't collect schema metadata on a fixed schedule. A collection starts only when the Data Catalog requests the schema metadata for a resource, and only if all of the following are true:
-
The resource is eligible for schema metadata collection.
-
The status of the resource is
available. -
No collection has run for the resource, or at least 8 hours have passed since the last change in collection status for the resource. Amazon RDS records a status change when a collection starts, when it is processed, when it completes, and when it fails.
-
No other schema collection is already pending for the resource.
While the status of a resource is anything other than available, such as modifying, stopped, or backing-up, the Data Catalog continues to show the most recently collected schema metadata, and Amazon RDS does not start a new collection. If you delete a DB cluster, Amazon RDS cancels any pending or running collection for it.
The Data Catalog refreshes the schema assets for a resource when Amazon RDS delivers newly collected schema metadata for that resource. For how the Data Catalog adds and removes assets during a refresh, see "Amazon RDS and Aurora asset types" in the AWS Glue Data Catalog User Guide.
DB instance that Amazon RDS reads in a DB cluster
For a DB cluster, Amazon RDS reads the schema metadata from one DB instance in the cluster. Only DB instances with a status of available are candidates. Amazon RDS uses the first candidate in the following order that passes the applicable capacity check, and breaks any tie at random. The following section describes the capacity checks.
-
A provisioned reader that does not use a burstable DB instance class. No capacity check applies.
-
A provisioned reader that uses a burstable DB instance class.
-
An Aurora Serverless reader that is not paused, starting with the reader that has the most capacity headroom.
-
The writer, unless it is a paused Aurora Serverless writer.
-
A paused Aurora Serverless DB instance, in this order: a reader in promotion tier 2 or higher, then any other reader, then the writer. Waking a reader in tier 2 or higher leaves the writer paused.
If a candidate cannot start the collection, Amazon RDS moves to the next candidate without ranking them again, and rechecks capacity before it uses that candidate.
If the DB cluster has no DB instances, the collection completes without collecting any metadata. If it has DB instances but none of them is available, the collection ends without an event.
Capacity checks
The following table describes the capacity checks that Amazon RDS runs on certain kinds of DB instances before it starts a collection on them.
| DB instance | Metric | Requirement |
|---|---|---|
Provisioned DB instance with a burstable DB instance class (a class that starts with db.t, such as db.t2, db.t3, db.t3a, and db.t4g) |
CPU credit balance, as the average over a 5-minute period, using the newest data point from the last 15 minutes | At least 10 CPU credits by default |
| Aurora Serverless DB instance | ServerlessDatabaseCapacity, as the average over a 1-minute period, using a data point that is no older than 3 minutes |
The maximum capacity minus the current capacity is at least 4 Aurora capacity units (ACUs) by default |
If an Aurora Serverless DB instance has no ServerlessDatabaseCapacity data point in the last 3 minutes, Amazon RDS treats it as paused at 0 ACUs and allows the collection.
To keep the Aurora Serverless DB instances in a DB cluster able to pass the capacity check, set the maximum capacity of the DB cluster at least 4 ACUs above its minimum capacity. For more information, see the MAX_CAPACITY_TOO_LOW event in Events for skipped schema collections.
If a measured shortfall in CPU credits or ACU headroom continues past a retry period, Amazon RDS stops trying and sends an INSUFFICIENT_RESOURCES event. If Amazon RDS cannot read the metric, it retries until the collection reaches its time limit.
Resource checks during schema collection
The eligibility requirements determine whether Amazon RDS can collect schema metadata for a resource at all. The checks in this section determine whether a collection can run at a given time. The collection process runs the checks on the DB instance that it reads.
Only one collection runs on a DB instance at a time. If a second collection starts while one is already running, the second collection stops before it runs any checks or queries.
DB instance checks
The following table describes the checks that the collection process runs on the DB instance, and the event that Amazon RDS sends when a check fails.
| Check | Requirement | Event |
|---|---|---|
| Idle vCPU | At least 1 idle vCPU, measured over a 5-second sample | INSUFFICIENT_RESOURCES |
| CPU utilization | Less than 90 percent, over the same 5-second sample. Amazon RDS also fails this check when it cannot take the sample, or when it cannot determine the vCPU count of an Aurora Serverless DB instance. | INSUFFICIENT_RESOURCES |
| Available memory | At least 32 MB. Amazon RDS also fails this check when it cannot measure available memory. | INSUFFICIENT_RESOURCES |
| Rapid scaling | Aurora Serverless only. The DB instance is not scaling rapidly. | INSUFFICIENT_RESOURCES |
| Connectable databases | At least one database remains after Amazon RDS removes template databases and databases that do not allow connections | None |
| Number of databases | Up to 100 databases | SIZE_LIMIT_EXCEEDED |
| Output size | Up to 140 MiB of collected metadata. Amazon RDS checks the running total during the collection and again at the end. | SIZE_LIMIT_EXCEEDED |
On Aurora Serverless, the idle vCPU check measures headroom against the vCPU count of the instance's local maximum capacity, and the 90 percent CPU utilization check still applies. The available memory check does not apply. The shared buffers check for each database uses 70 percent of the memory at the instance's local maximum capacity.
Some conditions stop a collection without producing an event. For the full list, see Events for skipped schema collections.
Database checks
Amazon RDS checks each database before it reads it. The first database that fails a check stops the entire collection, and Amazon RDS delivers no metadata to the Data Catalog, including metadata from databases that it already read. The only exception is the pg_tle check. When a database fails that check, Amazon RDS skips the database and continues with the next one.
The following list describes the database checks and related collection behavior.
-
pg_tleextension: The database does not have thepg_tleextension installed. If it does, Amazon RDS skips the database and continues with the next one. -
Expected query time: By default, the estimated time to read the database can be up to 30 seconds. Amazon RDS also uses this value as the
statement_timeoutfor the read. -
Order of checks: Expected query time first. Amazon RDS runs the shared buffers check only if the database passes the expected query time check.
-
Cache protection: The size of 21
pg_catalogtables, as reported bypg_total_relation_size, must fit in 10 percent ofshared_buffers. -
Lock wait: 5 seconds.
-
Session: A repeatable read, read-only transaction with
client_encodingset toUTF8,search_pathset topg_catalog, and no parallel workers. -
Time limit for the whole collection: 900 seconds.
-
Databases that Amazon RDS never collects:
rdsadmin,template0,template1, and any database that is a template or that does not allow connections.
Events for skipped schema collections
When Amazon RDS skips a schema collection or cannot complete it, Amazon RDS can send an Amazon RDS event with one of the five reasons in the following table. The event is SCHEMA_COLLECTION_FAILED_DB_CLUSTER, and its source is the DB cluster. Amazon RDS sends these events on a best-effort basis. For more information about Amazon RDS events, see Amazon RDS event categories and event messages for Aurora.
In the messages, name is the name of the resource, n is the minimum ACU headroom (4 ACUs by default), and databases is the list of skipped databases.
| Reason | Event ID | Message | When Amazon RDS sends it |
|---|---|---|---|
MAX_CAPACITY_TOO_LOW |
RDS-EVENT-0666 | Schema collection was skipped for the name because the maximum capacity is less than n ACUs above the minimum capacity. Increase the maximum capacity or lower the minimum capacity so that the difference is at least n ACUs to enable schema collection. |
The maximum capacity of an Aurora Serverless configuration is less than n ACUs above its minimum capacity. In a DB cluster, this makes only the Aurora Serverless DB instances ineligible. Amazon RDS then selects the writer without an ACU check, and sends the event only if the writer is itself an Aurora Serverless DB instance. |
INSUFFICIENT_RESOURCES |
RDS-EVENT-0666 | Schema collection was skipped for the name because of insufficient available resources. No action is required. Schema collection will be retried later. |
The idle vCPU, CPU utilization, available memory, shared buffers, or rapid scaling check fails, or a check query times out. Amazon RDS also sends this event, without starting a collection, when a measured shortfall in CPU credits or ACU headroom continues past a retry period. |
SIZE_LIMIT_EXCEEDED |
RDS-EVENT-0666 | Schema collection was skipped for the name because the schema exceeds the maximum supported size. Reduce the schema size to enable schema collection. |
The output size, number of databases, or expected query time check fails. Amazon RDS also sends this event when the read of a database times out, or when the collection process is stopped at its time limit. |
PAUSED_DURING_COLLECTION |
RDS-EVENT-0666 | Schema collection was skipped for the name because the DB instance paused during collection. Increase the SecondsUntilAutoPause setting or set the minimum capacity above 0 ACUs to enable schema collection. |
The collection fails with an unexpected error on an Aurora Serverless DB instance with a minimum capacity of 0 ACUs, and Amazon RDS confirms that the DB instance paused. Amazon RDS confirms the pause by looking for a capacity data point of 0 that is newer than its first check. If no such data point arrives within 3 minutes, or if Amazon RDS cannot read the metric, it records the failure without sending an event. |
PG_TLE_INSTALLED |
RDS-EVENT-0666 | Schema collection skipped databases because the pg_tle extension is installed. Remove the extension from these databases to include them in the schema catalog. |
One or more databases have the pg_tle extension installed. If Amazon RDS skips some databases, the collection succeeds, the Data Catalog makes the metadata for the other databases available, and the message names the skipped databases. If Amazon RDS skips every database, the collection fails and the message reads "all databases". |
Amazon RDS does not send an event in the following cases:
-
The scaling state or the shared buffers cannot be measured.
-
Aurora Serverless capacity cannot be measured.
-
The DB instance has no connectable databases.
-
A collection is still running at the end of the wait period.
-
The upload of the collected metadata fails.
-
Another collection is already running on the DB instance.
-
The collection result does not include a checksum.
-
No candidate DB instance in a DB cluster can be reached.
Any other failure that the preceding table does not list also ends without an event.
What the schema preparation reads from your database
The preparation process reads only catalog metadata, such as the names, types, keys, indexes, and comments of your schema objects. It never reads table or column data, and every collection session is read-only. Amazon RDS does not collect sequences, triggers, stored procedures, or the bodies of views, materialized views, and row security policies.
Schema metadata is encrypted at rest while Amazon RDS prepares it and while it is in the Data Catalog. During preparation, Amazon RDS encrypts the metadata with an AWS owned key, not the AWS KMS key that encrypts your DB cluster, and you do not need to configure anything. In the Data Catalog, the metadata is encrypted with the key that you choose in your Data Catalog settings.
Limits for schema metadata collection
The following table lists the limits that apply to one schema metadata collection.
| Limit | Value |
|---|---|
| Tables, views, materialized views, and foreign tables in one collection | 100,000 |
| Objects of one asset type in one collection | 1,000 batches of at most 100 objects or 5 MiB each |
| Size of collected metadata | 140 MiB (146,800,640 bytes) |
The limits for the size of collected metadata, the number of tables and similar objects, and the number of objects of one asset type apply to the whole collection. If a collection exceeds any of these limits, the whole collection fails as too large. Amazon RDS does not retry that collection, and the previously collected metadata remains in the Data Catalog.