将收到的实时推送数据推送给 10,000 个用户?
我正在寻求有关我正在开发的一个需要低延迟和高并发的新项目的指导。该项目涉及从第三方源接收实时数据,并经过一些基本处理和存储后,将这些值发送给网站上当前活跃的所有用户。
数据通过 HTTP 推送到达,我当前的计划是使用 Node.js 接收该数据,然后通过算法运行数据,然后更新某种数据库中的相关数据。最后,更新通过 websocket 发送给网站的所有连接用户。
现在,我试图让这种可扩展性能够同时处理超过 10,000 个连接的用户,所有用户都通过 websocket 连接并大约每 3 秒发送一次更新。鉴于每个用户都可以在此期间与 Web 应用程序进行交互,这将导致许多来回请求。
现在,除了我拥有的高级基本想法之外,决定使用 Ruby on Rails 作为网站框架并使用 Node js 来处理这一切的“活跃性” - 我有点陷入困境。我不知道要使用哪种数据库(我想它将是一个用于快速存储的非关系数据库),并且我不知道如何构建这样的设置的具体细节,以及如何实现逻辑。
所以我的问题是:鉴于我的目标,我如何构建这样一个应用程序以及我需要知道什么才能使其可扩展并实时达到我想要的水平?
非常感谢寻求任何帮助。
I'm after some guidance on a new project I'm working on that requires low latency and high concurrency. The project involves receiving live data from a third party feed and after some basic processing and storage, sending these values to all users currently active on the website.
The data arrives via HTTP Push and my current plan is to use Node.js to receive this data, which then runs the data through an algorithm before updating related data in a database of some kind. Finally, updates are sent to all connected users of the website via a websocket.
Now, I'm trying to have this scalable to handle over 10,000 connected users at once, all connected via websocket and sent updates approximately once every 3 seconds. Given that each user can then interact with the web app during this, it's to result in many requests back and forth.
Now, apart from the high level basic idea I have, with the decision to have Ruby on Rails as the website framework and node js to handle the 'liveness' of it all - I'm a little stuck. I don't know what kind of database to use (I imagine it'll be a non relational database for quick storage) and I don't know the specifics of how to architect such a set up, along with how to implement the logic.
So my question is: Given my goal, how do I go about structuring such an application and what do I need to know in order to have it scalable and real-time to the level I desire?
Thanks greatly for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会推荐一些图书馆来看看。
现在
远程 RPC 变得微不足道。cradle
用于持久存储的 couchdb 数据库抽象。cluster
将您的程序扩展到多个进程。I would recommend a few libraries to look at.
now
remote RPC made trivial.cradle
couchdb database abstraction for persistant storage.cluster
extend your program across multiple processes.