Web Fundamentals

Data Normalization: Organizing State for Performance

Web Fundamentals Map

Rendering & Browser Architecture

Critical Rendering PathScript Loading Patterns (async/defer)Event Loop Deep DiveJavaScript Module Systems (CJS, ESM, UMD)Dynamic Module Loading (import())Import on InteractionImport on VisibilityBrowser Rendering Pipeline & Layout ThrashingRendering Strategies (CSR, SSR, SSG, ISR)Streaming SSR & Progressive HTMLIslands ArchitectureReact Server ComponentsFramework Reactivity (React, Vue, Svelte, Solid)HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)DNS Resolution & TTL Caching

Performance

Core Web Vitals: LCP, INP, CLSPerformance Optimization Trade-offsCritical Resource PrioritizationCode Splitting & Dynamic ImportsTree Shaking & Dead Code EliminationLazy LoadingResource Hints: Preload, Prefetch & PreconnectText Compression: Gzip & BrotliImage & Video OptimizationAdaptive LoadingList VirtualizationWeb Workers vs Main ThreadMemory Leaks: Detection & PreventionManaging Third-Party ScriptsHow CDNs WorkHTTP Caching Deep DiveService Workers & Offline StrategyPWA Fundamentals

Security

Cross-Site Scripting (XSS)Cross-Site Request Forgery (CSRF)CORS ExplainedCORS Preflight, Credentials & MisconfigurationsContent Security Policy (CSP)Why is HTTPS Secure? (TLS/SSL)Authorization Best PracticesCookie Security & Session Hardening

State & Data Architecture

State Management Guide (Context vs Zustand vs Redux)React Query & Server State CachingData Fetching PatternsCaching StrategiesPagination: Offset vs Cursor-BasedReal-time Communication (WebSocket, SSE, Polling)
mediumWeb Fundamentals

Data Normalization: Organizing State for Performance

Learn the interview-ready mental model, practical trade-offs, and production patterns for this web fundamentals topic.

Topic content

TL;DRNormalize data into lookup tables (by ID) + relationship arrays. Enables O(1) access, single source of truth, and simple updates.
High Signal
Google
Meta
Netflix
Agoda
30-Second Answerstart every interview with this

Data normalization transforms nested, hard-to-update state into flat lookup tables (entities by ID) and relationship arrays. This pattern dramatically improves performance, maintainability, and update predictability in complex applications like Kanban boards, social feeds, and e-commerce catalogs.

Entities are books stored on shelves by ID (O(1) lookup). Relationships are index cards pointing to book IDs. When you update a book, you only change it once — every index card automatically sees the update. No need to search through every shelf.

Raw Nested Data
Normalize
Entities (by ID) + Relations (arrays of IDs)
O(1) access + Simple updates

1Normalized Structure Pattern

Use three parts: lookup tables for entities, arrays of IDs for relationships/order, and separate UI state.

2Why Normalization Matters

Eliminates deep nesting, duplication, and complex immutable updates. Provides single source of truth and O(1) access.

3Real-World Examples

Kanban boards (issues by column), social feeds (tweets + comments), product catalogs (products by category).

Key Takeaways
  • ✓Normalization = entities by ID + relationships as ID arrays
  • ✓Provides O(1) access and single source of truth
  • ✓Dramatically simplifies updates and reduces bugs
  • ✓Excellent for Kanban, feeds, catalogs, and relational data
  • ✓Use memoized selectors for derived/nested views
  • ✓Skip for small or mostly read-only data
  • ✓Combine with React Query for server state
PreviousNext

Topic Guide

On this page