How do I design a database to store properties, selecting attributes by synonyms

I would take a different approach to your attribution scheme. Rather than treating different attributions as synonyms, I would treat them as overlapping, or more specifically, nested descriptions of a property. This would handle your business case while at the same time acknowledging the astute observation made by Mike Sherrill. Here is a quick ERD … Read more

Why use multiple columns as primary keys (composite primary key)

Your understanding is correct. You would do this in many cases. One example is in a relationship like OrderHeader and OrderDetail. The PK in OrderHeader might be OrderNumber. The PK in OrderDetail might be OrderNumber AND LineNumber. If it was either of those two, it would not be unique, but the combination of the two … Read more

How should I implement this schema in MongoDB?

OK, I think you need to break this out into the basic “varieties”. You have two “entity”-style objects: User Campaign You have one “mapping”-style object: UserCampaign You have one “transactional”-style object: Click Step 1: entity Let’s start with the easy ones: User & Campaign. These are truly two separate objects, neither one really depends on … Read more