I'm developing a social networking website that will be rolled out in various countries. However, I've hit a bit of a roadblock in terms of the best way to store challenge information.
Each site wil开发者_JAVA百科l have a unique ID. I then want to be able to add challenges for each of the different sites, but control them on a per-site basis. The reason being, the sites will be in different languages, but we need to also control the cost on each site. For example, a challenge may be worth 100 points on one site, but 200 on another.
Going over the above, it seems this would be similar to how badges work on Stack Overflow's network of sites, as these challenges will be completed when set criteria is met (e.g. uploading a profile image).
What would be the best way to store this information in a database? My initial thoughts would be a global challenge ID and then a look-up table that contains the fields (name
, description
, points
, currency
etc) that is joined on challenge ID and site ID. Is there a better way that I'm missing?
Push the SiteId
to the look-up table
Join only on challengeID for Global challenge info
精彩评论