随笔分类
The Reactive Menifesto
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
在不同领域深耕的组织都不约而同地发现了相似的软件构建模式. 期望这些系统更加健壮、更具回弹性、更灵活,也能更加满足现代化需求。
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.
近年来,应用程序需求发生了戏剧性的更改,模式变化也随之而来. 仅在几年前,一个大型的应用程序通常有着数十台服务器,秒级响应时间,数小时的维护时间以及 GB级别的数据。如今,应用程序部署在形态各异的电子设备上,从移动设备到运行着数以千计的核心处理器的云端集群上。用户期望着毫秒级别的响应时间以及服务 100%的正常运行,而数据以 PB来计量。昨日的软件架构已经无法满足今日的需求.
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.
我们相信,一个贯通整个系统架构设计方案是所需的,而设计中需要关注的各个方面已经被理清。我们所期望的系统是即时响应式的、回弹性的、弹性的以及消息驱动的,我们称其为响应式系统
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.
响应式系统通常更加灵活、松耦合以及可伸缩,这使得它们更加容易去扩展以及调整。它们对系统的失败更加容忍,当失败确实发生时,它们也能够得体地去处理而非混乱无序。响应式系统是高响应的,给予用户高效的互动反馈.
Reactive Systems are:
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:**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:**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: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation and location transparency. This boundary also provides the means to delegate failures 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.
*消息驱动:**响应式系统依赖异步的消息传递,从而确保了松耦合、隔离、位置透明的组件间存在明确边界。这个边界可以将失败作为消息委托出去。使用显式的消息传递,可以通过在系统中塑造并监控消息队列,在必要时去使用背压,以来实现负载管理、弹性以及流量控制。使用位置透明的消息传递作为沟通的手段,这也使得跨集群或者在单个主机中使用相同的结构以及语义去管理失败成为了可能。非阻塞的通信使得接受者只在活动时去消费资源,这也减少了系统开销.*
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.
大型系统由多个较小型系统组成,因此整体的效用取决于它们组成部分的反应式属性。这意味着,响应式系统适用于设计准则,使得这些属性能够在所有级别的规模上适用,并且可组合。世界上最大型的系统所依赖的架构都基于这些属性,并且每天服务于数十亿人的需求。因此,是时候在系统设计初始时有意识地去使用这些设计准则,而不是每次都去重新发现它们.