What is Schema Drift?
Schema drift is any change to database structure:| Column | Before (Discovery T1) | After (Discovery T2) | Change |
|---|---|---|---|
| id | integer | integer | No change |
| user_id | integer | integer | No change |
| status | varchar | — | Removed (or renamed) |
| order_status | — | varchar | Added (possibly renamed from status) |
| total | decimal | decimal | No change |
| shipping_date | timestamp | — | Removed (or renamed) |
| shipping_estimate | — | timestamp | Added (possibly renamed from shipping_date) |
| delivery_fee | — | decimal | Added |
| created_at | timestamp | timestamp | No change |
Types of Schema Drift
Breaking Changes (High Risk)
Changes that will cause immediate failures:| Change | Example | Impact |
|---|---|---|
| Column Removed | shipping_status deleted | Queries referencing it fail |
| Table Removed | legacy_orders dropped | All queries to table fail |
| Column Renamed | status → order_status | Queries using old name fail |
| Incompatible Type Change | varchar → integer | Type mismatches, cast failures |
Non-Breaking Changes (Low-Medium Risk)
Changes that usually don’t cause immediate failures:| Change | Example | Impact |
|---|---|---|
| Column Added | New delivery_fee column | Existing queries work; new data available |
| Table Added | New order_items table | No impact on existing queries |
| Compatible Type Change | varchar(50) → varchar(100) | Usually transparent |
| Constraint Added | New unique constraint | May affect inserts, not selects |
How Drift is Detected
AnomalyArmor compares consecutive discovery runs:| Column | Run #1 (Baseline) | Run #2 (Comparison) | Result |
|---|---|---|---|
| id | Present | Present | No change |
| user_id | Present | Present | No change |
| status | Present | Missing | Removed |
| total | Present | Present | No change |
| order_status | Missing | Present | Added |
| created_at | Present | Present | No change |
status removed, column order_status added (possibly a rename, investigate).
Detection Timing
| Discovery Schedule | Max Detection Delay |
|---|---|
| Every 15 minutes | 15 minutes |
| Hourly | 1 hour |
| Daily | 24 hours |
Viewing Schema Drift
Asset Schema History
- Navigate to Assets
- Click on a table
- Select Schema History tab

Change Details
Click any change to see details:- Before state: Previous column definition
- After state: New column definition (or “Removed”)
- Detection time: When the change was discovered
- Discovery run: Which scan found it
Schema Drift Alerts
Setting Up Alerts
Create rules to notify you of drift:| Field | Value |
|---|---|
| Name | Production Breaking Changes |
| Event | Schema Change Detected |
| Data source | production-postgres |
| Schema | public, analytics |
| Change type | Column Removed, Table Removed, Type Changed |
| Destinations | Slack, PagerDuty |
Alert Content
Schema drift alerts include:Common Drift Scenarios
Scenario 1: Column Rename
Symptom: Column removed + column added with similar name- Confirm it’s a rename (ask the upstream team)
- Update all downstream references
- Verify queries work with new name
Scenario 2: Unannounced Migration
Symptom: Multiple columns changed in related tables- Identify the migration (check with upstream team)
- Review impact on your queries
- Update affected models
Scenario 3: Table Dropped
Symptom: Table no longer exists- Verify if intentional
- Update any queries referencing it
- Check if data was migrated elsewhere
Scenario 4: Type Change
Symptom: Column data type modified- Review aggregations (SUM, AVG) for precision changes
- Check comparisons and arithmetic
- Verify no type casting issues
Managing Expected Drift
Planned Schema Changes
When you know changes are coming:- Communicate: Tell your team about upcoming changes
- Prepare: Update downstream code in advance (staged rollout)
- Execute: Make the schema change
- Verify: Confirm AnomalyArmor detects it
- Acknowledge: Mark alerts as expected
Disabling Rules During Migrations
For large migrations:- Go to Alerts → Rules
- Toggle OFF relevant rules
- Perform migration
- Review detected changes
- Toggle rules back ON
Drift Prevention
Schema Versioning
Coordinate schema changes with version control:- Use migration tools (Flyway, Alembic, Atlas)
- Review migrations before applying
- Test in staging first
Change Communication
Establish processes:- Schema change announcements
- Dependency mapping
- Impact assessment before changes
Backward Compatibility
When changing schemas:- Add new columns instead of modifying existing
- Keep old columns during transition periods
- Use views to maintain compatibility
Troubleshooting
Drift detected but change was intentional
Drift detected but change was intentional
This is expected behavior. AnomalyArmor doesn’t know intent. It reports all changes. Consider:
- Acknowledging the alert
- Documenting the change in your records
- Disabling rules during planned migrations
Drift not detected
Drift not detected
- Check discovery schedule: Has discovery run since the change?
- Check scope: Is the table in a monitored schema?
- Check permissions: Can AnomalyArmor user see the table?
- Run manual discovery: Trigger discovery to check now
Too many drift alerts
Too many drift alerts
- Filter by change type: Alert only on breaking changes (removed columns/tables)
- Exclude dev/test: Don’t monitor volatile environments
- Use patterns: Exclude
*_temp,*_backuptables
False positive - rename detected as remove+add
False positive - rename detected as remove+add
This is expected. AnomalyArmor can’t automatically determine if a remove+add pair is a rename. You should:
- Investigate the pair manually
- Document the rename in your records
- Update downstream references
Best Practices
- Monitor production closely: Run frequent discovery, alert immediately
- Differentiate environments: Different rules for prod vs. dev
- Route by change type: Breaking changes → PagerDuty; additions → Email
- Review history regularly: Check drift patterns to identify risky areas
- Coordinate changes: Communicate schema changes before making them
Related Topics
Schema Monitoring Overview
Broader schema monitoring capabilities
Alert Rules
Configure drift alerts
Schema Changes Concept
Deep dive into change types
Asset Discovery
How assets are discovered
