Top Banner
INTRODUCING REALLY.IO Ahmed Soliman ان م ي سل د حم أA reactive horizontally-scalable observable data backend
30

Introduction to Really.io

Jul 16, 2015

Download

Technology

Ahmed Soliman
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Really.io

INTRODUCING REALLY.IO

Ahmed Solimanأحمد سليمانA reactive horizontally-scalable observable data backend

Page 2: Introduction to Really.io

• CAT Reloaded Co-founder

• Life-long architect, software, and systems engineer.

• Focusing on systems reliability, scalability, and clean code.

Conictus

Page 3: Introduction to Really.io

WHAT IS REALLY.IO?

Page 4: Introduction to Really.io

BADASS ELASTIC OPEN-SOURCE BACKEND FOR YOUR REALTIME

APPLICATIONS

Page 5: Introduction to Really.io

REACTIVE BY DESIGN

Page 6: Introduction to Really.io

SHARDING/CLUSTERING/NO SPF

Page 7: Introduction to Really.io

BATTLE-TESTED TECHNOLOGY STACKJVM, Scala, akka, websockets, kafka, mongodb, etc.

Page 8: Introduction to Really.io

GRAPH-LIKE DATA MODELING

Page 9: Introduction to Really.io

sample from pyreally

really.get('/products/1234/reviews/1234')

Page 10: Introduction to Really.io

• yaml-based model definition

• directory structure that maps the model hierarchy

• model is versioned for easier data-migration

version: 3fields: firstName: type: string required : true lastName: type: String fullName: type: Calculated valueType: String dependsOn: firstName, lastName value: | function calculate(firstName, lastName) { var fullName = firstName if (lastName != undefined) fullName += " " + lastName return fullName; } locale: type: String validation: | value.length <= 3

Page 11: Introduction to Really.io

ARCHITECTURE

Page 12: Introduction to Really.io
Page 13: Introduction to Really.io

CORE DESIGN DECISIONS• Event-Sourcing Architecture (CQRS) based in Akka Persistence

• Offload Data Storage Engines

• Strong Consistency with relaxed write performance constraints (read-my-own-writes)

• Strong optimization for read-performance and update-propagation performance

• At Least-Once delivery semantics.

• Share-nothing, horizontally scalable, automatic rebalancing, bounded-latency, highly-concurrent

• Easy Integration with Big-Data streaming systems (Spark, Storm, Flume, etc.)

Page 14: Introduction to Really.io

TRANSPORT AND PROTOCOL

• Native WebSockets (full-duplex)

• Plain JSON protocol, fully asynchronous.

• Objects has revisions (versioned) “_rev”: 245

• Only deltas are propagated on the wire

Page 15: Introduction to Really.io

{ tag: 1, cmd: "get", cmdOpts: { fields: ["firstname", "@displayInfo"] }, r: '/users/114243'}

{ tag: 1, meta: { fields: ["firstname", "lastname"] }, r: '/users/114243', body: { "_r": "/users/114243/", "_rev": 323 "firstname": "Ahmed", "lastname": "Soliman", "creator": { value: "/users/234234", ref: { //reference field -- dereferenced "_r": "/users/234234/", "_rev": 20 //revision must be set "name": "Hamada Imam", } } }}

Request Response

Page 16: Introduction to Really.io

{ tag: 1, cmd: "update", cmdOpts: { }, r: "/users/66123/", rev: 42, body: { ops: [ { op: 'set', key: 'lastName', value: 'Ahmed' }, { op: "addNumber", key: 'age', value: 1 //adding one } ] }}

Request Response

{ tag: 1 r: '/users/66123/', rev: 43}

Page 17: Introduction to Really.io

READS AND QUERIES

• Reads are really fast!

• Welcome to the RQL (Really Query Language™). But Why?

firstName = $name AND (age BETWEEN $range OR group IN $groups)

{ name: "Ahmed", range: [10, 20], groups: ["admins", "developers"]}

Page 18: Introduction to Really.io

COLLECTION ACTOR AND VIEWS

Page 19: Introduction to Really.io

Event Log

CMD

CollectionActor

RESP

EVT EVT

ViewMaterializer

EVT

Database(mongodb)

Read Handler

CMD

ERR

RESP

Model Validation

Gorilla

Page 20: Introduction to Really.io

GORILLA EVENT CENTER

Page 21: Introduction to Really.io

FROM ITS SCALA-DOCS• The gorilla event centre is an actor that receives events from the

Collection View Materializer and store it in a persistent ordered store (H2 database)

• It ensures that we are not storing the same revision twice for the same object (by ignoring the event)

• Publishes the event on the Gorilla PubSub asynchronously for real-time event distribution

Page 22: Introduction to Really.io

Gorilla Event Center Log

Replayer

EVTViewMaterializer

Object SubscriberValidation

In-Memory Volatile

Revision Log

EVT

Distributed PubSub

PUSH

Subscription Manager

Page 23: Introduction to Really.io

ABOUT OUR LOGO

Peregrine

Page 24: Introduction to Really.io

Idea and Design by Mohamed Gamal

Page 25: Introduction to Really.io

THETEAM

Page 26: Introduction to Really.io

ROADMAP• Bug fixing (a lot of them)

• A detailed documentation on the architecture, protocol, and client-development

• Administration interface (API/web-based)

• Performance tuning

• Checkout https://reallyio.atlassian.net/ for the issue tracking

Page 27: Introduction to Really.io

MISSING YET.

• Authentication sub-module for username/password combination

• A fully-functional entirely-reactive JavaScript low-level driver

• Higher-level libraries for integration with AngularJs, EmberJs, ReactJs.

• Android and iOS client libraries for mobile apps integration

Page 28: Introduction to Really.io

CALL FOR CONTRIBUTORS

!github.com/reallylabs/really

http://really.io

Page 29: Introduction to Really.io
Page 30: Introduction to Really.io

THANK YOU!