For a personal project, I want to record a stream of unrelated events, to gather simple statistics on later. Each event can have [wildly] different data associated with it.
I'm looking for some advice on how to structure this. As this is a small project, my main goals are:
- Ease of setup
- Ease of use (i.e. no strange joins)
Performance isn't critical, and I will be the only user.
To give you an idea of what I'm aiming for, here is my current plan:
Table: Event_Definitions
Columns:
- ID
- Name
- Type
- Options
Table: Events
Columns:
- ID
- Definition_ID
- Option_Values
- Notes
So say we have two event definitions, like this:
ID: 0; Name: Pigeon_Released; Type: Time; Options: null
ID: 1; Name: Fed_Pigeon; Type: Fixed_List; Options: bread,crackers,tofu
Then we log some events:
ID: 0; Definition_ID: 1; Option_Values: bread; Notes: null
ID: 1; Definition_ID: 1; Option_Values: tofu; Notes: "he cooed"
ID: 2; Definition_ID: 0; Option_Values: 12:34:56; Notes: "I cooed too"
The option values will be enforced through the program.
After a number of events have been collected, I will be collecting together events of the same type for comparison. I don't expect to be retrieving events with specific values, just events of the same type.
So the question is, again, any advice or comments on this strategy or alternatives? I appreciate how simple and straightforward this approach is, but it bothers me that even though the 'values' for an even could be strings, times, index numbers, etc. etc., they all get stored in the same column.