Understanding Normalized vs. Non-Normalized Cache
In a blogging application, caching plays a crucial role in performance and efficiency. Let’s explore the concepts of normalized and non-normalized cache using blog posts and their authors as an example. Apollo Client’s caching docs explain how its normalized cache works in practice.
Data from Server
Consider this sample data structure fetched from the server, featuring two posts by the same author, “Alice”:
{
"posts": [
{
"id": "1",
"title": "My First Post",
"author": {
"id": "a1",
"name": "Alice"
}
},
{
"id": "2",
"title": "Another Day, Another Post",
"author": {
"id": "a1",
"name": "Alice"
}
}
]
}
Non-Normalized Cache
In a non-normalized cache, data is stored as received, without any alteration. Here’s... premium content.
