Redis is an open sourced in-memory data structure used as database, cache and message broker. This makes it crazy fast when it comes to loading data that hasn’t been changed for a long time.
For example, you go to 100xDev website,

This data isn’t changed over a long period of time, hence calling it everytime from postgres everytime doesn’t make sense.

You might be thinking how does redis store the data in-memory, well here is the answer.
save 900 1 # Save the dataset every 900 seconds if at least 1 key changed
save 300 10 # Save the dataset every 300 seconds if at least 10 keys changed
save 60 10000 # Save the dataset every 60 seconds if at least 10000 keys changed
LPUSH problems 1
LPUSH problems 2
RPOP problems
RPOP problems
BRPOP problems 0 -> infinitely blocked
BRPOP problems 30 -> second key
The last argument represents the timeout before the blocking should be stopped.
There are various clients that exist that let you talk to redis via Node.js https://www.npmjs.com/package/redis Let’s initialize a simple Node.js express server that takes a problem submission (very similar to leetcode) as input and sends it to the queue.