Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andretw/c33819936154196c5326 to your computer and use it in GitHub Desktop.
Save andretw/c33819936154196c5326 to your computer and use it in GitHub Desktop.

The Reactive Manifesto 反應式宣言

Published on September 16 2014. (v2.0) 發佈於 2014 年 9 月 16 日 (v2.0)

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.

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, 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.

反應系統依賴於非同步訊息傳遞來建立部件之間的邊界,可確保寬鬆的耦合、獨立、位置透明性,並提供了一種方式將錯誤作為訊息傳送出去。通過塑造和監控訊息隊列系統來達到使用顯式訊息傳遞,進而實現負載管理、彈性和流程控制,必要時需預防背壓情況產生。將位置透明的訊息作為一種溝通方式,使得可以使用相同的結構或語意來對叢集或一台主機上的錯誤進行管理。非阻塞通信允許收件人只消耗活躍時的資源,從而減少系統開銷。

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment