Giter Club home page Giter Club logo

tribedb's Introduction

TribeDB - 分布式集群储存框架 - Node.js

TribeDB 是一个MySQL分表分库数据中间件,实现MySQL数据的分布式集群储存管理。在处理海量数据、高并发访问时,获得更加优越的性能及横向扩展能力。它包含以下主要特性:

  1. 可伸缩、高扩展的架构
  2. 自动路由分库,维护数据库连接池
  3. 支持数据表的“横向”和“纵向”分表
  4. 支持“一主多从”式读写分离
  5. 分布式并行处理,成倍提升性能
  6. 对应用层隐藏数据来源及技术细节

拥有以上特点意味着,可随时通过增加普通级别数据库服务器的方式,方便地扩展整体系统性能,而无需修改业务层架构和代码。理论上TribeDB的扩展能力上线在于主库单表插入性能和主从数据同步开销。通过合理设计“横向”和“纵向”分表和数据切分粒度,可轻松应对上亿级别的数据量和访问请求。

安装

推荐采用 NPM 方式安装。也可以 下载源码,但需要自己处理依赖。

$ npm install tribedb

#[email protected] node_modules\tribedb
#└── [email protected] ([email protected], [email protected], [email protected])

快速上手:

var tribe = require('tribedb')
  , Query = tribe.Query;
// 添加一个数据库配置
tribe.config.db('db1',{user:'root'});
// 直接执行sql
tribe.pool.query('SELECT 1+1 AS num', { db: 'db1' }, function(err, rows, fields){
  // 结果
});
//插入封装
new Query('post').data({title:'标题'}).insert(function(err, data){
  console.log(err);
  console.log(data);
});
//查询封装
new Query('post').where('title','标题').order_by('time','DESC').limit(1).select(function(err, data){
  console.log(err);
  console.log(data);
});
    

TribeDB通过全局唯一的表名,自动连接对应的数据库,并通过分表配置,将操作映射到涉及的分表,同时完成读写分离。 一切都由TribeDB自动完成,业务层不必关心数据的位置。当数据库负载过高需要添加服务器时,只需简单修改配置文件而不必修改业务代码,甚至将整个架构推倒重来。继续阅读本文档详细了解如何使用。

文档

阅读详细API文档了解如何使用TribeDB。中文文档地址:http://jojoin.github.io/TribeDB/

其它

@ TribeDB - 2015

作者:杨捷

Email:[email protected]

HomePage:http://jojoin.github.io/TribeDB/

Github:https://github.com/jojoin/TribeDB

tribedb's People

Contributors

jnduan avatar jojoin avatar

Watchers

 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.