Why should you prefer system-generated IDs for primary keys instead of business data like emails?

Test your Systems Design Concepts knowledge with our comprehensive quiz. Utilize flashcards and multiple choice questions to enhance your study session. Prepare thoroughly with detailed explanations for each answer and ace your examination!

Multiple Choice

Why should you prefer system-generated IDs for primary keys instead of business data like emails?

Explanation:
Primary keys should be stable identifiers that don’t change as business data or rules evolve. System-generated IDs give you exactly that: they’re created once and remain constant, so all foreign-key references stay valid even if a user’s attributes (like email) or the business rules change. If you base keys on business data, any change to that data would force updates across every table that references it, risking broken references and complex cascading updates. System-generated keys also keep identity separate from real-world attributes, which improves data integrity and performance. So the core reason is that these IDs stay stable even when business rules or data change.

Primary keys should be stable identifiers that don’t change as business data or rules evolve. System-generated IDs give you exactly that: they’re created once and remain constant, so all foreign-key references stay valid even if a user’s attributes (like email) or the business rules change. If you base keys on business data, any change to that data would force updates across every table that references it, risking broken references and complex cascading updates. System-generated keys also keep identity separate from real-world attributes, which improves data integrity and performance. So the core reason is that these IDs stay stable even when business rules or data change.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy