0

I was reading an answer about postgres vs redis here:

Can Redis write out to a database like PostgreSQL?

It was mentioned that redis is mostly used as a cache layer rather than a Database. I'm confused, why go all the way with redis when one can use simple data structures within ones back end. For example in C#, I can use a ConcurrentDictionary to achieve an in memory datastore

user1034912
  • 2,153
  • 7
  • 38
  • 60
  • 3
    It's in memory, so your have two drawbacks. 1) It's only as persistent as the process, and 2) It's process-specific - if you have a load balanced front-end, your session/cache is purely per server – Flydog57 Mar 27 '21 at 01:57
  • Redis is not in memory? If thats the case why not just use redis as the entire database? – user1034912 Mar 27 '21 at 02:07
  • 1
    Redis is not is process memory – Flydog57 Mar 27 '21 at 02:13
  • So why use it as a caches store? If its in disk, why not use it as the entire database... – user1034912 Mar 27 '21 at 02:20
  • 1
    @user1034912 centralized in-memory store. What happens if you start storing millions of keys on your local machine? It might run out of memory ad you're consuming additional cpu for the same. – sonus21 Mar 27 '21 at 03:13
  • Thank you for the replies, please answer the question I will select as best answer. If it's not relevant, we can close this question. – user1034912 Mar 27 '21 at 05:58

0 Answers0