While ActiveRecord validations catch most invalid data, database constraints provide a safety net that prevents invariant violations even when validations are bypassed. I add null: false constraints for required columns, unique indexes for uniqueness constraints, and check constraints for domain validations like age > 0. Foreign key constraints with foreign_key: true prevent orphaned records when associations are deleted. The combination of validations (fast, user-friendly errors) and constraints (absolute guarantees) provides defense in depth. When a constraint is violated, Rails raises ActiveRecord::NotNullViolation or similar exceptions that I handle in error handlers. Constraints are especially important in applications with background jobs or data imports that might skip validation.