roeygol
roeygol

Reputation: 5048

How to store a list of values in Redis?

I need to store a list of values using a key in Redis.

Until now we used zadd() with bulking of 1000 item per add, the problem is takes time and performance.

Is there any other option which can provide better performance ?

Upvotes: 1

Views: 2133

Answers (1)

Mario F
Mario F

Reputation: 47287

zadd is used for sorted sets, and has O(log(N)) performance on insertion. What kind of data structure do you want to have? If a simple list is enough, you can just use lpush, which has O(1) performance on insertion

Upvotes: 2

Related Questions