开发者

Best database structure for challenges across multiple sites

开发者 https://www.devze.com 2023-01-27 06:02 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号