Paz Lazar
Paz Lazar

Reputation: 239

redis json best practice

i used to store json in memcache and the read the and iterate them. what is the best practice to do it with redis? store json's? use SETS?

Upvotes: 0

Views: 545

Answers (1)

Not_a_Golfer
Not_a_Golfer

Reputation: 49177

Depending on your use case, the way to do it in redis differs.

If you want big complex objects with no atomic access to members - then the memcache pattern can be implemented in redis with GET/SET/DEL/etc

Redis' power comes into play is when you want to model some parts of your data using redis' data strcutures. For example, you can store a user's into as a HASH object in redis, and access just some parts of the data, like access time or password, without loading the entire object to your application server.

So basically the best practice depends on what you'd like to do with redis and what data you are storing.

Upvotes: 1

Related Questions