News for hackers. Stuff that matters.
Re:Redis Turns 10 – How it started with a single post on Hac... by judge2020 on Wednesday February 27, 2019 @12:26AM (#19261094)
In a simplified manner: "I have this resource or a big piece of information I don't want to pull from my slow database or slow external service on each request/call/etc.

I'm going to see if that resource is there by doing `GET external.foo.bar`. if there is nothing here, I perform the slow pull. After the slow pull is done, we store the result in redis under the same name `external.foo.bar` with a timeout for x seconds.

Next time that resource is requested from our code, it will be there, so `GET external.foo.bar` will get us that resource without having to perform a slow call to external service. "

Re:Redis Turns 10 – How it started with a single post on Hac... by deadcoder0904 on Wednesday February 27, 2019 @03:11AM (#19261754)
Thank you that was a great example. So from what I understand, Redis shouldn't be used unless there's a scaling issue?

Also, where does Redis sit (my guess is between request & database)?

Re:Redis Turns 10 – How it started with a single post on Hac... by icebraining on Wednesday February 27, 2019 @03:53AM (#19261956)
Well, the previous comment was describing the use of Redis as a cache, and in that use case, yeah, it's kind of between the application and the database.

That said, caching is just one of the possible uses for Redis. I think of it as an easy way to share arrays, dictionaries, queues, etc between different applications. Then it's easy to see how it can be used for almost anything.

Re:Redis Turns 10 – How it started with a single post on Hac... by aries185 on Wednesday February 27, 2019 @12:24PM (#19264921)
When used as a cache, Redis is often used as a 'look aside cache' (vs 'look thru cache'). Generally speaking, Redis does not talk directly to your database. Instead, your code looks to Redis, and then if it doesn't find what it's looking for, your code looks to your SQL database