数据库设计 - 跟踪用户访问个人资料的内容
我目前有一个将个人资料 ID 和用户 ID 配对的表,以跟踪谁访问个人资料。我意识到这可能会根据用户数量产生大量排列。有没有更有效的方法来做到这一点?
I currently have a table that pairs a profile id and user id to keep track of who visits a profile. I've realized that this could generate a big number of permutations depending on the number of users. Is there a more efficient way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将其保存在数据库中。如果您有许多活跃用户,您可能希望将此类记录保留在另一个数据库中。
您还可以将它们保留在文件中的缓存中,这会占用服务器 CPU 的一些负载。
哦,在我忘记之前,即使将它们保存在同一个数据库中,您也可以将 mysql 数据库放在像硬盘一样的分区中。
如果您想将它们保留在数据库中,请阅读这篇文章,这可能是您的解决方案 MySQL 分区
You could keep it in database. If you have many active users, you might want to keep such records in an another database.
You could also go with keeping them with cache in files which will take some load over CPU of your server.
Oh before I forget, keeping them even in the same database, you could put your mysql database in partitions like hard drives.
Please read this article if you want to keep them in database, this could be the solution for you MySQL Partitioning