theoneLee / Mongongo

Mongongo -- Cassandra in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cingo

Mongongo

License: MIT Language build

Cassandra in Go.

Getting Started

  • Install Go 1.15
  • Enable Go module and Setup Go package proxy
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.io,direct
  • Download

First setup your Go project structure, put the following into your ~/.bashrc:

export GOPATH=~/projects/go  # any where you like, except $GOROOT
export mg=$GOPATH/src/github.com/DistAlchemist

Then make directories:

$ mkdir -p $mg
$ cd $mg
$ git clone https://github.com/DistAlchemist/Mongongo.git
# or git clone git@github.com:DistAlchemist/Mongongo.git
$ cd Mongongo
  • Setup tmux for multi-terminal (recommended)
$ sudo apt install tmux
  • Create a new session of tmux:
$ tmux new -s mg
  • Build files:
$ cd $mg
$ cd Mongongo
$ make
  • Inside one terminal, run Mongongo server:
$ bin/mg-server
  • Inside another terminal, run command line interface:
$ bin/cli 
  • To start servers on multiple nodes:
$ sudo chmod +x startallpeers.sh
$ ./startallpeers.sh 
  • To stop servers on multiple nodes:
$ sudo chmod +x stopallpeers.sh
$ ./stopallpeers.sh

Design

  • The design mostly follows the very early version of Cassandra

  • Currently only simple SET and GET operation is supported:

 SET table1.standardCF1['row1']['column1']='value' 
 GET table1.standardCF1['row1']['column1'] 
  • The project is roughly divided into three layers:

    • Command Line Interface (parse SQL to command)
    • Mongongo Server (determine which nodes need to perform the operation, send the operation to their storage layer)
    • Storage Layer (perform specific operation, update commitLog, memTable, ssTable etc.)
  • TODO

    • Add more tests.
    • Strengthen QL support.

Contributing

Example

mongongo

License

MIT License

About

Mongongo -- Cassandra in Go

License:MIT License


Languages

Language:Go 91.1%Language:Java 7.9%Language:Makefile 0.5%Language:ANTLR 0.3%Language:Shell 0.2%