Say I'm building something like Facebook and I have many different entities in my database: Photos, Videos, Notes, Maps, Users, Groups, Songs, etc.. If I wanted the users to be able to comment on any of those entities, how should I model this in the database?
Conceptually, a Comment entity would relate to exactly one of the other entities, and the other entities would be related to zero, one or many comments.
My inclination is to have the other entities be sub-types of a parent "ContentType" entity, relate Comment to that, and somehow enforce through constraints a mutually exclusive relationship between the content types. But that feels a bit odd since there's no real relationship between the content types.