Giter VIP home page Giter VIP logo

oacp's Introduction

Introduction for OACP

Basic idea about OACP

Observable Atomic Consistency Protocol is a memory model for distribued system. We extend the current GSP with monotonic update and try to get better performance. It's a combination between total order broadcast (which will be implemented through raft) and Conflict Free Data Type(CRDT). So our implementation will be divided into two stages:

  1. Raft protocol
  2. CRDT representation (start with GCounter, ORset)

API usage (counter example)

Step One: CRDT implementation (state/CRDT)

Extend existing trait CRDT:

case class RGCounter(...) extends CRDT[Array[Int], Int]

object CRDT{

  implicit def RGCounterCRDT = new RGCounter
  
  ...

}

Step Two: application message definition (counter/protocol)

trait RGCounterProtocol {
  sealed trait CounterCmnd
  case class Add(num: Int) extends CounterCmnd
  case object Get extends CounterCmnd
  case class ResultIs(mValue: Int) extends CounterCmnd
}

Step Three: user interface implementation (counter/CounterClient & CounterServer)

class CounterClient extends OACPClient[Array[Int], Int, String] {

  val CounterClientBehavior: Receive = {
  
    ...
    
  }

  override def receive = CounterClientBehavior.orElse(super.receive)
  
  ...
  
}

Installing prerequisite

eventuate-crdt0.10: (https://github.com/RBMHTechnology/eventuate/tree/r-0.10)

A small test example

The code is included in src/multi-jvm/scala/se/kth/csc/progsys/oacp/ExampleSpec.scala This example uses twitter server and client and includes:

  1. create three server actors(Raft cluster) and one client actor
  2. send message to the raft cluster (msg type: AddFollower(CvOp), Twitter(TOp), Read(TOp))
  3. count the number of messages between client and servers [Optional]

Running command: using "sbt" to the interaction mode, then "multi-jvm:testOnly se.kth.csc.progsys.oacp.ExampleSpec".

oacp's People

Contributors

cynthiaz92 avatar

Stargazers

Taiki SHIMIZU avatar

Watchers

James Cloos avatar  avatar

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.