Skip to content
Life is short Play more
  • Computer
    • Cloud
    • DataBase
      • Mysql
      • Oracle
    • Operation system
      • Android
      • Linux
      • Windows
    • Programming
      • C , C++
      • Java
      • Javascript
      • Linux shell
      • Php
      • python
      • Web Programing
    • Security
    • Virtulization
    • Web hosting
      • Ad
  • Life Testing
  • My work
    • wrapEasyDevice
  • Network
    • HTTP
  • Note
  • Other
    • Embedded
    • Hardware
  • Share
    • Articles
    • Music
    • Tools
    • Video
  • Software Testing
    • Automation Testing
    • Cloud Testing
    • Functional Testing
    • Performance Testing
Life is short Play more
Life is short play more

open source fast key-value storage library

Posted On 2011年9月28日

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
Features

Keys and values are arbitrary byte arrays.
Data is stored sorted by key.
Callers can provide a custom comparison function to override the sort order.
The basic operations are Put(key,value), Get(key), Delete(key).
Multiple changes can be made in one atomic batch.
Users can create a transient snapshot to get a consistent view of data.
Forward and backward iteration is supported over the data.
Data is automatically compressed using the Snappy compression library.
External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions.
Detailed documentation about how to use the library is included with the source code.

Limitations

This is not a SQL database. It does not have a relational data model, it does not support SQL queries, and it has no support for indexes.
Only a single process (possibly multi-threaded) can access a particular database at a time.
There is no client-server support builtin to the library. An application that needs such support will have to wrap their own server around the library.

Performance

Here is a performance report (with explanations) from the run of the included db_bench program. The results are somewhat noisy, but should be enough to get a ballpark performance estimate.
Setup

We use a database with a million entries. Each entry has a 16 byte key, and a 100 byte value. Values used by the benchmark compress to about half their original size.

LevelDB:    version 1.1
Date:       Sun May  1 12:11:26 2011
CPU:        4 x Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
CPUCache:   4096 KB
Keys:       16 bytes each
Values:     100 bytes each (50 bytes after compression)
Entries:    1000000
Raw Size:   110.6 MB (estimated)
File Size:  62.9 MB (estimated)

Write performance

The “fill” benchmarks create a brand new database, in either sequential, or random order. The “fillsync” benchmark flushes data from the operating system to the disk after every operation; the other write operations leave the data sitting in the operating system buffer cache for a while. The “overwrite” benchmark does random writes that update existing keys in the database.

fillseq      :       1.765 micros/op;   62.7 MB/s
fillsync     :     268.409 micros/op;    0.4 MB/s (10000 ops)
fillrandom   :       2.460 micros/op;   45.0 MB/s
overwrite    :       2.380 micros/op;   46.5 MB/s

Each “op” above corresponds to a write of a single key/value pair. I.e., a random write benchmark goes at approximately 400,000 writes per second.

Each “fillsync” operation costs much less (0.3 millisecond) than a disk seek (typically 10 milliseconds). We suspect that this is because the hard disk itself is buffering the update in its memory and responding before the data has been written to the platter. This may or may not be safe based on whether or not the hard disk has enough power to save its memory in the event of a power failure.
Read performance

此篇文章已被阅读1972 次

相关文章

  1. Unix domain sockets介绍
  2. java的stack错误没有显示行号显示unknown source
  3. cs50 library for c
  4. Performance Testing Guidance for Web Applications
  5. 如何单元测试一个android library

Related Posts

Mime type/subtype
WordPress cloudflare flexible ssl 设置下解决mixed cotent相关功能问题
jquery append 疑惑点

About The Author

The Tester

技术交流,生活学习

Add a Comment

取消回复

邮箱地址不会被公开。 必填项已用*标注

最热文章

  • No results available

近期文章

  • vue2 动态import导入vue提示报错
  • batch udpate sql批量更新数据库中所有表的特定字段值
  • Springboot application启动missing EmbeddedServletContainerFactory错误解决
  • Dubbo使用java api 配置开发禁止使用config center
  • 使用jacoco实时生成后端服务集成测试代码覆盖率报告

近期评论

  • ghj发表在《科学上网trojan的安装和使用》
  • The Tester发表在《cloudflare Rocket Loader建议中国使用者关闭》
  • zhoulujun发表在《cloudflare Rocket Loader建议中国使用者关闭》
  • The Tester发表在《vue+iviewui menu+tabs联动及tabs切换总结》
  • xiaodong.xuexd发表在《sonarqube 7.0 新功能及安装》
  • Josephnex发表在《使用github pages作图床》

标签云

adsense ajax android aws crawler css eclipse findbugs git goagent htmlunit iptables jacoco java javascript jmeter joolma joomla junit jvm lcd linux moco mongodb monkeyrunner mysql oled openvpn oracle pdp php puppet python rabbitmq sonar sonarqube spring springboot ubuntu vpn vue wordpress wrapeasymonkey yii yum

分类目录

© 2025 Life is short Play more | blog | Powered by WordPress & Customizable Blogily