The Principles of Reactive Programming course at coursera.org
I want to talk about the modern programming discipline that meets the growing requirements for scalability, fault tolerance and fast response, and irreplaceable in multi-core environments, and in cloud computing, as well as present you an open online course on it that will start in just a few days .
If you haven't heard anything about reactive programming, everything is fine. (Although in this case you missed several habraposts: Haskell , Rx for Javascript , Bacon.js , Meteor JS .) This is a rapidly developing discipline, in which concurrency is combined with event-oriented and asynchronous. Reactivity is inherent in any web service and distributed system, and serves as the core in many high-performance systems with a high degree of parallelism. In short, the authors of the course suggest considering reactive programming as a natural extension of functional programming (with higher-order functions) to parallel systems with a distributed state, coordinated and orchestrated by asynchronous data flows exchanged between active subjects, or actors .
In more understandable words, this is described in the Reactive manifest , its full translation published in Habré . As Wikipedia says , the term reactive programming has been around for a long time and has practical applications, but it received a new impetus to development and distribution quite recently, thanks to the efforts of the authors of the Reactive Manifesto - the initiative group from Typesafe Inc. Typesafe is known in the functional programming environment as a company founded by the authors of the beautiful Scala language and the revolutionary parallel platform Akka . Now they are positioning their company as the creator of the world's first jet platform, designed to develop a new generation. Their platform allows you to quickly develop complex user interfaces and provides a new level of abstraction over parallel computing and multithreading, reducing their inherent risks due to guaranteed predictable scaling. It implements in practice the ideas of the Reactive Manifest and allows the developer to conceptualize and create applications that meet modern needs.
')
You can get acquainted with this platform and reactive programming by taking part in the massive open online course coursera.org website “Principles of reactive programming” . This course is a continuation of Martin Oderski’s Principles of Functional Programming on the Rock, which gained more than 100,000 participants and demonstrated one of the highest success rates in the world for a massive open online course by its participants. Together with the creator of the Scala language, a new course is being read by Eric Meyer, who developed the Rx environment for reactive programming under .NET, and Roland Kun, Akka's leading development team at Typesafe at the moment. The course reveals the key elements of reactive programming and shows how they are used to construct event-oriented systems with scalability and fault tolerance. The training material is illustrated by short programs and is accompanied by a set of tasks, each of which is a software project, in case of successful completion of the tasks, participants receive certificates. The course lasts 7 weeks and begins this Monday, November 4th. A detailed course plan is available on its page on coursera.org (and also at the very end of my note): www.coursera.org/course/reactive .
For those who do not want to follow the links, I offer a concise presentation of the basic concepts of the Reactive Manifest. It should answer the question what is reactive programming . The authors of the manifesto note dramatic changes in the requirements for applications in recent years. Today, applications are deployed in any environment, from mobile devices to cloud clusters with thousands of multicore processors. These environments have new software and technology requirements. In previous-generation architectures, emphasis was placed on managed servers and containers, and scaling was achieved through additional expensive equipment, proprietary solutions, and parallel computing through multithreading. Now a new architecture is developing, in which one can distinguish four major features that are increasingly prevailing in both user and corporate industrial environments. Systems with this architecture: event-oriented (Event-driven), scalable (Scalable), fault-tolerant (Resilient) and have a fast response, i.e. Responsive (Responsive). This provides a comfortable user experience, giving a real-time feel and is supported by a self-healing, scalable application stack ready for deployment in multi-core and cloud environments. Each of the four characteristics of the reactive architecture applies to the entire technology stack, which distinguishes them from links in multi-level architectures. Consider them in more detail.
Event-oriented applications assume asynchronous communication components and implement their loosely coupled design: the sender and recipient of the message do not need information either about each other or about the way the message is transmitted, which allows them to concentrate on the content of communications. In addition to the fact that loosely coupled components significantly improve the maintainability, extensibility and evolution of the system, the asynchronous and non-blocking nature of their interaction also allows freeing up a significant portion of resources, reducing the hailing time and providing greater throughput compared to traditional applications. It is thanks to the event-oriented nature that the remaining features of the reactive architecture are possible.
Scalability in the context of reactive programming is the response of the system to changes in load, i.e. elasticity achieved by the ability to add or release compute nodes as needed. Due to low connectivity, asynchronous messaging, and independence from component placement (location transparency), the deployment method and application topology become the solution for deployment time and the subject of configuration and adaptive algorithms that respond to the load. Thus, the computer network becomes part of an application that initially has an explicit distributed nature.
The fault tolerance of the reactive architecture also becomes part of the design, and this significantly distinguishes it from traditional approaches to ensuring continuous system availability by backing up servers and taking control over a failure. The stability of such a system is achieved by its ability to correctly respond to failures of individual components, isolate these failures, keeping their context in the form of the messages that caused them, and transmit these messages to another component that can make decisions about how to handle the error. This approach allows you to keep the business logic of the application clean by separating from it the error handling logic, which is formulated in an explicit declarative form for registering, isolating, and handling failures with the means of the system itself. To build such self-restoring systems, components are ordered hierarchically, and the problem is escalated to the level that is able to solve it.
Finally, responsiveness is the ability of the system to respond to user exposure, regardless of load and failures, such applications involve the user in interaction, create a feeling of close connection with the system and sufficient equipment to perform current tasks. Responsiveness is relevant not only in real-time systems, but also necessary for a wide range of applications. Moreover, a system that is unable to respond quickly even at the time of failure cannot be considered fault tolerant. Responsiveness is achieved by using observable models, event streams, and stateful clients. Observed models generate events when their state changes and provide real-time interaction between users and systems, and event flows provide an abstraction on which this interaction is built through non-blocking asynchronous transformations and communications.
Thus, reactive applications are a balanced approach to solving a wide range of tasks in modern software development. Built on an event-driven foundation, they provide the tools necessary to guarantee scalability and fault tolerance and support full-featured responsive user interaction. The authors expect that an increasing number of systems will adhere to the principles of the reactive manifest.
In the appendage cite the course plan without translation. Just in case you read this far, and you're still interested.
Week 1 : Review of Principles of Functional Programming: substitution model for monographs. For-expressions: random value generators. This tool can be used as a tool for implements this idea.
Week 2 : Functional programming and mutable state. What makes an object mutable? How this impacts the substitution model. Extended example: Digital circuit simulation
Week 3 : Futures. Introduces futures as another monad, with for-expressions as concrete syntax. Shows how to avoid thread blocking. Discusses cross-thread error handling.
Week 4 : Reactive stream processing. Generalizing futures to reactive computations over streams. Stream operators.
Week 5 : Actors. Introduces the Actor Model, actors, asynchronous message passing through the sequence, discusses the message semantics (at most once, at least once, exactly) and eventual consistency.
Week 6 : Supervision. Introduces the pattern of life, pattern, lifecycle monitoring, discusses transient and persistent state.
Week 7 : Conversation Patterns. There is a clear concept of a meeting.