Giter Club home page Giter Club logo

reactivemachine's Introduction

Reactive Machine

Reactive Machine is a serverless programming model for writing reliable elastic micro-services.

This project is no longer actively maintained. It was our initial foray into this space. But we have now joined forces with Azure Durable Functions, which has a similar mission, but is more specifically targeted at serverless application development.

The idea is to express the application logic at a level of abstraction that hides platform failures (machines or connections going down) and configuration choices (e.g. the number of servers). This high-level representation is then compiled and deployed on a back-end host of choice. Importantly, the host can recover from failures transparently and consistently, because our compiler produces a deterministic state machine that makes it possible to reliably track the application state by logging messages and/or persisting snapshots to durable storage.

Programming Model

Reactive machine programs are built on task abstraction that we call an operation. The model offers a number of different operations:

  • Orchestrations describe operations that are composed of one or more other operations. They are written in async/await style, and execute deterministically and reliably. When executing an operation, orchestrations can either perform it (meaning they wait for its completion) or fork it (meaning it executes completely independently of its parent).
  • Activities are operations that can be unreliable or nondeterministic, such as calls to external services.
  • States represent a small piece of information (cf. key-value pair, or a grain, or virtual actor) that can be atomically accessed via a specified set of read and update operations.
  • Affinities define locality, by specifying keys that can be used to place state, orchestrations, and activities. These keys are also used for synchronization (locking).
  • Events provide reliable, consistent pub-sub. When an event is raised by an orchestration, all the states that subscribe to it are modified. Events appear to be globally ordered and virtually synchronous.

Languages

At the moment, both the programming model and the hosts are written in C#. Support for other languages is conceivable, but not on our immediate Radar.

Hosts

Because reactive machine applications are compiled into an intermediate representation (specifically, deterministically replayable state machines), it is easy to build and experiment with multiple hosting back-ends. Different hosts always provide the same application semantics, and are therefore easily interchangeable. But they can exhibit large differences in non-semantic characteristics, such as cost, scalability, latency, throughput, and recovery speed.

Currently, the repository contains two hosts:

  • A local emulator, meant for debugging and local profiling. It emulates the reactive machine processes in a single process, using either a single thread or multiple threads.
  • A functions host, built on top of Azure Functions, Azure EventHubs, and Azure Blobs. It uses EventHubs to launch the reactive machine processes inside Azure functions, and to implement reliable communication between the processes. State snapshots are stored in Azure Blobs.

Also, we are currently working on releasing a third host that executes on top of the Ambrosia system. Ambrosia is the ideal back-end for Reactive Machine, because it provides virtual resiliency with very good performance.

Status and Plan

We are currently at 1.0.0-alpha, meaning that this is preview which should give you an idea of what this is all about once finished. What we have is:

  • A C# implementation of the reactive machine programming model and compiler
  • Two host implementations (emulator and functions)
  • Application examples to demonstrate the features of the programming model
  • A Hello World sample to demonstrate how to use the 2 hosts

Before we can release 1.0.0-beta, we still need to do some significant work:

  • Add an Ambrosia Host
  • Plug the many gaping holes in the documentation
  • Implement support for code updates, placement updates, and changing the number of processes
  • Fix known bugs in existing tests
  • Build and test on Linux

Further in the future, we will consider moving from 1.0.0-beta to 1.0.0 as a matter of stability, i.e. we will remove the 'beta' tag once we feel comfortable with users placing trust on the stability of the code in a production environment.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

reactivemachine's People

Contributors

microsoftopensource avatar msftgits avatar sebastianburckhardt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactivemachine's Issues

Yest another microservice technologies?

It would be really great if Microsoft could clearly state where they are going with all their different microservice technologies.
Wise from experience and with a clear memory that Microsoft can just cancel and terminate just about anything without any warning or communication from one day to another, it would be great to know where you are going in the long run. This since if you are to base a huge enterprise project on something you need it to be around and not just be abandoned like, for example, Silverlight. Yu need to know that it will be around, supported by Microsoft, and that it will be actively developed, improved and maintained for at least 10+ years.

Also some other questions...

  1. Which problem is ReactiveMachine a solution to?
  2. When you have AMBROSIA, which supports coding stuff in C#, what does ReactiveMachine add which is not already possible to do in AMBROSIA?
  3. How does this relate to ServiceFabric and Orleans?

Have you looked at Uber Cadence?

Hi, have you looked at Uber Cadence which is production worthy implementation of the similar framework?
It would be nice to have the ReactiveMachine running on top of it as Cadence still missing .NET client.

Support for code updates

Currently, reactive machine services are effectively "deploy-once" - every time we redeploy we have to restart the service and delete all state. This severely limits the applicability of the programming model and defeats the purpose of our programming constructs. For example, it hardly makes sense to store application state within the service if that state cannot be maintained between code updates.

Therefore, we urgently need some support for updating code, even if rudimentary.

I have started thinking about an early solution to this based on the idea of "immutable code": orchestrations, events, activities, state, and operations cannot be changed, but new ones can be added.
And newly added orchestrations, activities, states, and operations can be annotated as replacements of old ones, which means running code can migrate to the newer versions without interruption.

This means the code is "semantically cumulative", i.e. it strictly grows over time, and all past versions of the code are included in the latest version.

I am starting a new work-in-progress PR that has a preliminary syntax proposition for this feature.

Perf testing for client requests

We currently have not tested the request path for the FunctionsHost under load. By design, it has high latency but should in principle allow decent throughput. But we need to test that.

Ambrosia Host

Yes, we really want that.

It's a matter of porting the previous implementation to the latest state of Ambrosia.

Support for Service Fabric

Please add support for Service Fabric, examples and documentation... it would also be good to clarify which parts of either platform should be used and in which scenarios.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.