0

I am making a social media app. I have a use case in which i have to cluster similar type of data. For example, take Instagram. When a user likes a post, we get a notification that 'x likes your post'. Same in the case of follow. If 3 more users liked that post and 2 more followed the user, after some time, notification becomes 'x and 3 others like your post' and 'y and 2 others followed you'. This is something i have to achieve. Post, Like and Follow data is stored in PostgresSQL. I am also using MongoDB and Redis and more dbs can be added.

How should i cluster my notification data in this case? what should be the flow to cluster the notifications so that there shouldn't be any extra load over server or DB. Should it create a new notification in the db saying 'x and 3 others like your post' or should it just send it as a response on the front end?

  • You can run an automated task on the application server every 5 minutes which checks for which posts the notification requires an update. But this looks to obvious to me for being your real question, so please clarify what you mean by "how". Side note: AFAIK "to bucket" is not an english verb, I guess you mean "to cluster"? – Doc Brown Feb 11 at 6:41
  • @DocBrown by how, i simply mean what you explained in your comment, that what should be the flow to cluster the notifications so that there shouldn't be any extra load over server or DB. Should it create a new notification in the db saying 'x and 3 others like your post' or should it just send it as a response on the front end? – Gabriel Feb 11 at 7:42
  • 1
    You should edit this explanation into your question. – Doc Brown Feb 11 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.