How do I store the equivalent of Redis?


#1

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.


#2

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


#3

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

I want to know the equivalent in the LList LDT.


#4

llist.scan is the call corresponding to HMGETALL

– R


#5

I did not explain my original question correctly :wink:

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


#6

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


#7

Thanks for your help.


#8

FYI, LList has been upgraded, and its documentation and examples have been improved.