Trello 如何如此快速地显示历史? [英] How does Trello show history so quickly?

查看:34
本文介绍了Trello 如何如此快速地显示历史?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Trello 显示了自董事会成立以来任何用户所做的一切的历史记录.同样,如果你点击一张特定的卡片,它会显示任何人所做的与该卡片相关的任何事情的历史.

Trello shows a historial log of everything that any user has done since the board's inception. Likewise, if you click on a specific card it shows the history of anything anyone has done related to that card.

跟踪无限期保留的每个更改/添加/删除必须收集大量数据,并且还可能在写入历史跟踪日志时遇到瓶颈(假设它被立即写入各种数据存储).我的意思是,他们并不是将所有内容都存储在分布在 1000 台服务器上的日志文件中,只有在需要查找某些内容时才收集和解析这些文件——他们一直在显示所有这些信息.

Keeping track of every change/addition/deletion that is kept indefinitely must collect a ton of data and also potentially bottleneck on writing to the history trail log (assuming it is written immediately to a data store of sorts). I mean, it isn't like they are storing everything in log files spread across 1000's of servers that they only collect and parse when they need to find something -- they are displaying all of this info all the time.

我知道这不是唯一提供此类服务的服务,但是您将如何构建这样的系统?

I know this isn't the only service that provides something like this, but how would you go about architecting such a system?

推荐答案

我在 Trello 团队.我们在我们的 MongoDB 实例中使用了一个 Actions 集合,在它所引用的模型的 id 上有一个复合索引(卡片是一个模型,一个成员也是一个模型)和执行操作的日期.没有花哨的缓存或任何东西,除非索引和最近使用的文档由数据库保存在内存中.Actions 是迄今为止我们最大的收藏.

I'm on the Trello team. We use an Actions collection in our MongoDB instance, with a compound index on the ids of the models to which it refers (a Card is a model, and so is a Member) and the date when the action was performed. No fancy caching or anything, except inasmuch as the index and recently used documents are kept in memory by the DB. Actions is by far our biggest collection.

值得一提的是,显示动作所需的大部分数据都非规范化地存储在动作文档中,从而大大加快了速度.

It is worth mentioning that most of the data needed to display an action is stored denormalized in the action document, so that speeds things up considerably.

这篇关于Trello 如何如此快速地显示历史?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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