All Projects → yuanwhy → Simple Sharding

yuanwhy / Simple Sharding

☕️ A simple database shard middleware

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Simple Sharding

Blocker Database
A global domain based database for NoScript, uBlock, uMatrix & ScriptSafe
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Postgresql Container
PostgreSQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+1500%)
Mutual labels:  database
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Async Redis
First class async & promise support for redis.
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Couchdb Documentation
Apache CouchDB Documentation
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Online Shopping System Advanced
Demo site
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Ardb
A redis protocol compatible nosql, it support multiple storage engines as backend like Google's LevelDB, Facebook's RocksDB, OpenLDAP's LMDB, PerconaFT, WiredTiger, ForestDB.
Stars: ✭ 1,707 (+1193.18%)
Mutual labels:  database
Lealone
极具创新的面向微服务和 OLTP/OLAP 场景的单机与分布式关系数据库
Stars: ✭ 1,802 (+1265.15%)
Mutual labels:  database
Postgres Operator
Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
Stars: ✭ 2,166 (+1540.91%)
Mutual labels:  database
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Griffon Vm
Griffon Data Science Virtual Machine
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Meteor Peerdb
Reactive database layer with references, generators, triggers, migrations, etc.
Stars: ✭ 128 (-3.03%)
Mutual labels:  database
Base App
An app to help jumpstart a new Rails 4 app. Features Ruby 2.0, PostgreSQL, jQuery, RSpec, Cucumber, user and admin system built with Devise, Facebook login.
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Laravel Database Schedule
Manage your Laravel Task Scheduling in a friendly interface and save schedules to the database.
Stars: ✭ 94 (-28.79%)
Mutual labels:  database
Vue Pouch Db
Vue Pouch DB is a VueJS Plugin that binds PouchDB with Vue and keeps a synchronised state with the database. Has support for Mango queries which are processed locally within the VuePouchDB state.
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Lmdb Go
Bindings for the LMDB C library
Stars: ✭ 127 (-3.79%)
Mutual labels:  database
Sqlbuilder
A powerful, fast, cross-platform SQL Builder for PHP. Convert your structured data into SQL queries with a fluent style interface and targeting on all the mainstream database (MySQL, PostgreSQL, SQLite)
Stars: ✭ 131 (-0.76%)
Mutual labels:  database
Reddit Detective
Play detective on Reddit: Discover political disinformation campaigns, secret influencers and more
Stars: ✭ 129 (-2.27%)
Mutual labels:  database
Frapper
ASP.NET Core 3.1 Beginners project template with complete Custom User Management and lot's of other useful Features Which Helps you for Rapid Application Development.
Stars: ✭ 129 (-2.27%)
Mutual labels:  database

Simple-Sharding

Build Status Join the chat at https://gitter.im/yuanwhy/simple-sharding License

A simple database shard middleware, based on JDBC API. Applications can scale database by using new DataSource with simple-sharding. This project is not finished, and feel free to study.

Features

  • Transaction in single database shard
  • Sharding
  • Rewriting rules

Quick Start

1. Get source code

git clone https://github.com/yuanwhy/simple-sharding.git

and then execute test/create_schema.sql to init data.

2. Install simple-sharding to you local repository by

mvn clean install

3. Add artifact dependency

<dependency>
  <groupId>com.yuanwhy</groupId>
  <artifactId>simple-sharding</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

4. Set logic datasource and physic datasources

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:simple-sharding="http://yuanwhy.com/schema/simple-sharding"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd http://yuanwhy.com/schema/simple-sharding http://yuanwhy.com/schema/simple-sharding.xsd">

    <simple-sharding:hashShardingRule id="hashShardingRule" dbCount="2" tableCount="2" fieldNameForDb="role"
                                      fieldNameForTable="id"/>

    <simple-sharding:logicDataSource id="dataSource"
                                     name="passport"
                                     shardingRule="hashShardingRule">
        <simple-sharding:physicalDataSource name="passport_0" jdbcUrl="jdbc:mysql://127.0.0.1:3306/passport_0"
                                            user="root" password=""/>
        <simple-sharding:physicalDataSource name="passport_1" jdbcUrl="jdbc:mysql://127.0.0.1:3306/passport_0"
                                            user="root" password=""/>
    </simple-sharding:logicDataSource>


</beans>

5. Feel free to use JDBC API or ORM framework (e.g. MyBatis ) to execute your SQL

Document

Simple-Sharding 中文

References

Todo

  • [x] Support Spring custom namespace
  • [ ] Finish other methods
  • [ ] Support multiple tables in one datasource

License

Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].