All Projects → oun111 → Myproxy

oun111 / Myproxy

Licence: gpl-2.0
A sharding proxy for MYSQL databases

Projects that are alternatives of or similar to Myproxy

Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+726.14%)
Mutual labels:  sql, database, mysql
Laravel Db Profiler
Database Profiler for Laravel Web and Console Applications.
Stars: ✭ 141 (-7.84%)
Mutual labels:  sql, database, mysql
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+728.1%)
Mutual labels:  sql, database, mysql
Directus Docker
Directus 6 Docker — Legacy Container [EOL]
Stars: ✭ 68 (-55.56%)
Mutual labels:  sql, database, mysql
Db Tutorial
💾 db-tutorial 是一个数据库教程。
Stars: ✭ 128 (-16.34%)
Mutual labels:  sql, database, mysql
Ebean
Ebean ORM
Stars: ✭ 1,172 (+666.01%)
Mutual labels:  sql, database, mysql
Node Mysql Utilities
Query builder for node-mysql with introspection, etc.
Stars: ✭ 98 (-35.95%)
Mutual labels:  sql, database, mysql
Mysqldump Php
PHP version of mysqldump cli that comes with MySQL
Stars: ✭ 975 (+537.25%)
Mutual labels:  sql, database, mysql
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-16.99%)
Mutual labels:  sql, database, mysql
Mysql Container
MySQL 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: ✭ 117 (-23.53%)
Mutual labels:  sql, database, mysql
Event Management
helps to register an users for on events conducted in college fests with simple logic with secured way
Stars: ✭ 65 (-57.52%)
Mutual labels:  sql, database, mysql
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+1279.74%)
Mutual labels:  sql, database, mysql
Dolt
Dolt – It's Git for Data
Stars: ✭ 9,880 (+6357.52%)
Mutual labels:  sql, database, mysql
Laravel Log To Db
Custom Laravel and Lumen 5.6+ Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel/Monolog native logging functionality.
Stars: ✭ 76 (-50.33%)
Mutual labels:  sql, database, mysql
Goqu
SQL builder and query library for golang
Stars: ✭ 984 (+543.14%)
Mutual labels:  sql, database, mysql
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (-39.87%)
Mutual labels:  sql, database, mysql
Eralchemy
Entity Relation Diagrams generation tool
Stars: ✭ 767 (+401.31%)
Mutual labels:  sql, database, mysql
Reiner
萊納 - A MySQL wrapper which might be better than the ORMs and written in Golang
Stars: ✭ 19 (-87.58%)
Mutual labels:  sql, database, mysql
Alpine Mariadb
MariaDB running on Alpine Linux [Docker]
Stars: ✭ 117 (-23.53%)
Mutual labels:  sql, database, mysql
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+1280.39%)
Mutual labels:  sql, database, mysql

What is MYPROXY

  • A proxy application that provides:
    1. management on backend MYSQL databse tables
    2. shardings on these tables
    3. SQL proxy abilities
  • User may access backend tables through myproxy by normal MYSQL client tools

Features

  • supports native MYSQL server/client communication protocols v4.1
  • supports 10k+ clients concurrency
  • supports dynamic scalability of MYSQL databases
  • supports the commonly used SQLs
  • supports SQL proxy functionalities, for example, ORACLE SQL -> MYSQL SQL
  • supports 2 sharding modes: horizontal and vertical

Structure

Alt text

Here the diagram consist of 3 parts:

  • MYSQL clients: sending requests and fetching datas from myproxy
  • MYPROXY:
    1. accepting and processing client requests
    2. forwarding and routing them to backend MYSQL servers
    3. fetching responses from backend and forwarding them to clients
  • MYSQL servers: storing real datas and processing requests from myproxy

Process Flow

Case A:

Alt text

In this case, the client A sends "local" commands that need not to be processed at backend, such as login, show XXX, desc XXX, use XXX etc, myproxy executes them and returns to client immediately.

Case B:

Alt text

  • In this case, client B sends a "query mode" request, task 1 in myproxy will do:

    1. parsing the SQL into syntax tree
    2. hooking to modify the tree
    3. fetching route informations
    4. calculating routes
    5. forwarding request to every destination MYSQL server(s)
  • on the other hand, the task 2 or(and) task X will do:

    1. reading the response stream from MYSQL server(s)
    2. assabling streams into MYSQL response packets
    3. if there're more than 1 MYSQL server(s), caching responses
  • at last, task X+1 will merge responses in cache and returning to client

Case C:

Alt text

  • In this case, client C sends a "prepare" request in "prepare" mode , task 1 in myproxy will do:

    1. parsing the SQL into syntax tree
    2. hooking to modify the tree
    3. collecting routing informations
    4. forwarding request to all MYSQL server(s) at backend
  • on the other hand, the task 2 or(and) task X will do:

    1. reading the response stream from MYSQL server(s)
    2. assabling streams into MYSQL response packets
  • at last, task X+1 will filter the responses and returning to client

Case D:

Alt text

  • In this case, client C sends a "execute" request in "prepare" mode, task 1 in myproxy will do:

    1. calculating routes by infos from Case C
    2. forwarding request to every destination MYSQL server(s)
  • on the other hand, the task 2 or(and) task X will do:

    1. reading the response stream from MYSQL server(s)
    2. assabling streams into MYSQL response packets
    3. if there're more than 1 MYSQL server(s), caching responses
  • at last, task X+1 will merge responses in cache and returning to client

Shardings

  • In my thought, sharding is how a database proxy organises table datas of real database at its backend. In myproxy, there're 2 kinds of shardings:
    1. Vertical sharding is the ability of managing lots of unique tables in different database servers, see diagram below:

Alt text

  • in this case, tables are located completely in a unique server, table A B C in server 0, and table D and E in server 1
  • while requesting for table B, myproxy will calculate and then route only to database 0, while for table D, the path is to database 1
  1. horizontal sharding is to manage tables that are scattered partially in many database servers, see diagram below:

Alt text

  • in this case, table A is scattered into 3 parts and locates in 3 servers
  • while requesting for table A, myproxy will route to these 3 servers respectively for all parts of data

Dynamic Scalability

The Dynamic Scalability for myproxy is that table(s) may be added into or be removed from backend without restarting myproxy which will update its backend informations by modifying configure file and sending a SIGUSER2 by the admin manually, see diagram below:

Alt text

  • in case 1, table A is added into backend DB 0, in order to notify myproxy the admin may add table A's settings into config file and send a SIGUSER2 to it
  • in case 2, table B is removed from backend DB 1, the admin should update the config file's settings and send a SIGUSER2 to force a backend information update in myproxy

SQL Proxy

In my thought, a SQL PROXY functionality is that myproxy will translate the SQL language which is stranged to the backend database from client to a backend-familiarity-form, for example, the client requests for 'select nvl(col0) from table1' in ORACLE syntax, then myproxy will translate it to MYSQL syntax like 'select ifnull(col0,0) from table1' and pass to backend databases, see diagram below:

Alt text

myproxy employs ZAS 's SQL syntax engine to implement this functionnality and provides 30+ 'ORACLE to MYSQL' translations.

The Cache Modules

  • In myproxy, there're 2 scenarios of key-value storage:
    1. the key - response packet pairs from multiple backends should be firstly stored in cache before sending to client
    2. the values in global column - value pairs from incoming SQL should be increse by 1 and stored persistently for the next fetch
  • To implement the cache functionality, some open source caches are employed , such as bdb, leveldb, unqlite, sqlite, multimap of stdc++ library, and a wrapper module named dbwrapper that provides simple consistent and abstract interface is used to help managing these various caches, see diagram below:

Alt text

The dbwrapper chooses which cache module to use depending on configurations.

HOWTO

  • To compile myproxy, do the following steps:

    1. build ZAS
    2. build external cache module like bdb, leveldb
    3. build myproxy with linkage to ZAS and cache modules
  • To access myproxy, just use any MYSQL client applications with the correct address and port like this:

Alt text

enjoy!

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