Skip to content

GINK03/pure-python-kvs-f2db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flash Friendly DB

このソフトウェアはフラッシュストレージに最適化されたPure PythonのKVSです。
This software is Pure Python KVS optimized for flash storage.

pypi

インストール/Install

Python 3.6以上が必要です。 You need Python 3.6 or higher.

$ pip3 install f2db

クイックスタート/Quick Start

>>> import f2db
>>> db = f2db.f2db('/tmp/f2db')
>>> db.save(key='foo', val=['bar', 1, 2, None, True])
>>> db.get('foo')
['bar', 1, 2, None, True]
>>> db.save(key='baz', val='2nd-value')
>>> list(db.get_iter())
['2nd-value', ['bar', 1, 2, None, True]]
>>> db.exists(key='baz')
True
>>> db.exists(key='vaz')
False

keyはstr型、valはpythonのpickleでシリアライズできるオブジェクト型を受け付けることができます。
Val can accept object types that can be serialized with pickle, key must to be str type.

特徴/Features

    1. ファイルシステムベースのKVS/File system based KVS
    1. LevelDBやRocksDBに比べ並列アクセス、並列書き込みに強い(完全性は保証していない)/ Stronger in parallel access and parallel writing than LevelDB and RocksDB (completeness is not guaranteed)
    1. Pythonのオブジェクトをそのまま保存、復元できる/ You can save and restore Python objects as they are

ベンチマーク/Benchmark

Fig. 1
並列での処理を考慮すると処理が重いとき、良好なパフォーマンスを発揮する

Provides good performance when processing is heavy considering parallel processing

ユースケースの例/Example use case

NFSでリモートのSSDをマウントして、多くのURLインデックスを共有してウェブページをスクレイピングするとき、データを効率的に格納するのに用いることができる。
It can be used to efficiently store data when mounting remote SSDs with NFS and sharing many URL indexes and scraping web pages.

Code

Fig. 2

About

pure python kvs f2db(flash friendly db)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages