LevelDB

LevelDB
開發者Google
首次发布2012年5月,​12年前​(2012-05
当前版本
  • 1.23 (2021年2月23日;穩定版本)[1]
編輯維基數據鏈接
源代码库
  • github.com/google/leveldb
編輯維基數據鏈接
编程语言C++
操作系统跨平台
类型嵌入數據庫編程庫
许可协议BSD许可证
网站github.com/google/leveldb 编辑维基数据

LevelDB是一個由Google公司所研發的键-值存储嵌入式數據庫管理系統編程庫,[2]開源BSD許可證發佈。[3]

特徵

例子

儲存鍵/值對,和查詢鍵的值:

#include "leveldb/db.h"
#include <iostream>

using namespace std;

int main(){
  leveldb::DB *db;
  leveldb::Options options;

  options.create_if_missing = true;

  // 開啟數據庫
  leveldb::DB::Open(options, "/tmp/testdb", &db);

  // 鍵 = MyKey29,值 = "Hello World!"
  string key = "MyKey29", value = "Hello World!", result;

  // 儲存 鍵/值對
  db->Put(leveldb::WriteOptions(), key, value);

  // 查詢 MyKey29 鍵的值
  db->Get(leveldb::ReadOptions(), key, &result);

  // 輸出值到屏幕
  cout << "result = " << result << endl;

  // 關閉數據庫
  delete db;

  return 0;
}

執行結果

(LevelDB安裝目錄為:leveldb-read-only)[6]

% g++ test.cc -Ileveldb-read-only/include -Lleveldb-read-only -lleveldb -lpthread
% ./a.out 
result = Hello World!

RocksDB

2013年Facebook基於LevelDB開發出RocksDB,特別針對伺服器負載而優化。[7]

语言的绑定

參見

参考文献

  1. ^ 1.0 1.1 Release 1.23. 2021年2月23日 [2021年3月13日]. 
  2. ^ leveldb實現解析 (PDF). [2017-09-05]. (原始内容存档 (PDF)于2012-01-31). 
  3. ^ LevelDB: A Fast Persistent Key-Value Store. [2011-08-07]. (原始内容存档于2016-03-26). 
  4. ^ LevelDB Benchmarks. [2011-08-07]. (原始内容存档于2011-08-20). 
  5. ^ A fast compressor/decompressor. [2011-07-30]. (原始内容存档于2015-08-22). 
  6. ^ Source Checkout - LevelDB. [2011-08-06]. (原始内容存档于2015-03-18). 
  7. ^ RocksDB. [2014-01-25]. (原始内容存档于2021-02-05). 

外部連結

  • LevelDB 開放原始碼計劃主頁
鍵值存儲
最終一致性鍵值存儲
  • Cassandra
  • Dynamo英语Dynamo
  • Riak英语Riak
  • Hibari英语Hibari
  • Virtuoso英语Virtuoso
  • Voldemort英语Voldemort_(distributed_data_store)
內存鍵值存儲
  • Memcached
  • Redis
  • Oracle Coherence英语Oracle Coherence
  • NCache英语NCache
  • Hazelcast英语Hazelcast
  • Tuple space英语Tuple space
  • Velocity英语Velocity_(memory_cache)
持久化鍵值存儲
  • BigTable
  • LevelDB
  • Tokyo Cabinet英语Tokyo Cabinet
  • Tarantool
  • TreapDB英语TreapDB
  • Tuple space英语Tuple space
文檔存儲
  • MongoDB
  • CouchDB
  • SimpleDB
  • Terrastore
  • BaseX英语BaseX
  • Clusterpoint英语Clusterpoint
  • Riak英语Riak
  • No2DB
圖存儲
  • FlockDB英语FlockDB
  • DEX
  • Neo4J英语Neo4J
  • AllegroGraph英语AllegroGraph
  • InfiniteGraph英语InfiniteGraph
  • OrientDB英语OrientDB
  • Pregel
NoSQL理論
列表级条目 NoSQL數據庫比較