Skip to content

demouth/orenodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



Build Status

OrenoDB is dataBase server implementation for learning. OrenoDB means MyDB in Japanese.


Features

  • In-memory Key-Value database
  • Use redis protocol

Build and Run

Start up at port 8888.

$ go build
$ ./orenodb
Server is running at localhost:8888

Connection from client

Implementation using golang and redis client library.

package main

import (
	"github.com/gomodule/redigo/redis"
)

func main() {
	conn, _ := redis.Dial("tcp", "localhost:8888")
	conn.Do("SET", "key", "value")
	val, err := redis.String(conn.Do("GET", "key"))

	if err != nil {
		t.Fatal(err)
	}
	if val != "value" {
		t.Fatal(val)
	}
}

Use telnet command.

$ telnet localhost 8888
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
*3
$3
SET
$3
key
$5
value
+OK

About

OrenoDB is dataBase server implementation for learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages