Normalizing State Shape
Learn why flattening nested, relational data into normalized entities improves update performance and avoids duplication.
Normalization is the practice of structuring state like a relational database — storing entities (users, posts, comments) in flat lookup tables keyed by ID, rather than deeply nested objects with duplicated copies of the same entity embedded in multiple places. A typical normalized shape looks like { users: { byId: {...}, allIds: [...] } }.
Normalized state is like a library's card catalog system: each book (entity) has exactly one physical copy on a shelf, and every reading list (relationship) just references the book's catalog number — update the book's description once in the catalog, and every list pointing to it reflects the change instantly, instead of each list keeping its own photocopy that needs updating separately.