Coder Social home page Coder Social logo

dbproxy's Introduction

DBProxy

##介绍 dbproxy是一个采用C++11编写的代理服务器,支持redisssdb数据库。 其主要用于扩容和提高系统负载。使用lua控制sharding,把不同的key-value映射到不同的后端redis或ssdb服务器。 ##构建 dbproxy支持windwos和linux。

  • windows:打开根目录的DBProxy.sln编译即可。
  • linux:
    • 1 : 在项目根目录执行 cd 3rdparty/luasrc/src/ 命令进入lua src目录,然后执行 make generic 构建liblua.so
    • 2 : 回到项目根目录执行 cp 3rdparty/luasrc/src/liblua.so .liblua.so拷贝到当前目录。
    • 3 : 继续在根目录下执行 make server 构建 dbserver 即可。

##配置文件 dbproxy的配置文件是Config.luaProxyConfigbackendskey配置后端服务器列表,其中的sharding_function指示sharding函数。 作为示例,test_sharding就是被指定的sharding函数,其根据key参数,返回对应的服务器号,这里返回0,意思是将key映射到127.0.0.1 : 6379这个服务器。

##补充 目前dbproxy只作为代理映射,不包含读写分离以及额外缓存,也不解决分布式等问题。 当然其服务器C++代码主体并不涉及任何sharding方案,必须由用户自己在Config.lua里自己实现sharding函数 (当然,也可以从网上找现成的,譬如lua版的一致性hash lua-consistent-hash)

##感谢 一定程度上借鉴了redis-shattercodis

dbproxy's People

Contributors

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