---
title: "Comment by Omar Ashour on \"Designing Data Intensive Applications: Ch3. Storage and Retrieval | Part 1\" | Hashnode"
description: "Thanks for sharing this great &amp; well crafted article! I've got a question, you mentioned that SSTables store only a few keys in memory. How is the decision"
url: "https://hashnode.com/posts/designing-data-intensive-applications-ch3-storage-and-retrieval-or-part-1/622c9c5ddf08b9b823417562/comment/66fc1b9dc825a74912324fd6"
---

[Discussion](https://hashnode.com/posts/designing-data-intensive-applications-ch3-storage-and-retrieval-or-part-1/622c9c5ddf08b9b823417562)

Comment [Designing Data Intensive Applications: Ch3. Storage and Retrieval | Part 1](https://hashnode.com/posts/designing-data-intensive-applications-ch3-storage-and-retrieval-or-part-1/622c9c5ddf08b9b823417562)

[Omar Ashour](https://hashnode.com/@OmarAshour)

[Oct 1, 2024](https://hashnode.com/posts/designing-data-intensive-applications-ch3-storage-and-retrieval-or-part-1/622c9c5ddf08b9b823417562/comment/66fc1b9dc825a74912324fd6)

Thanks for sharing this great & well crafted article!

I've got a question, you mentioned that SSTables store only a few keys in memory. How is the decision made about which keys to keep in memory vs on disk? Is there a specific strategy for optimizing this selection?

[Sayed Alesawy](https://hashnode.com/@sayedalesawy)

[Oct 2, 2024](https://hashnode.com/posts/designing-data-intensive-applications-ch3-storage-and-retrieval-or-part-1/622c9c5ddf08b9b823417562/comment/66fc1b9dc825a74912324fd6#reply-66fd06967b6db0c96c61c330)

Usually there is a setting called index\_granularity, which tells the index how many keys it should save. So for example if the index\_granularity is 5000, it will save 1 key every 5000 keys and so on. I don't there is anything to optimize here tbh but I am not 100% sure.
