Some features to Pub/Sub

Skip to first unread message

Александр Лозовюк

Jul 5, 2010, 11:05:03 AM7/5/10
Hi all,

After some weeks using Redis Pub/Sub in production and testing
enviropments, i thought, how can further improve this thing to
facilitate use in real-time messages system.

In main usage pattern - publisher publish, subscribers read messages,
and if nobody subscript, message is lost.
But - why dont do this:
- if no subscibers, messages are stored to list with timestamp (when
its added to queue)
- if subscriber connect with params TIMESTAMP, at first all messages
stored after this time, will be reposted to subscriber.
- if connect with TIMESTAMP = 0, only new, real time messages will be
posted to him.

This is memory-based persistent queue. Queue length is fixed for
channel and shared to all subscribers and may be expired.

Is there good idea? (I know, all this features i can emulate yourself
with list+pub/sub, but.... )

C уважением, Александр Лозовюк
Alpha-Beta-Release Blog

Pieter Noordhuis

Jul 5, 2010, 11:32:58 AM7/5/10
The point of Redis pub/sub is that is it lightweight. Not everybody
needs these features and because they *can* be implemented using
exising Redis primitives (the timestamp pattern you propose
beautifully fits the sorted set datastructure), they will never be
natively supported. However, if you plan to wrap this functionality
inside a client, please do share on the mailinglist.


2010/7/5 Александр Лозовюк <>:

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Reply all
Reply to author
0 new messages