Redis

Design Goals

 * Fast
 * Non-persistent
 * Automatic garbage collection ASAP using Redis built-in TTL
 * Memory-efficient

Storage Details
This section discusses a mapping between the necessary data and how it is handled at the Redis level.

Queue List
A queue list is nothing more than a list of queues. This creates a mapping from tenants to queues they've created.

Great candidate for representing these are Redis sets. The O(1) deletion is very important.

Queue Item
A queue item contains the following:


 * Queue metadata
 * Queue configuration (coming later)
 * Queue stats
 * A list of message (key) ids for this queue

Plain keys work fine here.

Message List
This creates a mapping from queues to messages.

Great candidate for representing these are Redis sets. The O(1) deletion is very important.

Message Item
A message item contains the following:


 * href
 * body
 * claim ID (status == 'active' if claim ID is not set)

The TTL and age are set in such a way that Redis handles them.

Plain keys work fine here. Need to take advantage of expires.

Claim
A claim is a collection of messages to be processed. They carry:

A Redis set works well here.