GithubHelp home page GithubHelp logo

jevolk / rust-rocksdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zaidoon1/rust-rocksdb

0.0 1.0 0.0 1.83 MB

rust wrapper for rocksdb

License: Apache License 2.0

C++ 0.80% Rust 99.17% Makefile 0.02%

rust-rocksdb's Introduction

rust-rocksdb

RocksDB build crates.io documentation license rust 1.75.0 required

GitHub commits (since latest release)

Why The Fork

The original rust-rocksdb repo is amazing and I appreciate all the work that has been done, however, for my use case, I need to stay up to date with the latest rocksdb releases as well as the latest rust releases so in order to to keep everything up to date, I decided to fork the original repo so I can have total control and be able to create regular releases.

Requirements

  • Clang and LLVM

Contributing

Feedback and pull requests welcome! If a particular feature of RocksDB is important to you, please let me know by opening an issue, and I'll prioritize it.

Usage

This binding is statically linked with a specific version of RocksDB. If you want to build it yourself, make sure you've also cloned the RocksDB and compression submodules:

git submodule update --init --recursive

Features

Compression Support

By default, support for Snappy, LZ4, Zstd, Zlib, and Bzip2 compression is enabled through crate features. If support for all of these compression algorithms is not needed, default features can be disabled and specific compression algorithms can be enabled. For example, to enable only LZ4 compression support, make these changes to your Cargo.toml:

[dependencies.rocksdb]
default-features = false
features = ["lz4"]

Multithreaded ColumnFamily alternation

RocksDB allows column families to be created and dropped from multiple threads concurrently, but this crate doesn't allow it by default for compatibility. If you need to modify column families concurrently, enable the crate feature multi-threaded-cf, which makes this binding's data structures use RwLock by default. Alternatively, you can directly create DBWithThreadMode<MultiThreaded> without enabling the crate feature.

Switch between /MT or /MD run time library (Only for Windows)

The feature mt_static will request the library to be built with /MT flag, which results in library using the static version of the run-time library. This can be useful in case there's a conflict in the dependecy tree between different run-time versions.

Jemalloc

The feature jemalloc will enable the unprefixed_malloc_on_supported_platforms feature of tikv-jemalloc-sys, hooking the actual malloc and free, so jemalloc is used to allocate memory. On Supported platforms such as Linux, Rocksdb will also be properly informed that Jemalloc is enabled so that it can apply internal optimizations gated behind Jemalloc being enabled. On unsupported platforms, Rocksdb won't be properly informed that Jemalloc is being used so some internal optimizations are skipped BUT you will still get the benefits of Jemalloc memory allocation. Note that by default, Rust uses libc malloc on Linux which is known to have more memory fragmentation than Jemalloc especially with Rocksdb. See github issue for more information. In general, I highly suggest enabling Jemalloc unless there is a specific reason not to (your system doesn't support it, etc.)

Malloc Usable Size

The feature malloc-usable-size will inform Rocksdb that malloc_usable_size is supported by the platform and is necessary if you want to use the optimize_filters_for_memory rocksdb feature as this feature is gated behind malloc_usable_size being available. See rocksdb for more information on the feature.

rust-rocksdb's People

Contributors

spacejam avatar isynaptic avatar kaedroho avatar aleksuss avatar niklasf avatar ekmartin avatar stanislav-tkach avatar alexreg avatar mina86 avatar dgrnbrg avatar zaidoon1 avatar zhangjinpeng87 avatar derekdreery avatar methyl avatar romanz avatar valeriansaliou avatar andreyg avatar ordian avatar pavel-mukhanov avatar garyttierney avatar rrichardson avatar siddontang avatar rnarubin avatar akrylysov avatar xxuejie avatar vmx avatar calavera avatar busyjay avatar linxgnu avatar rohitjoshi avatar

Watchers

 avatar

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.