领域修炼之路

活性系统宣言(The Reactive Manifesto)

说在前面

   信息工业革命正处在一个爆发期,每天都有新的热点,新的需求,新的技术。社会的节奏在加快,个人的节奏在加快,是疲于被动的响应,还是
找准问题的本质,谋定而动? 活性系统宣言(按自己的理解翻译)可以让我们思考一下何为现代系统,如何在系统设计之初就考虑活性系统
应该具有的特性,从而避免系统的溃败。

   限于水平,附上英文,供对比,不当之处请斧正。活性系统宣言(The Reactive Manifesto)官网

正文

   处在不同领域的组织机构不约而同的发现他们用来构建各自领域软件系统的模式看起来是一致的。这些系统必须 更健壮更具弹性更加灵活
更明确的定位 来满足现代系统的需求。


   Organisations working in disparate domains are independently discovering patterns for building software that look the same. These systems are more robust, more resilient, more flexible and better positioned to meet modern demands.


   之所以出现这些变化,是因为近些年来应用系统需求发生了巨大的变化。仅仅是在几年前,一个大型系统还只需要十几台服务器,秒级的响应时间,
数小时的线下维护时间和GB级别的数据量。而今天,应用已经部署在从单一移动设备到运行在数以千计的多核处理器之上的基于云计算的集群。
用户希望看到的是毫秒级响应,100%的线上正常运营。而数据也是以PB计量。今天的应用需求根本就不是昨天的软件架构所能满足的。


   These changes are happening because application requirements have changed dramatically in recent years. Only a few years ago a large application had tens of servers, seconds of response time, hours of offline maintenance and gigabytes of data. Today applications are deployed on everything from mobile devices to cloud-based clusters running thousands of multi-core processors. Users expect millisecond response times and 100% uptime. Data is measured in Petabytes. Today’s demands are simply not met by yesterday’s software architectures.


   我们认为采取相干策略来进行系统架构是必要的,我们也认为架构现代系统所考虑的必要因素都已被各自确认,即:我们希望现代系统是
响应的弹性的扩展的 并且是 消息驱动 的,我们称之为 活性 系统。


    We believe that a coherent approach to systems architecture is needed, and we believe that all necessary aspects are already recognised individually: we want systems that are Responsive, Resilient, Elastic and Message Driven. We call these Reactive Systems.


    以活性系统为基准构建的应用系统更灵活,松散耦合并且可扩展(scalable),这也使得系统易于
开发,易于改变。同样,以活性系统为基准的应用系统对失败有更强的包容,当失败(failure)
真的发生时,系统去优雅的面对而不是带来灾难。活性系统是高度响应的,能为用户
带来有效的交互式反馈。


    Systems built as Reactive Systems are more flexible, loosely-coupled and scalable. This makes them easier to develop and amenable to change. They are significantly more tolerant of failure and when failure does occur they meet it with elegance rather than disaster. Reactive Systems are highly responsive, giving users effective interactive feedback.


活性系统 是:

  • 响应的(Responsive)
    系统尽可能的及时响应。响应是可用性和实用性的基石,不止如此,响应也意味着
    问题能够被快速检测并有效处理。活性系统专注于提供快速、一致的响应时间,并通过建立可靠的上限来提供一致的服务体验。这种一致
    的行为反过来简化了错误处理,增强了最终用户的信心,激发了更进一步的互动。

    Responsive: The system responds in a timely manner if at all possible. Responsiveness is the cornerstone of usability and utility, but more than that, responsiveness means that problems may be detected quickly and dealt with effectively. Responsive systems focus on providing rapid and consistent response times, establishing reliable upper bounds so they deliver a consistent quality of service. This consistent behaviour in turn simplifies error handling, builds end user confidence, and encourages further interaction.

  • 弹性的(Resilient)
    系统在面对故障时仍保持响应。这不仅适用于高度可用的关键任务系统,任何非弹性系统面对故障时将会变得响应迟钝。弹性是通过
    冗余(replication)
    遏制(containment)隔离(isolation)委托(delegation) 实现的。故障被遏制在各个组件内部,
    各个组件相互隔离,因此确保只有部分系统故障和恢复而不会损坏整个系统。每个组件的恢复委托给另一个(外部)组件处理,高可用性通过
    在必要的地方做冗余复制来实现。组件的客户端不必为组件的故障背负处理的职责。

    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.

  • 伸缩的(Elastic)
    系统面对不同的载荷都能保持响应。活性系统能够根据输入频率的变化而相应的增加或减少资源的分配来应对,这也意味着系统的设计要具备
    分片或组件冗余并分散输入的能力来避免资源竞争和中央瓶颈。活性系统通过实时的性能测量来支撑预测,保持活性和伸缩规则。活性系统以
    一种高性价比的方式在硬件及软件平台上实现弹性

    Elastic: The system stays responsive under varying workload. Reactive Systems can react to changes in the input rate by increasing or decreasing the resources allocated to service these inputs. This implies designs that have no contention points or central bottlenecks, resulting in the ability to shard or replicate components and distribute inputs among them. Reactive Systems support predictive, as well as Reactive, scaling algorithms by providing relevant live performance measures. They achieve elasticity in a cost-effective way on commodity hardware and software platforms.

  • 消息驱动(Message Driven)
    活性系统依赖于异步消息传递来实现组件边界从而确保松耦合,隔离,位置透明并以消息的形式委托组件处理错误。显式的消息传递使得通过
    塑造和监控系统内的消息队列并在必要的时候回压(back-pressure)负载来
    实现负载管理,弹性和流程控制。以位置透明的方式进行消息传递使得故障管理在一个集群或单一主机上的处理结构和语义得以保持一致。
    非阻塞通信使得接收方仅在激活状态时消耗资源,从而降低系统开销。

    Message Driven: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation, location transparency, and provides the means to delegate errors as messages. Employing explicit message-passing enables load management, elasticity, and flow control by shaping and monitoring the message queues in the system and applying back-pressure when necessary. Location transparent messaging as a means of communication makes it possible for the management of failure to work with the same constructs and semantics across a cluster or within a single host. Non-blocking communication allows recipients to only consume resources while active, leading to less system overhead.

Reactive Traits


    大型系统由众多小的子系统组成,因此它依赖于各个子系统的活性属性(Reactive properties)。这意味着,活性系统应用的设计原则,使这些属性
适用于所有级别的规模,使得它们可组合。世界上最大的系统依赖于基于这些活性属性进行架构,从而能够为数十亿人的日常需求提供服务。
是时候在从头开始设计系统时就有意识的应用这些设计原则,而不是每次都需要重新发现。


    Large systems are composed of smaller ones and therefore depend on the Reactive properties of their constituents. This means that Reactive Systems apply design principles so these properties apply at all levels of scale, making them composable. The largest systems in the world rely upon architectures based on these properties and serve the needs of billions of people daily. It is time to apply these design principles consciously from the start instead of rediscovering them each time.

chrisrc wechat
更多信息请订阅我的微信订阅号