RedBeardLab / rediSQL

Redis module that provides a completely functional SQL database

Home Page:https://redisql.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add USING features to statement commands

siscia opened this issue · comments

This issues will hopefully serve

RediSQL is designed to use one thread for each database. This simplify a lot the design but it limits the throughput a lot.
There are several cases where multiple thread for a single database is welcome, mostly for read intensive workload.

Using multiple connection is possible, indeed we already have a function to create another connection and thread that point to the original connection.

Moreover, we showed, that is possible to have multiple connection acting on the same database with the REDISQL.EXEC command enhanced with the USING feature.

To recap, in RediSQL use REDISQL.CREATE_DB to create a new database and spawn a thread that act on this database.

REDISQL.CREATE_DB DB

(This create a connection to an in-memory database, and spawn a thread that manage such connection.)

I added a new command: REDISQL.ADD_CONNECTION that allow to create a new connection to the original database.

REDISQL.ADD_CONNECTION DB READ01

(This spawn a new thread, that holds a connection to the same database mentioned above.)

Also, the USING features was implemented.

REDISQL.EXEC DB "select 1;"

This one use the original connection associate with DB.

REDISQL.EXEC DB "select 2;" USING READ01

This use the new connection, just created with REDISQL.ADD_CONNECTION.

Now we would like to implement the USING features also for REDISQL.EXEC_STATEMENT, REDISQL.CREATE_STATEMENT, REDISQL.DELETE_STATEMENT and REDISQL.UPDATE_STATEMENT.

All the work was done in the remove_vtab branch: https://github.com/RedBeardLab/rediSQL/compare/remove_vtab