反应性和弹性有什么区别?

What is the difference between Reactive and Resilient?

我正在寻找 Reactive 和 Resilient 之间的区别。

我浏览了几篇文章,但那些让我有点清楚,但对外交解释很困惑。

我理解的Resilient的意思是,如果请求数增加时,同一个服务的实例数增加。同样,如果请求较少,它也会减少。因此,即使实例数量增加或减少,它达到稳定状态的容易程度和速度也称为弹性。

我对Reactive不是很清楚。

根据 the reactive manifesto,您混淆了这两个不同的概念。反应式系统有 4 个属性:

  • 响应

  • 有弹性

  • 弹性

  • 消息驱动

因此,反应系统是有弹性的,没有"difference"。

宣言将弹性定义为:

Resilient: The system stays responsive in the face of failure. This applies not only to highly-available, mission critical systems — any system that is not resilient will be unresponsive after a failure. Resilience is achieved by replication, containment, isolation and delegation. Failures are contained within each component, isolating components from each other and thereby ensuring that parts of the system can fail and recover without compromising the system as a whole. Recovery of each component is delegated to another (external) component and high-availability is ensured by replication where necessary. The client of a component is not burdened with handling its failures.

但是,如果缺少其他 3 个属性,弹性系统可能不会 "reactive"。例如:一个系统可能对故障有弹性,但对增加的需求没有弹性,因此不是反应性的。

弹性是反应系统的一个特征,如 Reactive Manifesto 中所定义。换句话说,reactive 是一个比 resilient.

更广泛的术语

您对弹性的理解听起来更类似于反应式系统的另一个属性:弹性。宣言对elasticity and scalability的定义,以及两者的关系如下:

Elasticity (in contrast to Scalability)

Elasticity means that the throughput of a system scales up or down automatically to meet varying demand as resource is proportionally added or removed. The system needs to be scalable (see Scalability) to allow it to benefit from the dynamic addition, or removal, of resources at runtime. Elasticity therefore builds upon scalability and expands on it by adding the notion of automatic resource management.


Scalability

The ability of a system to make use of more computing resources in order to increase its performance is measured by the ratio of throughput gain to resource increase. A perfectly scalable system is characterized by both numbers being proportional: a twofold allocation of resources will double the throughput. Scalability is typically limited by the introduction of bottlenecks or synchronization points within the system, leading to constrained scalability, see Amdahl’s Law and Gunther’s Universal Scalability Model.