7 ms·
RAM is finite whether you're using it with Redis or Memcached. Redis provides multiple databases (0-16) for just this situation. Use one db for caching, anothe
by pselbert 11y ago
RAM is finite whether you're using it with Redis or Memcached.
Redis provides multiple databases (0-16) for just this situation. Use one db for caching, another for Sidekiq, and another for ad-hoc tasks. Redis can also be configured to evict entries with an expiration first, which means cached data will be cycled through while the important bits linger safely.
- itamarhaber 11y agoNot a good idea, I'm afraid. Your ad-hoc will cause the caching to stutter and the job queues to stagger. Redis is a single-threaded server and shared databases, well, share the same process. The common practice is to use dedicated Redis servers, one for each database. This also has the nice side benefit of allowing you config each as needed (e.g. LRU eviction for cache, persistency for jobs, etc...)