32
votes

I am using redis for pub/sub as well as for server side cache. I mean my app server has redis server running as one process (functioning as a cache as well) . I have several thin clients (running redis client) connected to this app server in pub/sub mode. I would like to know where redis stores the cache data ? in server alone or there will be a copy in the clients as well. Also is it a good idea to use Redis in this fashion if there are close to 100 redis clients connected to server through pub/sub channel.

Thanks

8

8 Answers

21
votes

Redis is a (sort of) in-memory noSQL database; but I found that my copy (running on linux) dumps to /var/lib/redis/dump.rdb

9
votes

Redis can manage really big numbers of connections, by default its in-memory store (thanks to storing stuff in RAM it can be so fast).

But in the same time it can be configured as a persistent store, so dumping cached data (every x time or every x updated keys) to disk.

So it can be configured depending on your needs, have a look here.

5
votes

All the cache data will be stored in the memory of the server provided to the config of running redis server. The clients do not hold any data, they only access the data stored by the redis server.

4
votes

I just installed redis on mac via homebrew. Without any configuration, I found the dump.rdb is in my working directory (where I launched redis-server).

3
votes

You can figure that out with the config command.

redis-cli config get dir

However as far as I know pub/sub data is volatile and not stored nor cached in redis at all. If you need that, you should look for a dedicated message broker like for example RabbitMQ.

1
votes

Default location

/var/lib/redis/

0
votes

Redis save all data in memory of server and rarely save date to disk. For server<>client flow - all data transport with server. Redis can processing number of clients ... default limit - 10.000 If you need less .. you must reconfigure OS, Server Settings etc. - http://redis.io/topics/clients

0
votes

On my Ubuntu, it was at /var/lib/redis/dump.rdb. On my macOS (installed via brew), it was at /usr/local/var/db/redis/dump.rdb.