We are developing the Web App that will have user subscription to a specific group of events. For example: User create a comment in the blob and all users subscribed to this blog should have this event in their list.
Currenly, we are searching for the data model to store this data.
Store all events in one table seems a good idea from the usability point of view:
- Object (in the example: comment reference)
- Subscribable object(in the example: blog reference)
- User that spawned the event
- Event type(like: update, create etc.)
The subscription events for particular user may be gathered by the sql query that will filter events by user subscription.
The problem in this data model is that subscribable objects may may have 'inheritance'. For example: The user might have a subscription to the blog or to particular posts in the blog. That means that Blog subscription extends post subscription and this data model doesn't reflect this behavior. I will have to spawn 2 events in this case: one for blog and one for post.
Is it a good idea to have all events around in one table or split them some how into different tables? Anyway event tables will have a huge amount of data. Is there a better idea to organize event logging?