PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 15, 2022

[FIXED] How to make a Facebook like Notifications Table Structure?

 February 15, 2022     database, facebook, mysql, php, yii     No comments   

Issue

I am making a social app like Facebook using Yii Framework and MySQL. It has a notifications button at the top similar to Facebook. When someone posts in a group or someone from your friend list is going to any event or if someone sends you an add request then how should I manage these notifications in database?

Like : I joined a group "A". Someone from "A" group will post in the group then a notification should be sent to each user of the group. How could I manage notification table in this case?

I am planning to have a table structure as given below:

user_id | Type_of_notification | notication_text | sender_id | Created_time |

Is my approach right?


Solution

You are effectively building an activity stream in MySQL. There is an excellent answer at How to implement the activity stream in a social network. I've used it myself in a smaller app, but the comments in there show that it easily scales up to quite a few million rows too.



Answered By - Haensel
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing