Currently, I am writing a small internal platform for social networks for the company I work with, nothing big, ok. 40,000 users. This is basically something like Facebook or Google+, but with less features.
This platform has an email notification system (in addition to Ajax notifications for online users).
Now here is my problem - itβs just not scaling.
I have a mySQL table that stores all email notifications. Therefore, as soon as someone writes a story in a group, the system automatically inserts a row into this table, and the email_send (cronjob) function sends these letters to users (users can choose between instant, daily or weekly notifications)
So far so good - if the groups have few members.
But now create a group with 5k + members. As soon as the user submits the history to this group, it calls 5000 instances of SQL in the notification table.
How would you solve this? I thought that there is a desktop on the server that scans new stories / comments / material and runs the email_send function in the background. Would this scale be better? Or is there only a standard way to do this, and am I just thinking in the wrong direction?
Any point in the right direction will be greatly appreciated, thanks and hilarious xmas :)
//Marcus.
source share