Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One method would be to use a single Redis channel for all users and use the username as a prefix for the messages. This way, subscribers can filter out only the messages meant for them using the prefix. This reduces the number of channels needed and the amount of memory used by Redis. Additionally, the subscribers can use a Redis list to store the messages meant for them, rather than keeping a live connection to the Redis server. This reduces the number of active connections and the memory needed by the subscriber. Another approach would be to use a different messaging system or protocol that is more lightweight and memory efficient, such as RabbitMQ or MQTT.