将用户活动存储在Django中 [英] Storing user activity in Django

查看:117
本文介绍了将用户活动存储在Django中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找存储用户的活动,但是我不知道在哪里存储它。我不认为数据库是一个选择,因为它将是非常大的。我想知道如何像Facebook这样的网站,dropbox记住特定用户的所有活动。它不能存储在会话中,因为这不是会话具体而不是用户特定的。

I am looking to store the activity of an user, but I am not sure where to store it. I dont think database is a option as it will be very big than. I am looking to know as to how sites like facebook, dropbox remember all the activity of an particular user. And it can't be stored in sessions as this is not session specific rather user specific.

请帮助我您的建议。

推荐答案

您可能需要查看 django活动流,这是活动流规范的实施。这将存储数据库中的操作列表,并允许以下用户/实体给出类似于Facebook的内容,如果这是您感兴趣的。

You might want to look at django-activity-stream which is an implementation of the activity streams spec. This stores a list of actions in the database and allows the following of users/entities to give something similar to Facebook if this is what you are interested in.

但是,如您提到,这可能会导致大量数据,这对于传统的单一数据库方法可能会有所帮助。我不知道像Twitter这样的网站如何处理它,但除非你打算很快地扩展标准数据库方法可能会持续一段时间。

However, as you mention, this can end up with enormous sets of data which might be a bit much for a conventional single database approach. I'm not sure how sites like Twitter deal with it but unless you plan to scale up very quickly the standard database approach would probably last you a while.

这篇关于将用户活动存储在Django中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆