V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
chenjiandongx
V2EX  ›  分享创造

grogudb: 一个为高频 Put/Has/Del/Range 操作而设计的持久化 KV 数据库

  •  
  •   chenjiandongx · 2023-04-12 11:12:24 +08:00 · 914 次点击
    这是一个创建于 595 天前的主题,其中的信息可能已经有所发展或是发生改变。
    image

    项目地址: https://github.com/chenjiandongx/grogudb

    设计文档

    特性

    • 纯 Go 实现,可内嵌进程序中。
    • 高效的 Put/Has/Del/Range 操作。
    • 线程安全。
    • 允许存储超过物理内存的数据。
    • 简洁的 API 。

    压测

    Iter: 10k, Bucket: 100 => 1M key

    Storage: grogudb    Op: PutUnique       Elapsed: 1.587680726s   Ops: 629849.555785/s
    Storage: leveldb    Op: PutUnique       Elapsed: 3.207660071s   Ops: 311753.732586/s
    Storage: badger     Op: PutUnique       Elapsed: 3.713279852s   Ops: 269303.699117/s
    Storage: grogudb    Op: PutDuplicate    Elapsed: 809.645321ms   Ops: 1235108.724849/s
    Storage: leveldb    Op: PutDuplicate    Elapsed: 3.344680804s   Ops: 298982.192502/s
    Storage: badger     Op: PutDuplicate    Elapsed: 3.809289718s   Ops: 262516.131360/s
    Storage: grogudb    Op: PutIf           Elapsed: 179.746041ms   Ops: 5563404.870764/s
    Storage: leveldb    Op: PutIf           Elapsed: 512.160806ms   Ops: 1952511.766392/s
    Storage: badger     Op: PutIf           Elapsed: 1.063730519s   Ops: 940087.721597/s
    Storage: grogudb    Op: Has             Elapsed: 79.718185ms    Ops: 12544189.258699/s
    Storage: leveldb    Op: Has             Elapsed: 1.188825549s   Ops: 841166.309759/s
    Storage: badger     Op: Has             Elapsed: 1.443558895s   Ops: 692732.387618/s
    Storage: grogudb    Op: Del             Elapsed: 1.25951208s    Ops: 793958.244529/s
    Storage: leveldb    Op: Del             Elapsed: 3.471029382s   Ops: 288098.972940/s`
    Storage: badger     Op: Del             Elapsed: 4.524956978s   Ops: 220996.576291/s
    Storage: grogudb    Op: Range           Elapsed: 81.139301ms    Ops: 12.324484/s
    Storage: leveldb    Op: Range           Elapsed: 71.821588ms    Ops: 13.923390/s
    Storage: badger     Op: Range           Elapsed: 295.666737ms   Ops: 3.382186/s
    Storage: grogudb    Op: Get             Elapsed: 26.561270284s  Ops: 37648.801782/s
    Storage: leveldb    Op: Get             Elapsed: 1.080395935s   Ops: 925586.599879/s
    Storage: badger     Op: Get             Elapsed: 1.423728937s   Ops: 702380.891483/s
    

    Iter: 100k, Bucket: 100 => 10M key (Without grogudb)

    Storage: grogudb    Op: PutUnique       Elapsed: 16.423032579s  Ops: 608900.941522/s
    Storage: leveldb    Op: PutUnique       Elapsed: 51.516953146s  Ops: 194110.858452/s
    Storage: badger     Op: PutUnique       Elapsed: 42.421363992s  Ops: 235730.279721/s
    Storage: grogudb    Op: PutDuplicate    Elapsed: 8.815478924s   Ops: 1134368.318070/s
    Storage: leveldb    Op: PutDuplicate    Elapsed: 39.615313747s  Ops: 252427.636037/s
    Storage: badger     Op: PutDuplicate    Elapsed: 47.31107471s   Ops: 211367.001517/s
    Storage: grogudb    Op: PutIf           Elapsed: 2.299923889s   Ops: 4347969.968844/s
    Storage: leveldb    Op: PutIf           Elapsed: 5.870490731s   Ops: 1703435.105892/s
    Storage: badger     Op: PutIf           Elapsed: 15.958825217s  Ops: 626612.539709/s
    Storage: grogudb    Op: Has             Elapsed: 850.056456ms   Ops: 11763924.536325/s
    Storage: leveldb    Op: Has             Elapsed: 19.188154981s  Ops: 521154.848390/s
    Storage: badger     Op: Has             Elapsed: 22.721393642s  Ops: 440113.848541/s
    Storage: grogudb    Op: Del             Elapsed: 12.924122561s  Ops: 773746.918044/s
    Storage: leveldb    Op: Del             Elapsed: 44.487984603s  Ops: 224779.793673/s
    Storage: badger     Op: Del             Elapsed: 44.315291044s  Ops: 225655.744652/s
    Storage: grogudb    Op: Range           Elapsed: 524.850653ms   Ops: 1.905304/s
    Storage: leveldb    Op: Range           Elapsed: 1.177148523s   Ops: 0.849510/s
    Storage: badger     Op: Range           Elapsed: 3.15658723s    Ops: 0.316798/s
    
    5 条回复    2023-04-25 11:37:40 +08:00
    Kould
        1
    Kould  
       2023-04-12 11:14:39 +08:00
    好巧,我也在写存储引擎: https://github.com/KKould/KipDB
    danbai
        2
    danbai  
       2023-04-17 18:26:49 +08:00
    好巧,我刚好在看曼达洛人
    chenjiandongx
        3
    chenjiandongx  
    OP
       2023-04-25 11:03:49 +08:00
    @danbai This is the way
    chenjiandongx
        4
    chenjiandongx  
    OP
       2023-04-25 11:04:20 +08:00
    @Kould 👍🏻
    danbai
        5
    danbai  
       2023-04-25 11:37:40 +08:00
    @chenjiandongx This is the way
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1050 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 19:53 · PVG 03:53 · LAX 11:53 · JFK 14:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.