简体   繁体   English

如何在分布式环境中更新数据

[英]how to update data in distributed environment

We have a website showing videos to our users running on multiple web servers in a distributed environment. 我们有一个网站,向在分布式环境中的多个Web服务器上运行的用户显示视频。 We are going to introduce a new feature where we only show videos to our users that they have not seen before whenever they come online. 我们将引入一项新功能,该功能将仅向用户显示他们每次上网之前从未看过的视频。 This could lead to a scenario where a user first hits server1 and sees video1 and the second time come to server2 and should be shown anything but video1. 这可能导致用户首先点击server1并看到video1,第二次访问server2并显示除video1之外的任何内容。 This requires maintaing this state in the backend and updating it in real-time. 这需要在后端维护此状态并实时更新。 We have enough traffic to rule out mysql for updating this information in real-time. 我们有足够的流量排除mysql来实时更新此信息。 After doing enough research, it seems like cassandra/hbase will be a good option for this kind of a problem with their good write throughput. 经过足够的研究之后,似乎cassandra / hbase会因为其良好的写入吞吐量而成为此类问题的一个不错的选择。 Is there any other approach that can be taken or any other way to solve this problem? 是否可以采用其他方法或其他方法来解决此问题?

Why not stash a list of recently viewed videos in a cookie on the user's browser? 为什么不将最近浏览过的视频列表存储在用户浏览器的Cookie中?

If you really need to store it in a backend system, HBase would be suitable; 如果您确实需要将其存储在后端系统中,那么HBase将是合适的; one row per user, with a column qualifier for each video they've seen. 每个用户一行,并为他们观看的每个视频添加一个列限定符。 You can do a simple exists check to see if they've seen any video. 您可以进行简单的存在检查,以查看他们是否看过任何视频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM