2014-05-10

What to do with Redis if data exceed memory size

Views: 18027 | Add Comments

Redis is great! It is super fast, easy to use, the data structures(kv, hash, zset) make it powerful to store business data.

But Redis has some problems, the most significant problem is memory size. Redis a single-instance storage, which means it is not distributed, so it could not store big data, and the data it stores must not exceed the memory size of a server for it holds all data in meory.

WHat can we do if data exceed memory size?

First, manually sharding. You will have to shard data into multi instances across machines, all by your own. Redis does not provide official solution yet.

Second, try some distributed storage system. But we still want to be able to work will data structures, not stupid pure key-value!

Third, use SSDB instead! SSDB is an alternative to Redis, it supports Redis network protocol and nearly all redis clients(redis-cli, hiredis, phpredis, etc). And the storage capacity of SSDB is usually 100 times of Redis’, for SSDB stores data in hard-disk, and holds hot data in memory.

SSDB is widely used by many internet companies, including QIHU 360, Baidu.com, TOPGAME, Autohome.com, BYD auto, and many other[see here].

Posted by ideawu at 2014-05-10 00:28:41 Tags:

Leave a Comment