Giter Club home page Giter Club logo

event.db's Introduction

Event.db

Build Status

evented kvs (heavily under developing)

motivation

In realtime web, We want to hook the change of Data(State). So you need a messaging system to do that.

For example, PubSub is used by this offer. You sets up some message queue server like ZeroMQ, or use Redis for storing.

but in these way, you need to do TWO thing at same time.

1, storing data. 2, publishing data.

                       save data
client ----> Server -------> database
               |
               |  queueing data
               v
            MQServer
             / | \
           /   |   \   publish to everyone
         /     |     \
       /       |       \
      v        v        v
   client   client    client

(Redis could store data, but basically on memory.)

but if you use Event.db in this case, You need to do is only 1.

because Event.db publish data, after storing data.

 client ---> Server
               |  save data
               v
            event.db
             / | \
           /   |   \     broadcast to everyone
         /     |     \   connecting to event.db
       /       |       \
      v        v        v
   client   client    client

kvs

You can set/get key-value data via tcp. Date will stored in file (not volatile, persistence).

The size of key value are fixed. you can setting that size by Configration File.

In my experience, almost of all message used in Realtime Apllication is small. (140byte tweets, 16byte sessionid etc)

So, Event.db dosen't support variable size. And this makes read/write faster.

You may say, "thats wastes a file size". I think so too, but Event.db will be able to scale out via consistent hashing. you can seve data in separate file. Also, file size may not be big problem in thease days. The speed of read/write is critical problem than waste of resource, especially in RealTime Apps :)

API

I'm going to support two way.

  • Memcache Protocol
  • MessagePack RPC

Every data will store to file by MessagePacked format.

broadcat

If new data saved by someone, that will broadcasted to everyone, connected to database.

how to use

$ bin/index.js --config /path/to/config
$ telnet 127.0.0.1
set foo bar
STORED
get foo
bar

License

Author: Jxck License: BSD

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.