GithubHelp home page GithubHelp logo

pure-python-kvs-f2db's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.