How to track online users with Redis
The number of people using a website right now is a common metric. It shows how active the site is at a given moment, and it makes traffic visible while it happens instead of after the fact. Analytics services can report it, but with a delay and outside the application. Redis can keep it inside your own code: each page view records the visitor, and the count is read for the last X minutes, where X is a value from the configuration file that can be changed at any time.