by siscia · 9y ago · 0 comments
Also I have introduced the module in a blog post here: http://redbeardlab.tech/2016/12/13/redisql
The blog mentions:
If you are writing microservices to avoid bothering the master of DB with your need ephemeral needs of structured database
and I see this module perfect for small dataset of unimportant data.
In other words, why would one use this module in place of a straight SQLite database (possibly in-memory, if there is really such need for speed)? Such module doesn't simplify anything (as far as I understand), since SQL is used anyway.I would understand this as an experiment (something like "ReDoom"), but since there will be a paid version, I'm trying to position the product technology.
A straight SQLite database doesn't quite give to you the same kind of possibility, imagine you have multiple machine that want to access the data.
It is a middle ground between "full" SQL databases and simpler solution.
It does use Redis for the client-server communication which gives reliability and is already well know in most companies.
My suggestion to use it for small, unimportant data is because there is still not persistency on disk, I am working on it right now.
Under this conditions there is still a false dichotomy between RediSQL on one side, and "complex RDBMS" on the other.
What about simple RDMSs like H2? Such solution would meet the requirements:
- network-accessible RDBMS
- no configuration
The only requirement I can think of which would make this solution inadequate would be "No JVM on the system", which sound quite far-fetched.SQLite does implement the LIKE operator.
From the module:
127.0.0.1:6379> REDISQL.EXEC "CREATE TABLE text_search(t TEXT);"
OK
127.0.0.1:6379> REDISQL.EXEC "INSERT INTO text_search VALUES('hello');"
OK
127.0.0.1:6379> REDISQL.EXEC "INSERT INTO text_search VALUES('banana');"
OK
127.0.0.1:6379> REDISQL.EXEC "INSERT INTO text_search VALUES('apple');"
OK
127.0.0.1:6379>
127.0.0.1:6379> REDISQL.EXEC "SELECT * FROM text_search WHERE t LIKE 'h_llo';"
1) 1) "hello"
127.0.0.1:6379> REDISQL.EXEC "SELECT * FROM text_search WHERE t LIKE '%anana';"
1) 1) "banana"
127.0.0.1:6379> REDISQL.EXEC "INSERT INTO text_search VALUES('anana');"
OK
127.0.0.1:6379> REDISQL.EXEC "SELECT * FROM text_search;"
1) 1) "hello"
2) 1) "banana"
3) 1) "apple"
4) 1) "anana"
127.0.0.1:6379> REDISQL.EXEC "SELECT * FROM text_search WHERE t LIKE 'a%';"
1) 1) "apple"
2) 1) "anana" redis 127.0.0.1:6379> set foo bar
OK
redis 127.0.0.1:6379> sql "select * from foo"
1) 1) "key"
2) "val"
2) 1) "1"
2) "bar"What are your uses cases?
It is possible to have in SQLite the keys from redis, however it does require a level of complexity that must be justified.
You are talking about something definitely feasible but that require a really carefully implementation.
For now, it is strictly for new SQL data tables.
However I must say that put all your keys inside the SQL table is not difficult.