LStack insert


#1

Im trying to implement a fanout news feed function. Hence, Lstack seems to be the appropriate choice in the docs.

Is there a way to batch push a value into each individual user key? Like KEYUSER1->LSTACK push value0 KEYUSER2->LSTACK push value0

Instead of doing it one at a time is there a faster way?


#2

Do you expect the data size to grow beyond 1MB ? If that is the case, LDT types are the appropriate datastructure for it. (BTW, pure in-memory namespaces do not have the 1M limit for record)

If you know that the record size is <1MB, then you can use normal list/map datatypes and do a scan UDF (over a set if needed), and modify the record of a bunch of keys in one go. This functionality is not available for LDTs yet.


#3

Hi, but i would need the first-in-last-out function of an lstack


#4

You have to write some logic around the list datatype in the UDF. You can use the prepend & drop function of list and easily achieve what you want. http://www.aerospike.com/docs/udf/api/list.html

BTW, we have a planned project where we are porting some of the redis libraries. We have stack functionality in it. If you can wait, may be it will be simpler to use it.


#5

Thank you for that suggestion. I will look into it. As for the stack functionality, what is the approximate eta? I am willing to wait if its < a month

Thanks