Notifications/Database layout

Tables in Echo

 * echo_event - notification trigger, for example, edit-user-talk event would trigger talk page notification and email, it has one to many relation with echo_notification
 * echo_notification - notification storage
 * echo_subscription - this table is currently not used since we don't support subscription, it's mainly for user who wants to get notification on a particular event of a particular page, for example, I want to get notification on John Dow's talk page notification
 * echo_email_batch - this table stores a list of event_id for a user, this is primarily used for daily/weekly email digest, and the email bundling function. The daily cron ( for digest ) and job popped from job queue will look at this table for events and send batch for bundle email notification
 * echo_email_bundle_status - this table stores the timestamp and possibly status of a bundle-able email. For example, We bundle page link notification by title, in the 1st hour, we send a single notification: 'San Francisco was linked by User A', in the 5th hour, we send bundle notification: 'San Francisco was linked by User B and 7 others', in 9th hour, no notification, reset cycle, send single notification again for the next notification, then start the 4 hour cycle again, this table is used to remember the state of a particle bundle notification