# How do I store the equivalent of Redis?

**URL:** <https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990>\
**Category:** PHP Client Library\
**Created:** [February 26, 2015, 9:13am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990 "2015-02-26T09:13:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pushpesh4u](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pushpesh4u/32/154_2.png) [@pushpesh4u](https://discuss.aerospike.com/u/pushpesh4u)\
**Post date:** [February 26, 2015, 9:13am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/1 "2015-02-26T09:13:23Z")

</div>

This is what is stored in a test redis set.

```
HGETALL __hash__

```

It returns around 7000 key=\>value pairs. (key is pincode, value is 1/0)

To set the same data in aerospike, I am using the LList LDT, but the key is only taking the first value, rejecting the others.

Is LList is a good choice for this.

---

<div class="post-metadata">

**Author:** ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://discuss.aerospike.com/u/raj)\
**Post date:** [February 26, 2015, 10:53am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/2 "2015-02-26T10:53:57Z")

</div>

I am not able to under what you mean by rejecting… following works for me

```
aql> execute llist.add ('listbin', 'JSON{"key":560075, "R":0}') on test.demo where PK='1'
+-----+
| add |
+-----+
| 0 |
+-----+
1 row in set (0.001 secs)

aql> execute llist.add('listbin', 'JSON{"key":600001, "R":1}') on test.demo where PK='1'
+-----+
| add |
+-----+
| 0 |
+-----+
1 row in set (0.001 secs)

aql> execute llist.scan('listbin') on test.demo where PK='1' 
+------------------------------------------------+
| scan |
+------------------------------------------------+
| [{"R":0, "key":560075}, {"R":1, "key":600001}] |
+------------------------------------------------+
1 row in set (0.000 secs)

```

Yes !! Llist is b+tree and is actually LSortedMap

HTH – R

---

<div class="post-metadata">

**Author:** ![pushpesh4u](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pushpesh4u/32/154_2.png) [@pushpesh4u](https://discuss.aerospike.com/u/pushpesh4u)\
**Post date:** [February 26, 2015, 11:15am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/3 "2015-02-26T11:15:13Z")

</div>

I am not taking about upating the aerospike record.That works well.

I want to know the equivalent in the LList LDT.

---

<div class="post-metadata">

**Author:** ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://discuss.aerospike.com/u/raj)\
**Post date:** [February 26, 2015, 11:21am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/4 "2015-02-26T11:21:26Z")

</div>

llist.scan is the call corresponding to HMGETALL

– R

---

<div class="post-metadata">

**Author:** ![pushpesh4u](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pushpesh4u/32/154_2.png) [@pushpesh4u](https://discuss.aerospike.com/u/pushpesh4u)\
**Post date:** [February 26, 2015, 11:36am UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/5 "2015-02-26T11:36:06Z")

</div>

I did not explain my original question correctly 😉

What I meant was this:

I do

```
HSET(HASH, KEY, VALUE)

```

If I change KEY and VALUE keeping HASH the same, then doing

```
HGETALL HASH

```

gives me an array of all key-value pairs that were entered earlier.

There are **many** such hashes.

What LDT should I choose to implement the same in aerospike.

Thanks

---

<div class="post-metadata">

**Author:** ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://discuss.aerospike.com/u/raj)\
**Post date:** [February 26, 2015, 2:22pm UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/6 "2015-02-26T14:22:56Z")

</div>

Well that is what the original example explained …

Keep changing the **key** but keep the same LLIST bin ( **llistbin** ) and primary key ( **‘1’** ) same … and scan would get you all the records in the llistbin. You can many such records identified by primary key. In your example primary key is “hash” …

Llist is one you should use …

– R

---

<div class="post-metadata">

**Author:** ![pushpesh4u](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pushpesh4u/32/154_2.png) [@pushpesh4u](https://discuss.aerospike.com/u/pushpesh4u)\
**Post date:** [February 26, 2015, 4:20pm UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/7 "2015-02-26T16:20:31Z")

</div>

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [October 22, 2015, 11:31pm UTC](https://discuss.aerospike.com/t/how-do-i-store-the-equivalent-of-redis/990/8 "2015-10-22T23:31:13Z")

</div>

FYI, LList has been upgraded, and its [documentation](https://github.com/aerospike/aerospike-client-php/blob/master/src/LDT/LList.php) and [examples](https://github.com/aerospike/aerospike-client-php/tree/master/examples/ldt) have been improved.
