What does Discourse use Redis for?

Discourse uses Sidekiq which is an open source job scheduler written in Ruby. Sidekiq generally (and by default) only executes jobs and does not do the scheduling, or at least that is what the references say (maybe things have changed?); however my understanding is that the enterprise version of Sidekiq comes with scheduling OOTB.

Sidekiq uses Redis as an in-memory data structure store and is also written in Ruby. Sidekiq reads jobs from a Redis queue, using the First In First Out (FIFO) model, to process jobs. Job processing is asynchronous and allows a web thread to serve live requests, rather than process heavy tasks which can be “scheduled” to run in the background.

Sidekiq is described as “well-known queue processing software” and is used by Discourse on jobs which are designed to run as background tasks and not run directly in web application requests.

You can explore the many types of jobs that Discourse executes, based on the above brief overview in the Discourse repo:

Redis may be used by Discourse in other parts of the architecture; but off the top of my head, the main use for Redis is as the “companion” for Sidekiq, the “jobs guy”. Discourse team members smarter than me on the Discourse HLA can surely elaborate with more details on how Redis is used within the Discourse HLA.

Hope this helps.