# What is the significance of a bin

**URL:** <https://discuss.aerospike.com/t/what-is-the-significance-of-a-bin/6818>\
**Category:** Data Modeling\
**Created:** [November 13, 2019, 1:25am UTC](https://discuss.aerospike.com/t/what-is-the-significance-of-a-bin/6818 "2019-11-13T01:25:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnagineni](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/vnagineni/32/1366_2.png) [@vnagineni](https://discuss.aerospike.com/u/vnagineni)\
**Post date:** [November 13, 2019, 1:25am UTC](https://discuss.aerospike.com/t/what-is-the-significance-of-a-bin/6818/1 "2019-11-13T01:25:01Z")

</div>

while storing data what is the difference between storing all fields in one bin as a map vs storing each field in a different bin. What are the benefits/drawbacks of each approach?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [November 13, 2019, 6:11pm UTC](https://discuss.aerospike.com/t/what-is-the-significance-of-a-bin/6818/2 "2019-11-13T18:11:24Z")

</div>

As CDTs (maps and lists) development continues, the differences are becoming less obvious.

As of 3.7.0:

1. You can only create secondary indices on bins, not the value for which a map-key points to.
2. For `data-in-memory` or `storage-engine memory` configurations. A bin name is stored once in a table and the individual records use a 2 byte index to reference the bin within the table which saves space for bin names longer than 2 bytes. Map keys are stored as the client provided which occupies more memory.
3. You are limited on the [number of unique bin names and the length of a bin name](https://www.aerospike.com/docs/guide/limitations.html). Map keys do not have these limits.

I suspect some future release will add secondary indices on map keys. But the 2nd and 3rd distinctions are unlikely to change.
