php - News Feed Database Design Efficiency -
greetings all, i've seen similar questions asked before no conclusive or tested answers.
i'm designing news feed system using php/mysql similar facebooks. seeing table grow quite large -- inefficiency result in significant bottleneck.
example notifications: (items in bold linked objects)
user_a , user_b commented on user_c's new album.
user_a added new vehicle [his/her] garage.
initially, implemented using excessive columns obj1:type1 | obj2:type2 | etc..
it works fear it's not scalable enough, i'm looking object serialization.
so, example new database set so:
news_id | user_id | news_desc | timestamp 2643 904 {user904} , {user890} commented on sometimestamp {user222}'s new {album724}.
anything inside {'s represents data serialized using json.
is smart (efficient / scalable) way move forward?
will difficult separate serialized data rest of string using regular expressions?
what happens if user890 deletes his/her comment? think need more atomic - possibly storing type of action (comment) actioner (user890), generate actual story on fly, heavy caching. issue of translation, if extend site several markets/audiences.
Comments
Post a Comment