开发者

Can i use RedisDB for big databases?

Can I use RedisDB for b开发者_开发百科ig databases instead of SQL-based DB?

I really like RedisDB architecture, and i now what RedisDB support virtual memory.

But I don't now how fast is it.

PS When I say big database, I don't mean REALLY big. Just DB of some site, that can't be placed in memory.


It all depends on your application. Redis is a Key-Value store. If your data stored in a relational format and does not lend itself well to key retrieval then it is not really the solution for you. Also, Redis has the best performance when it is stored in memory. If transactions are important for you, it is not really a good solution too. I use Redis and love it, but it seems many people are trying to shoehorn in applications that Redis is not suited for. If you are storing things like webpages, comments, tweets etc I would also consider a document store like MongoDB. You would have to add more details about your implementation.


Redis virtual memory performance depends how you use it - if your frequently used values all fit in memory, with occasional disk reads for less popular content, there won't be that much difference from having the full dataset in memory. If your access requirements are completely random and a value only gets read once after being loaded from disk it won't perform any better than reading files from disk. Of course any caching solution will have problems in that scenario.

There are a couple of things to consider when designing for redis vm though:

  • All keys need to fit in memory, even if their values don't. This works well if your value is a large serialized object, but not so well if your value is a single number or short string and may actually be smaller than the key.

  • The save process works a little differently when VM is used. I don't recall the details, but you may need to consider what is guaranteed to be written to disk when.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜