# Memory to Disk Ratio with "data-in-memory false"

**URL:** <https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821>\
**Category:** Operations\
**Created:** [October 24, 2022, 6:47pm UTC](https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821 "2022-10-24T18:47:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff.MacDonald](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@Jeff.MacDonald](https://discuss.aerospike.com/u/Jeff.MacDonald)\
**Post date:** [October 24, 2022, 6:47pm UTC](https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821/1 "2022-10-24T18:47:57Z")

</div>

Hi, I have a namespace where the storage-engine = device, and inside that stanza data-in-memory is false.

In such a configuration as I understand it, memory will only store the primary index? Or does it also store secondary indices in memory?

I am assuming that I only need to ensure that there is enough memory for the number of objects I have, using this formula: 64 bytes × (replication factor) × (number of records) ? Or is there any thing more complex I need to calculate in this scenario? Tks

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [October 24, 2022, 10:44pm UTC](https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821/2 "2022-10-24T22:44:37Z")

</div>

Only primary index is stored in memory with data on device, not your data, but yes secondary index still goes in memory too. You got it, `64b*n_objects*RF` [Capacity Planning Guide | Aerospike Documentation](https://docs.aerospike.com/server/operations/plan/capacity#memory-required-for-primary-index) . There’s a separate more complex formula for secondary index [Secondary Index Capacity Planning | Aerospike Documentation](https://docs.aerospike.com/server/operations/plan/capacity/secondary_indexes)

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [October 28, 2022, 3:42am UTC](https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821/3 "2022-10-28T03:42:30Z")

</div>

Secondary Indexes starting with ver 6.0 have significantly reduced their memory footprint and are much simpler to estimate sizing for all data types.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [October 28, 2023, 3:43am UTC](https://discuss.aerospike.com/t/memory-to-disk-ratio-with-data-in-memory-false/9821/4 "2023-10-28T03:43:29Z")

</div>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
