[英]Architecture of real-time web applications
This is going to be a rather theoretical question. 这将是一个相当理论上的问题。 I'm currently working on my bachelor thesis, which includes the creation of a web-based real-time object synchronization framework much like Firebase , but local (ie not cloud based).
我目前正在研究我的学士论文,其中包括创建一个基于Web的实时对象同步框架,就像Firebase一样,但是本地(即不是基于云的)。
I need to distinguish "regular" web applications (is there a better term?) from real-time, especially in terms of architecture. 我需要从实时中区分“常规”Web应用程序(有更好的术语吗?),尤其是在体系结构方面。 My thoughts so far:
到目前为止我的想法:
Sorry, it got longer than intended. 对不起,它比预期的要长。 To put it in a nutshell, I see three possibilities for the architecture of a web-based real-time application:
简而言之,我看到了基于Web的实时应用程序架构的三种可能性:
Not sure if it's of importance at all, but I use Rails (with a JMS -based messaging service that provides WebSocket -support) on the backend and AngularJS on the frontend. 不确定它是否具有重要性,但我在后端使用Rails (带有基于JMS的消息传递服务,提供WebSocket -support),在前端使用AngularJS 。
"Real-time" actions or applications or systems have timeliness and predictability constraints. “实时”操作或应用程序或系统具有及时性和可预测性限制。
In principle, that is independent of the system architecture--in practice, the architecture must be suitable for the real-time properties you need. 原则上,这与系统架构无关 - 实际上,架构必须适合您需要的实时属性。
A publish/subscribe mechanism has a real-time metric based on the latency from when a publishable event occurs until the event is manifest at all operational subscribers--simplified, real-time = real fast (think automated financial trading). 发布/订阅机制具有基于从可发布事件发生到事件在所有运营订户中显现的延迟的实时度量 - 简化,实时=真实快速(想想自动化金融交易)。 But real-time is as much about timeliness predictability.
但实时性与时效性可预测性同样重要。 In the P/S case, the predictability of interest is the latency--both in magnitude and in variability ("jitter" is a special case).
在P / S案例中,感兴趣的可预测性是延迟 - 在幅度和可变性方面(“抖动”是一种特殊情况)。 There is a lot of literature in both the research and practitioner communities--in your case I suggest reading some of the excellent documents on RTI's web site (although IMHO RTI doesn't deal with predictability as thoroughly as they could, but they make good products).
在研究和从业者社区中有很多文献 - 在你的情况下,我建议阅读RTI网站上的一些优秀文件(尽管IMHO RTI并没有尽可能彻底地处理可预测性,但它们做得很好产品)。
Non-P/S systems, including but not limited to client/server ones, have a different style of real-time. 非P / S系统(包括但不限于客户端/服务器系统)具有不同的实时风格。 There are multiple time-constrained (say) tasks contending for shared resources (such as a processor, synchronizers, networks, etc.).
有许多争用共享资源的时间约束(比方说)任务(例如处理器,同步器,网络等)。 The contending access requests must be resolved by being either dispatched or scheduled in an order that satisfies both a timeliness and a predictability optimality criterion.
必须通过以满足及时性和可预测性最优性标准的顺序调度或调度来解决竞争访问请求。 Everyone is familiar with the very simple special case that the requests have deadlines and the optimality criterion is to meet all the deadlines.
每个人都熟悉一个非常简单的特殊情况,即请求有截止日期,最优标准是满足所有截止日期。 Note that the "meet deadlines" timeliness criterion has been expressed together with the predictability criterion "always meet all."
请注意,“符合期限”及时性标准已与可预测性标准“始终满足所有”一起表达。
In the vast majority of real world real-time cases (not limited to computers), the criteria are much more complex--for example, it is common for a real-time system to require that the mean (or, alternatively, maximum) tardiness either be minimized or not exceed some value. 在绝大多数现实世界的实时案例(不仅限于计算机)中,标准要复杂得多 - 例如,实时系统通常要求均值(或者,最大值)延迟要么最小化要么不超过某个值。 Additional complexity is added by dependencies, such as precedence constraints.
依赖性添加了额外的复杂性,例如优先约束。 This style of real-time has major implications on certain properties of the architecture and its system software.
这种实时方式对架构及其系统软件的某些属性有重大影响。 All of the above has been greatly simplified for brevity.
为简洁起见,上述所有内容都已大大简化。
I can read your question in one of the following ways: 我可以通过以下方式之一阅读您的问题:
a) Which of Peer-to-Peer, Client-Server, or some other term describes the application best? a)哪个Peer-to-Peer,Client-Server或其他术语最好地描述了该应用程序?
b) Which architecture should the application use as the basis of its design? b)应用程序应使用哪种架构作为其设计的基础?
In my opinion your question describes the application's architecture quite well, and it's quite irrelevant whether you want to call it Peer-to-Peer or Client-Server or something else. 在我看来,你的问题很好地描述了应用程序的体系结构,无论你是想将它称为Peer-to-Peer还是Client-Server或其他东西,这都是无关紧要的。
That said, the real-time aspects of the design don't make it Peer-to-Peer for the very reasons you mention. 也就是说,设计的实时方面并没有因为你提到的原因而成为Peer-to-Peer。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.