Question

I have a nodejs project that using couchbase as database. Just wonder if I store the temporary data in

1.redis

or in

2.couchbase directly.

As I know there is socket delay for couchbase, I think store temporary data in redis while store the permanent data in couchbase is better. Is there any person has the experience on this?

Your comment welcome

Was it helpful?

Solution

I'm a big Redis fan, but in this situation I would use Couchbase only.

Couchbase is rather efficient, and comparable to the performance of memcached when the working set of your data fits in memory. Most of the time, an extra caching layer on top of Couchbase is not useful.

That said, if you really need a caching layer, or simply some storage for temporary data, you can simply create a memcached bucket hosted in the Couchbase cluster. So you would have an "eventually persistent" bucket for your persistent data, and a memcached bucket for the temporary data.

The bucket types are described here:

http://docs.couchbase.com/couchbase-manual-2.5/cb-admin/#data-storage

In that context, adding Redis as a extra storage layer does not really make sense.

OTHER TIPS

Couchbase has a managed cache built into it, even for Couchbase buckets. So it already has a caching layer and adding another one on top just sounds superfluous.

I am not sure what you mean by a socket delay in Couchbase. Can you perhaps explain more about that? That is not something I have ever seen before and sticks out as suspect to me. I would try and troubleshoot this and figure out what that is before looking to add redis to the mix and have yet another layer to manage and code against. Without know more about the socket delay, it is difficult to make more recommendations.

It's an old question, but I'll have my take at it as well, if nothing else then for the people coming across it via google, just as I did.

I agree with he accepted answer, in that CouchBase has the most recently used Documents in RAM. In that aspect, it does the same as Redis. The advantage of CouchBase is of course that the data can reliably spill over the RAM limit, and the server disk limit, automatically, by adding more nodes.

However, I have a project where I am considering using Redis along side CouchBase. It's basically thought as a caching server, but for the "calculated" items. Such as html-snippets or other things. CouchBase is a fantastic document store, but making lists and other structures, doesn't come that easy, especially not without a lot of views. So I'm thinking to use Redis as a temporary datastore for the ad-hoc data manipulation needed, and CouchBase as the main datastore.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top