Extension:EventLogging/Data model

The proposed data model for event logging leverages different data structures offered by Redis, such as (sorted) sets, lists and hashes.

Storing data
Logging event data into Redis requires: (document basic write operations)
 * 1) generating a uuid for each incoming event
 * 2) adding the uuid to a sorted set keyed to anon token with a UTC timestamp as score
 * 3) adding uuid to a sorted set keyed to event_id with a UTC timestamp as score
 * 4) generating a hash keyed to the uuid to hold all the key/vals parsed from the query string

Querying data
Basic examples (see the full documentation on redis commands):
 * get all hashes for a given event


 * get all hashes for a given even in a specified timeframe


 * count events by type


 * get timestamp for a hash as a score


 * get all values stored in a hash


 * get value for a given hash key

Questions

 * What queries will be easy to write/run?
 * What queries will be hard to write/run?
 * Capacity
 * Performance
 * Chance of collisions
 * Persistence
 * Recovery