I have a very simple web application. A student comes in and he creates a note in one of the subjects. Each subject has number of subscribers. Similar to stackoverflow tags, once a tag has been added to a question, the subscribers are notified.
Similary in my app, I want to add subscribers, so once a note is created for a particular subject, all the subscribers of that subject are mailed.
I have my db models as follows -
class Subject(models.Model):
//some vlaues here
class Note(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
author = models.ForeignKey(User)
subject = models.ForeignKey(Subject)
class SubscriptionModel(models.Model):
subject = models.ForeignKey(Subject)
subscriber = models.ForeignKey(User)
There are couple of ways of implementing it -
Once a note is created, a post_save signal can be fired to email all the subscribers of that subjecct.
Something with pub-sub can be done.
Something with rss feeds can be done.
I am not sure what is a scalable approach to implement it, any help or pointers would be appreciated, thanks.