Skip to content

Periodically save last activity date data from Redis to the database

Description

Currently, we monitor the last activity date of users and store the data in Redis. However, Redis is ephemeral and should be treated as another /tmp, as its data can be flushed anytime.

We need last_activity_date in order to provide user cohorts. In order for this data to be accurate, we need to make sure we don't lose it by accident.

Proposal

As suggested here:

  • We have a background job that moves the data from Redis to the DB (daily, for instance). This means the data won't be super accurate, but not sure we need that anyway.

Links / references