doue9730 2018-07-15 18:32 采纳率: 100%
浏览 106

存储标签值以显示内容

I have 150+ tags (more in future), 18000+ of different content to display and 380+ users (more in future).

What will be the best way to display content to users according to the Tag value for the user?

I thought of storing all tag activities in the database like:

 ________________________________
| Sr. | User_Id | Tag_Id | Int.  |
|________________________________|
| 1   | 152     | 18     | 15    |
| 2   | 152     | 24     | 8     |
| 3   | 18      | 127    | 4     |
|________________________________|

In database Int. means how many times the user is interested in the posts having Tag_Id.

As the user clicks <kbd>Interested?</kbd> the Int. column will be +1 for that user and that tag.

If I store the values in the database, the database will have huge content and huge traffic and will need large storage too. (108K values only for now then imagine the stage of values after 2 years.)

Any other best alternatives?

I am using PHP & MySQL.

  • 写回答

1条回答 默认 最新

  • donglin1192 2018-07-15 18:40
    关注

    For the best RM model solution, you will have to give some more information about the complete model. But as I see it now, this is the best solution. You can remove the id and set the primary key to user_id and tag_id (both).

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分