# How to make sure a record with composite key goes to same partition?

**URL:** <https://discuss.aerospike.com/t/how-to-make-sure-a-record-with-composite-key-goes-to-same-partition/7233>\
**Category:** Feature Discussion\
**Created:** [March 17, 2020, 6:58am UTC](https://discuss.aerospike.com/t/how-to-make-sure-a-record-with-composite-key-goes-to-same-partition/7233 "2020-03-17T06:58:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manav\_Jain](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/manav_jain/32/1384_2.png) [@Manav\_Jain](https://discuss.aerospike.com/u/Manav_Jain)\
**Post date:** [March 17, 2020, 6:58am UTC](https://discuss.aerospike.com/t/how-to-make-sure-a-record-with-composite-key-goes-to-same-partition/7233/1 "2020-03-17T06:58:35Z")

</div>

Like previously when i was using cassandra , the partition key was uidx and composite key was (uidx, card\_type) … so it was easy to maintain ttl for each record .

And this made sure that all user records goes to a same node.

How can this be achieved in aeropsike ? Does secondary index makes sure that records goes to same node ?

---

<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:** [March 17, 2020, 3:33pm UTC](https://discuss.aerospike.com/t/how-to-make-sure-a-record-with-composite-key-goes-to-same-partition/7233/2 "2020-03-17T15:33:57Z")

</div>

Aerospike doesn’t provide an API to multiple keys share the same node. An active discussion on this topic can be found here: [Composit Key](https://discuss.aerospike.com/t/composit-key/5072).

Iirc, there is a similar discussion in feature requests.

---

<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:** [March 23, 2020, 3:34pm UTC](https://discuss.aerospike.com/t/how-to-make-sure-a-record-with-composite-key-goes-to-same-partition/7233/3 "2020-03-23T15:34:00Z")

</div>

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