Giter Club home page Giter Club logo

goromdb's Introduction

Build Status Go Report Card

GOROMDB

Yet another single process KVS server implemented over file-based database.

GOROMDB is a datastore that:

  • accepts read-only access
  • talks multiple protocols like memcached and others
  • handles multiple database backends like JSON, BerkeleyDB, BoltDB, and others

STRUCTURE

                     .---------.
                     | watcher |
                     '----+----'
                          |
        .--------.   .----+----.   .---------.
TCP --> | server +---+ handler +---+ storage |-.
        '----+---'   '----+----'   '---------' | <-- Replacable database
             |            |          '---------'
       .-----+----.   .---+----.
       | protocol |   | loader |
       '----------'   '--------'

HOW TO USE

GOROMDB can be used as an executable binary, or a collection of simple libraries.

Executable Binary

Just do:

go install github.com/yowcow/goromdb

An example of booting GOROMDB with BerkeleyDB database is:

goromdb -addr :11211 -storage bdb -file path/to/bdb-data.db -basedir path/to/store

Note that default compilation of the binary only covers basic features of GOROMDB. If full capability, like namespaced database, and/or multiple database file deployment, is required, craft libraries and build GOROMDB for your own.

GOROMDB does not daemonize itself. Look of other tools to daemonize GOROMDB.

Libraries

Just do:

go get github.com/yowcow/goromdb

and import whatever package into your source code.

BENCHMARK AND PERFORMANCE

GOROMDB should serve fast but maybe not quite as fast as pure memcached. Detailed benchmark is comming up.

DIRECTORY STRUCTURE

When -basedir of /tmp/path/to/dir is specified at boot, GOROMDB creates subdirectories data00 and data01 under /tmp/path/to/dir:

/tmp/path/to/dir
├── db00
└── db01

When -file of /tmp/path/to/dir/data.db is specified at boot, GOROMDB will watch for database file /tmp/path/to/dir/data.db and its MD5 sum file /tmp/path/to/dir/data.db.md5.

When database and MD5 files are placed in directory /tmp/path/to/dir, GOROMDB will verify MD5 sum.

/tmp/path/to/dir
├── data00
├── data01
├── data.db
└── data.db.md5

Once MD5 sum verification succeeds, GOROMDB will move data file into subdirectory either data00 or data01, and load the database into running server.

/tmp/path/to/dir
├── data00
│   └── data.db
└── data01

Placing database and MD5 sum files again will load database into next subdirectory data01 vice versa.

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.