Hello everyone,
I am currently trying to devise a system for providing in-app and up-to-date notifications in the following manner:
I have a class of users, let's call them "X users". They are in one table of my DB.
X users will subscribe to what we will call "Y users", who are on a separate table.
Y users can subscribe to other Y users as well.
There will be a relational table to link subscribers to subscribees.
Now here's my problem: I want all subscribers to get a notification of all updates made by whoever they are subscribed to. Updates we can call "events". I want content specific updates (i.e. "User Y has posted a new event called blah blah on blah blah date at blah blah location").
I'm very new at web developing, and don't know how to store these content related updates. The whole system is beyond me.
Any suggestion would be greatly appreciated.
Thanks!
First, I would probably store X and Y users in the same table with a flag to indicate which class of users each record represents.
Next, depending on what you have in mind, it sounds like using a trigger to log the "notification" in a table would be appropriate. The details will depend a LOT on the type of database you are working with (Oracle vs MySQL vs SQL Server vs ...)
Reading a notification will depend on the application you are using.
Thanks for your quick response.
Perhaps I should have been a bit more specific. User X and User Y are completely different types of users, with completely different data. Being as such, I have to keep them on two separate tables. In fact, I have 4 unique types of users, and plan on adding more in the future. Users will be able to subscribe to all but one of them. As a result, I need a very scalable solution.
To answer you about what I'm using: This is driven by a MySQL database with PHP for scripting.
Some of the terms you used I'm not familiar with, as I am very new to programming with database functionality.
Any idea?
Thanks!
It seems like you're either trying to have a "search events" type activity, or an "alerts" activity. A trigger on a database can be used to track changes (inserts, updates, deletes) and perform additional activities. For example, if you delete a user, a trigger can create a log of the deletion in another table.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks