Git Product home page Git Product logo

dsscratch's Introduction

dsscratch

Distributed system simulator and distributed algorithm scratchpad.

So far it includes:

  • Processes, Channels, and Topologies
  • A TopologyRunner that simulates time and concurrency
  • Nodes that can be augmented with modules for encapsulating state and behavior
  • A Module template for quickly implementing new modules
    • Modules allow algorithm decoupling. For example, the Two Phase Commit module sends a Broadcast command that will be executed by whatever broadcast component is present.
  • Lamport clocks and vector clocks
  • Simple broadcast (flooding) and echo algorithms
  • Two Phase Commit
  • A test module to check whether broadcast algorithms work
  • A test module to check whether commit/consensus algorithms work
  • The Tarry algorithm for finding a spanning tree of a network
  • The Chandy-Lamport snapshot algorithm

Installation

dsscratch Model

Multiple Nodes communicate over FIFO Channels. Each Node encapsulates one or more Modules that represent the logic executed in response to messages (and potentially timers) and encapsulate local state used in that logic.

A Message received at a Node over a Channel is unwrapped and the Command it contains is delivered to each of that Node's Modules. A Module will either execute code after receiving the Command (and potentially send an outgoing Command via its encapsulating Node) or ignore the Command altogether.

For example, Echo.scala defines a simple echo algorithm for broadcasting over the cluster. In its processMessage() method, it looks for one of three Commands: Broadcast, InitiateEcho, or Echo. Any other Commands it ignores.

Getting Started

In order to use dsscratch to implement distributed algorithms, you will implement a Module. You can look at Module.scala for the complete interface (and the ModuleParent interface, which is how a Module communicates with its encapsulating Node). ModuleTemplate.scala provides a template and some guidelines for creating a Module. For a simple example, see SimpleBroadcast.scala.

In order to create a test of your algorithm, you will need to define a separate test Module. For an example of such a test Module, see BroadcastTester.scala, which can be used to test broadcast algorithms.

You run tests via ModuleTest, through which you can define topology parameters as well as test parameters. See SimpleBroadcastTesterRunner.scala for an example.

Illustration

Fitzroy exploring the treacherous waters of distributed systems theory: Fitzroy

dsscratch's People

Contributors

jtfmumm avatar

Stargazers

 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

Forkers

sathiyapk

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.