"It was all a dream, I used to read Word Up! magazine."
-- The Notorious B.I.G.
Juicy is a simple memory key/value database. it use naive_raft to support distributed consistency. It is not finished yet, only partial functions are supported.
go get -u github.com/salamer/Juicy
package main
import (
"fmt"
client "github.com/salamer/Juicy/client"
)
func main() {
c := client.NewJuicyClient("localhost", 8080)
c.Set("helloq", "world")
c.Set("hahah", "wwww")
c.Set("aaaa", "zzzz")
fmt.Println(c.Get("aaaa"))
fmt.Println(c.Get("helloq"))
fmt.Println(c.Get("hahah"))
fmt.Println(c.Delete("hahah"))
fmt.Println(c.Get("hahah"))
c.Persist("aaa.txt")
fmt.Println(c.Empty())
c.Persist("db.juicy")
c.Clear()
fmt.Println(c.Empty())
}
package main
import (
"fmt"
Juicy "github.com/salamer/Juicy"
)
func main() {
db := Juicy.NewDB("hello", Juicy.SINGLE, Juicy.RaftConf{})
db.Start()
}
package main
import (
"fmt"
Juicy "github.com/salamer/Juicy"
)
const ConfPath = {confpath} //your node conf json file
const ID = {id} //your node id
const Name = {name} //your node name
const Host = {host} //your raft node host
const Port = {port} //your raft node port
func main() {
db := Juicy.NewDB("hello", Juicy.DISTRIBUTED, Juicy.RaftConf{
ID: ID,
Name: Name,
ConfPath: ConfPath,
Port: Port,
Host: Host,
})
db.Start()
}
- Compress
- Better Persist
Copyright © 2018 by Aljun
Under Apache license : http://www.apache.org/licenses/