João Paulo Lins Fullstack Developer
Normalizing Redux
● Bachelor of Computer Engineering @ UFPE

● 2.5 years working with Web Development

● Loves Front End technologies
João Paulo Lins
Fullstack Developer
/joaopslins
joao.lins@vinta.com.br
We're a team of experts from Brazil. 

We help our clients evolve their products the right way 

with top notch development and UX techniques.
Get to know us: vintasoftware.com
Redux
Redux
Redux Flow
Redux Flow
State - Nested data
State - Nested data
● Duplicated data is harder to update.
Nested data
● Duplicated data is harder to update.
● Nested data implies in nested reducer logic.
Nested data
● Duplicated data is harder to update.
● Nested data implies in nested reducer logic.

● Updates to nested data can generate unnecessary re-renders.
Nested data
“The more your frontend state looks like a
database, the easier it is to work with it.” -
Dan Abramov
● Normalized data - No repetitions.
Database characteristics
● Normalized data - No repetitions.
● Data is divided in Tables.
Database characteristics
● Normalized data - No repetitions.
● Data is divided in Tables.

● Relationships are indicated by Foreign Keys.
Database characteristics
State - Flat data
Normalizr
● Normalizr is a small, but powerful utility for taking JSON with a
schema definition and returning nested entities with their IDs,
gathered in dictionaries.
● https://github.com/paularmstrong/normalizr
Normalizr
Normalizr - Normalization
Normalizr - Denormalization
Normalizr API
Normalizr API
● Normalizr API consists of:
○ schema - definition of Entities
○ normalize() / denormalize() - transformations
Normalizr API
NormalizrNormalizr API - Relationships
Normalizr API - Relationships
Normalizr API - Relationships
Normalizr API - Denormalize
Normalizr API - Denormalize
Normalizr with Redux
Normalizr + Redux - Data Shape
Normalizr + Redux - Data Shape Example
Normalizr + Redux - Good Practices
● Normalize data before storing into Redux
Normalizr + Redux - Good Practices
● Normalize data before storing into Redux
● Pass entities IDs to connected children components
Normalizr + Redux - Good Practices
● Normalize data before storing into Redux
● Pass entities IDs to connected children components
● If denormalizing, be careful with the amount of data
Normalizr + Redux - General Tips
● [Library] ImmutableJS
● [Pattern] Selectors
Normalizr + Redux - General Tips
● ImmutableJS - Easy and clean API for immutable data
Normalizr + Redux - General Tips
● Selectors
○ Only access state properties through Selectors
Code Example
João Paulo Lins
Fullstack Developer
/joaopslins
joao.lins@vinta.com.br
Thank you!
Got any questions?
Access this talk on github.com/vintasoftware/normalizr-redux-talk

Normalizing redux