Giter VIP home page Giter VIP logo

forging2012 / swapdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jingchengli/swapdb

0.0 3.0 0.0 24.55 MB

https://github.com/JingchengLi/swapdb/wiki

License: BSD 2-Clause "Simplified" License

CMake 0.32% Makefile 0.81% C 40.36% C++ 30.84% Shell 0.73% Perl 1.25% M4 0.58% XSLT 0.09% HTML 2.91% Roff 0.21% CSS 0.02% Batchfile 0.01% Lua 0.08% Objective-C 0.17% Ruby 0.54% Tcl 11.83% Python 8.87% Smarty 0.01% COBOL 0.26% GAP 0.11%

swapdb's Introduction

swapdb

A redis compatiable storage which support data exchange between memory and disk, so you can save a lot of memory cost by using swapdb compared to redis. the main thought of swapdb is, keep hot keys in redis and cold keys in disk, when a key in disk becomes hot, will load it to redis, when a key in memory becomes cold, will transfter it to disk. by using swapdb, you can have both a high preformance cache and high capacity KV storage.

Documentation

中文文档

Fundamental

fundamental

Features

  • Heat statistics of keys(LFU)
  • Configurable threshold of RAM/FLASH capacity
  • Redis API compatiable(99%). supports data structures such as strings, hashes, lists, sets, sorted sets
  • Cluster management(redis cluster)
  • Multiple replica nodes and data replication support(RDB+Snapshot)
  • Data persistency support
  • High performance and high capacity redis-like storage

Compile

requirements:

CMake >= 3.1
GCC >= 4.8

Get the source code

git clone https://github.com/JRHZRD/swapdb.git --recursive

Let's build

(you can skip this step if you add '--recursive' option when 'git clone'.) for submodules update process.

git submodule update --init --recursive
cmake . && make -j8

Quick start

you can quickly start a swap-redis and swap-ssdb instance like this:

cd utils
# this will use the default "6379" port for swap-redis and "26379" port for swap-ssdb.
./deploy_redis.sh
# or you can specify a specific port like this, for example, use "6380" port
# ./deploy_redis.sh 6380

redis-cli -p 6379
127.0.0.1:6379> set a b
OK
127.0.0.1:6379> locatekey a
"redis"
127.0.0.1:6379> storetossdb a
OK
127.0.0.1:6379> locatekey a
"ssdb"
127.0.0.1:6379> get a
"b"
127.0.0.1:6379> dumpfromssdb a
OK
127.0.0.1:6379> locatekey a
"redis"

Applicable scenes

  • cache

swapdb support LFU based heat statistics, hot keys are kept in redis,so you can use swapdb as cache, which has the same performance as redis when access hot keys.

  • High capacity redis-like KV storage

By configuring a low threshold of RAM/FLASH capacity, most of the data will be stored in disk and only the hottest data stored in redis.

swapdb's People

Contributors

amallia avatar andyli029 avatar antirez avatar badboy avatar cbgbt avatar concreted avatar dvirsky avatar githubmota avatar guybe7 avatar itamarhaber avatar jingchengli avatar jrhzrd avatar jstncarvalho avatar lorneli avatar luoming1224 avatar miterv1 avatar oranagra avatar peter-xu-zhou avatar quchen88 avatar sgn1 avatar sitano avatar spinlock avatar timothyzhang023 avatar viennadd avatar whatacold avatar yossigo avatar zhukovalexander avatar zintrepid avatar

Watchers

 avatar  avatar  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.