Course "Principles of reactive programming" on

Reactive Programming PrinciplesI want to talk about the modern discipline of programming that meets the growing requirements of scalability, fault tolerance and fast response, and is indispensable both in multi-core environments and in cloud computing, and also introduce you to an open online course on it, which will begin in just a few days .

If you have not heard anything about reactive programming, everything is in order. (Although in this case you missed a few hubposts: 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 propose to consider 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 streams exchanged between active actors or actors .

More understandable words, it is described in the Jet manifesto , its complete translation was published Habré . howWikipedia explains the term reactive programming there for quite some time and has practical application, but a new impetus to the development and spread, he received only recently, thanks to the efforts of the authors of the manifesto Jet - an initiative group of 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 reactive 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 thanks to guaranteed predictable scaling. It puts into practice the ideas of the Jet Manifest and allows the developer to conceptualize and create applications that meet modern needs.

You can familiarize yourself with this platform and reactive programming by participating in the mass open course of the website “Principles of reactive programming”. This course is a continuation of Martin Odersky's “Principles of Functional Programming on the Rock” course, which attracted over 100,000 participants and demonstrated one of the highest levels of successful completion of a massive open online course by its participants in the world. Together with the creator of the Skala language, Eric Meyer, who developed the Rx environment, teaches a new coursefor reactive programming under .NET, and Roland Kuhn, the current Akka development team at Typesafe. The course reveals the key elements of reactive programming and shows how they are used to design event-oriented systems with scalability and fault tolerance. The training material is illustrated with 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 4. A detailed outline of the course is available on its page on the website (and also at the very end of my note): .

For those who do not want to follow the links, I offer a concise presentation of the basic concepts of the Jet Manifest. It should answer the question of what reactive programming is.. The manifest authors note dramatic changes in application requirements in recent years. Today, applications are deployed in any environment from mobile devices to cloud clusters with thousands of multicore processors. These environments present new requirements for software and technology. In previous-generation architectures, the emphasis was on managed servers and containers, and scaling was achieved due to additional expensive equipment, proprietary solutions, and parallel computing through multithreading. A new architecture is now being developed, in which four most important features can be distinguished, which are increasingly prevailing in both user and corporate industrial environments. Systems with this architecture: Event-driven (Event-driven), scalable (Scalable), Resilient and fast response, i.e. Responsive This provides a comfortable user experience that gives 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 reactive architecture applies to the entire technological stack, which distinguishes them from the links in multi-level architectures. Let's consider them a little more in detail. Each of the four characteristics of reactive architecture applies to the entire technological stack, which distinguishes them from the links in multi-level architectures. Let's consider them a little more in detail. Each of the four characteristics of reactive architecture applies to the entire technological stack, which distinguishes them from the links in multi-level architectures. Let's consider them a little more in detail.

Reactive Architecture Features

Event-oriented applications assume asynchronous communication of components and implement their loosely coupled design: the sender and receiver of the message do not need information about each other or about the way the message is transmitted, which allows them to concentrate on the content of the communication. In addition to the fact that loosely coupled components significantly improve the maintainability, extensibility and evolution of the system, the asynchrony and non-blocking nature of their interaction can also free up a significant part of the resources, reduce the response time and provide greater bandwidth compared to traditional applications. It is thanks to the event-oriented nature that the remaining features of reactive architecture are possible.

Scalabilityin the context of reactive programming, this is a system response to a change in load, i.e. the elasticity achieved by the ability to add or free compute nodes as needed. Due to its low connectivity, asynchronous messaging, and independence of component location (location transparency), the deployment method and topology of the application become the solution to deployment time and the subject of configuration and adaptive algorithms that respond to the load. Thus, a computer network becomes part of an application that initially has an explicit distributed nature.

fault tolerancereactive 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 intercepting control in the event of 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 decide how to handle the error. This approach allows you to keep the business logic of the application clean, separating the failure processing logic from it, which is formulated in an explicit declarative form for registering, isolating, and processing failures using the system itself. To build such self-healing systems, components are ordered hierarchically,

Finally, responsiveness- this is the ability of the system to respond to user impact regardless of load and failures, such applications engage 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 a 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,

Thus, reactive applications represent a balanced approach to solving a wide range of tasks of modern software development. Built on an event-driven basis, they provide the tools needed to guarantee scalability and resiliency and support full-featured responsive user experience. Authors expect an increasing number of systems to adhere to the principles of a reactive manifest.

In the appendage, I quote the course plan without translation. Just in case you read to this place, and you are still interested.

Week 1: Review of Principles of Functional Programming: substitution model, for-expressions and how they relate to monads. Introduces a new implementation of for-expressions: random value generators. Shows how this can be used in randomized testing and gives an overview of ScalaCheck, a tool which 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 futures can be composed 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 as encapsulated units of consistency, asynchronous message passing, discusses different message delivery semantics (at most once, at least once, exactly once) and eventual consistency.

Week 6 : Supervision. Introduces reification of failure, hierarchical failure handling, the Error Kernel pattern, lifecycle monitoring, discusses transient and persistent state.

Week 7: Conversation Patterns. Discusses the management of conversational state between actors and patterns for flow control, routing of messages to pools of actors for resilience or load balancing, acknowledgement of reception to achieve reliable delivery.

Also popular now: