All Projects → douban → Gobeansdb

douban / Gobeansdb

Licence: bsd-3-clause
Distributed object storage server from Douban Inc.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Gobeansdb

Storj
Ongoing Storj v3 development. Decentralized cloud object storage that is affordable, easy to use, private, and secure.
Stars: ✭ 1,278 (+264.1%)
Mutual labels:  distributed-storage, object-storage
Sfs
The distributed object storage server used by PitchPoint Solutions to securely store billions of large and small files using minimal resources. Object data is stored in replicated volumes implemented like Facebooks Haystack Object Store. Object metadata which essentially maps an object name to a volume position is stored in an elasticsearch index.
Stars: ✭ 78 (-77.78%)
Mutual labels:  distributed-storage, object-storage
Cortx
CORTX Community Object Storage is 100% open source object storage uniquely optimized for mass capacity storage devices.
Stars: ✭ 426 (+21.37%)
Mutual labels:  distributed-storage, object-storage
Seaweedfs
SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lake, for billions of files! Blob store has O(1) disk seek, cloud tiering. Filer supports Cloud Drive, cross-DC active-active replication, Kubernetes, POSIX FUSE mount, S3 API, S3 Gateway, Hadoop, WebDAV, encryption, Erasure Coding.
Stars: ✭ 13,380 (+3711.97%)
Mutual labels:  distributed-storage, object-storage
Zhong
Reliable, distributed cron.
Stars: ✭ 281 (-19.94%)
Mutual labels:  memcached
filestorage.js
Filestorage.js is client library for SKALE sidechain decentralized file storage. Used to transfer files between a browser and a SKALE sidechain.
Stars: ✭ 25 (-92.88%)
Mutual labels:  distributed-storage
cache-trace
A collection of Twitter's anonymized production cache traces.
Stars: ✭ 89 (-74.64%)
Mutual labels:  memcached
docker-s3fs
S3FS Docker image
Stars: ✭ 18 (-94.87%)
Mutual labels:  object-storage
Roma
ROMA: A Distributed Key-Value Store in Ruby
Stars: ✭ 318 (-9.4%)
Mutual labels:  memcached
Quack
Quack Toolkit is a set of tools to provide denial of service attacks. Quack Toolkit includes SMS attack tool, HTTP attack tool and many other attack tools.
Stars: ✭ 305 (-13.11%)
Mutual labels:  memcached
Daos
DAOS Storage Engine
Stars: ✭ 276 (-21.37%)
Mutual labels:  distributed-storage
anchor
High-Performance Erlang Memcached Client
Stars: ✭ 15 (-95.73%)
Mutual labels:  memcached
Senparc.co2net
支持 .NET Framework & .NET Core 的公共基础扩展库
Stars: ✭ 289 (-17.66%)
Mutual labels:  memcached
b52
b52 is a fast experimental Key/value database. With support for the memcache protocol.
Stars: ✭ 20 (-94.3%)
Mutual labels:  memcached
Cache
Cache library
Stars: ✭ 310 (-11.68%)
Mutual labels:  memcached
yfs
🏠超精简分布式对象存储
Stars: ✭ 35 (-90.03%)
Mutual labels:  object-storage
Arcus
ARCUS is the NAVER memcached with lists, sets, maps and b+trees. http://naver.github.io/arcus
Stars: ✭ 273 (-22.22%)
Mutual labels:  memcached
Neard
🎲 Portable WAMP software stack
Stars: ✭ 296 (-15.67%)
Mutual labels:  memcached
Frugalos
Frugal Object Storage
Stars: ✭ 270 (-23.08%)
Mutual labels:  object-storage
Bashcached
memcached server built on bash + socat
Stars: ✭ 270 (-23.08%)
Mutual labels:  memcached

GoBeansDB Release

Yet anonther distributed key-value storage system from Douban Inc.

Any memcached client cache interactive with GobeansDB without any modification.

Related

Prepare

GoBeansDB use go mod manage dependencies, please make sure your Go version >= 1.11.0 first.

Install

$ git clone http://github.com/douban/gobeansdb.git
$ cd gobeansdb
$ go mod vendor
$ make

test

$ make test  # unit test
$ make pytest  # Integrated test

run

$ ${GOPATH}/bin/gobeansdb -h

Python Example

import libmc


mc = libmc.Client(['localhost:7900'])
mc.set("foo", "bar")
mc.get("foo")

Features

  • 协议: memcached。推荐 libmc 客户端(c++ 实现,目前支持 go 和 python,基于 poll 的并发 get_multi/set_multi)
  • sharding: 静态 hash 路由,分桶数 16 整数倍
  • 索引: 内存索引全部 key,开销约为每个 key 20 字节,主要内存用 c 分配。 get hit 直接定位到文件 record,get miss 不落盘。
  • 最终一致性:同步脚本不断比较一个桶三副本 htree(每个桶一个 16 叉的内存 merkle tree)做同步,比较时间戳。
  • 文件格式:data 文件可以看成 log(顺序写入); 每个 record 256 bytes 对齐,有 crc 校验。

在 douban 使用方法

mc_client --- cache
          |
          --- any beansdb proxy -- beansdb servers 
  • 用于单个 key 并发写很少的数据
  • gobeansproxy 负责路由, 固定 3 副本
  • 两个集群: 分别存储 图片类 (cache 为 CDN) 和 长文本 (cache 为 mc 集群)。
  • 支持离线 dpark 读写,读支持本地化。
  • 可以视情况保留一段时间完整的写记录。
  • 借助 python 脚本 管理,近期整理后会部分开源,包 admin UI(readonly),同步脚本等

磁盘上的样子(256分区):

  • /var/lib/beansdb
    • 0/
      • 0/ -> /data1/beansdb/0/0
        • 000.data
        • 000.000.idx.s
        • 000.001.idx.s
        • ...
        • 008.000.idx.hash
        • ...
        • 009.data
        • 009.000.idx.s

入坑指南

优点

  1. 数据文件即 log, 结构简单,数据安全
  2. htree 设计 方便数据同步;
  3. 全内存索引,访问磁盘次数少,尤其可以准确过滤掉不存在的 key。

缺点/注意

  1. 一致性支持较弱,时间戳目前是秒级(受限于数据文件格式)。
  2. 全内存索引,有一定内存开销,在启动时载入索引略慢(约十几秒到半分钟, 决定于key 数量)。
  3. 数据文件格式的 padding 对小 value 有一定浪费。

配置重点(详见 wiki)

  • 分桶数
  • htree 高度(决定 merkle tree 部分内存大小和 溢出链表的平均长度)

beansdb 关系

  • 兼容
    • 数据文件格式不变
    • 仍使用 mc 协议("@" "?" 开头的特殊 key 用法略不同)
    • htree 的核心设计不变
  • 改进
    • go 实现,更稳定,方便配置和维护(http api等)
    • 内存开销变小
    • hint 文件格式和后缀变了
    • 同一个节点不同数据文件不在混部署,以避免坏一个损失整个点数据

一些设计/实现要点见 wiki

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].