|This page is obsolete. It is kept for historical interest only. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date.|
The proposed data model for event logging leverages different data structures offered by Redis, such as (sorted) sets, lists and hashes.
Logging event data into Redis requires:
- generating a uuid for each incoming event
- adding the uuid to a sorted set keyed to anon token with a UTC timestamp as score
- adding uuid to a sorted set keyed to event_id with a UTC timestamp as score
- generating a hash keyed to the uuid to hold all the key/vals parsed from the query string
(document basic write operations)
Basic examples (see the full documentation on redis commands):
- get all hashes for a given event
zrange et:ext.articleFeedback@10-pitch-edit-bypass 0 -1
- get all hashes for a given even in a specified timeframe
zrangebyscore et:ext.articleFeedback@10-pitch-edit-show 20120917170000 20120917180000
- count events by type
- get timestamp for a hash as a score
zscore et:ext.articleFeedback@10-pitch-edit-show eb62f8a2-68fc-4984-885f-c90a1f68ccb9
- get all values stored in a hash
- get value for a given hash key
hget eb62f8a2-68fc-4984-885f-c90a1f68ccb9 wiki
- What queries will be easy to write/run?
- What queries will be hard to write/run?
- Chance of collisions
- Analytics/Kraken/Pixel_Service future back-end plans from Analytics