GolangNote

Golang笔记

godown: 一个简单、分布式、容错的K/V 数据库

Permalink

godown 是受Redis的启发,用go 实现的分布式容错的key-value 数据库。 它使用Raft protocotol作为一致性算法。 它支持String,Bitmap,Map,List数据结构。

godown演示

go client 示例

Go: godown client 示例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main

import (
	"fmt"

	"github.com/namreg/godown/client"
)

func main() {
	c, err := client.New("127.0.0.1:4000")
	if err != nil {
		panic(err)
	}
	defer c.Close()

	res := c.Get("key")
	if res.Err() != nil {
		panic(res.Err())
	}

	if res.IsNil() {
		fmt.Print("key does not exist")
	} else {
		fmt.Println(res.Int64())
	}
}

本文网址: https://golangnote.com/topic/236.html 转摘请注明来源

Related articles

Write a Comment to "godown: 一个简单、分布式、容错的K/V 数据库"

Submit Comment Login
Based on Golang + fastHTTP + sdb | go1.22.3 Processed in 0ms