Course contentsShow
← System Design
Lesson 297 of 1,9198. Database Performance OptimizationFree lesson

Denormalization in Practice

Apply selective denormalization to hot paths while maintaining normalization elsewhere.

Denormalization in Practice

You'll learn: How to strategically apply denormalization to performance-critical paths while keeping most of your schema normalized.

The Selective Approach

Denormalization doesn't mean abandoning normalization everywhere. In practice, you identify hot paths—the queries that run thousands or millions of times per day—and denormalize only those specific data access patterns. The rest of your database remains properly normalized.

Think of it like express lanes on a highway. Most traffic uses regular lanes (normalized schema with joins), but during rush hour, you add an express lane (denormalized path) for the heaviest route without rebuilding the entire road system.

Identifying Hot Paths

Start by monitoring your slow query logs and application metrics. Look for:

  • Queries with high execution frequency
  • Complex joins hitting multiple tables repeatedly
  • Queries causing replication lag during peak load
  • User-facing features with strict latency requirements (like feed generation or search results)

These are your candidates for selective denormalization.

Implementation Strategy

Once you've identified a hot path, apply the appropriate denormalization technique just for that use case:

  • Duplicate critical fields into frequently-queried tables to eliminate joins
  • Create aggregation tables for expensive count/sum operations
  • Use materialized views to pre-compute complex reports
  • Embed related data in document stores for single-read access

The key is containment: keep denormalization targeted and well-documented. Most of your system stays normalized, making schema evolution easier and data integrity simpler to maintain.

Key Takeaway: Denormalization works best when applied surgically to proven bottlenecks rather than as a blanket strategy—normalize by default, denormalize by measurement.