I am building a basic social network for fun and would like to divide the site’s content based on a user’s email address. All functionality would be the same across the entire site, only the content would differ.
For example if a user signs up with a @berkeley.edu email address they can only friend, and comment, and view etc. other @berkeley.edu users. And users with @uoregon.edu email addresses can only friend, comment, and view, etc. other @uoregon.edu users.
What would be a good technique to accomplish this?
You could multi-tenant the system keyed off of the email domain – then all queries would operate off of the that tenant key.
For example…
Tenant Table
User Table
Whenever you run a query, you include:
To only show users, content, messages, images etc from Berkeley.