如何设计可扩展的类似 Twitter 的服务?

发布于 2024-09-03 00:30:28 字数 498 浏览 6 评论 0原文

有人有关于 Twitter 架构的信息吗?

我特别感兴趣的一些具体项目:

  • 我知道他们使用消息队列。但他们到底用队列做什么?

  • 他们会“重复”推文吗?如果是这样,怎么办?例如,假设某个用户有 10,000 名关注者,他发布了一条推文“hello world”。 Twitter 是否仅存储“hello world”一次,而这 10,000 个关注者中的每一个都需要从同一个数据库表中读取该推文,还是每个关注者都有自己的“我正在关注的推文”数据,并且“hello world”会重复 10,000 个次,每个关注者一次?

  • 与上面的观点有些相关:他们如何按推文发送者、推文关注者、推文 ID、推文日期时间或其他方式分片数据?

  • 你知道他们使用什么技术吗?我读到了有关 MySQL、RoR、Starling、Scala、memcached 的内容。不过那是不久前的事了,信息也不是很详细。有更新的信息或更多详细信息吗?

Does anyone have any information on the architecture of twitter?

A few specific items I'm especially interested in:

  • I know that they use message queues. But what exactly do they use queues for?

  • Do they "duplicate" tweets? If so, how? For example, say a user has 10,000 followers and he makes a tweet "hello world". Does twitter store "hello world" only once and each of those 10,000 followers would need to read that tweet from the same database table, or does each follower have his own "tweets I'm following" data and "hello world" is duplicated 10,000 times, once for each follower?

  • Somewhat related to the point above: how do they shard their data, by tweet sender, by tweet follower, by tweet ID, by tweet datetime, or something else?

  • Do you know what technologies they use? I read about MySQL, RoR, Starling, Scala, memcached. But that was a while ago and the information wasn't very detailed . Any updated info or more details?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

中性美 2024-09-10 00:30:28

您可以查看 identi.ca 中的代码,这是一项类似于 Twitter 的服务,基于开源工具和开放标准构建。希望这有帮助。

You can check out the code in identi.ca which is a service similar to Twitter, built on open source tools and open standards. Hope this helps.

日记撕了你也走了 2024-09-10 00:30:28

不确定这是否有帮助。 Twitter 在 Twitter 开源 页面开源了该服务中使用的大量代码,这可能会给你一两个关于正在做什么的提示。

此外,Twitter 还有一个工程博客,其中发布了有关 Twitter 使用的技术的帖子

Not sure if this will help. Twitter has open-sourced a lot of code that is being used on the service at Twitter Open Source page, which might give you a hint or two on what is being done.

Also, Twitter has an Engineering Blog where they have a posts on Technologies being used in Twitter

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文