• 0 Posts
  • 1 Comment
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle
  • I’d add to this to say that redis as a key-value store often sits alongside a relational database like postgres etc. to act as a cache for it.

    Basically, requests to be sent to the relational db (like postgres) get turned into a key and the results stored as a value in redis. Then when the same request comes through again, it can pull the results quickly out of the key-value store without having to search postgres by running a long SQL query again. There’s a few different caching strategies to keep things up to date or have the cached data expire regularly, etc. but that’s the gist of it.

    Important to note that not all applications need something like that and not all queries would even benefit from it (postgres is pretty fast and can even do that kind of thing itself) but if there’s a lot of users running the same slow query over and over, caching the results can help immensely.