5 ms·
Author here, if you have any question please feel free to ask. Also I have introduced the module in a blog post here: http://redbeardlab.tech/2016/12/13/redisq
by siscia 10y ago
Author here, if you have any question please feel free to ask.
Also I have introduced the module in a blog post here: http://redbeardlab.tech/2016/12/13/redisql http://redbeardlab.tech/2016/12/13/redisql
- mozumder 10y agoCan I use this to atomically delete thousands of existing keys? Is there a way to map the new SQL tables to existing keys? Or is this strictly for new SQL data tables?
- dom0 10y agoThis is a SQLite in-memory database running inside the redis service. It doesn't interface with the redis database.
- siscia 10y agoAs the other question, for now I am simply using Redis as support for SQLite. 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.
- aalekhN 10y agoHave you thought of ways to implement queries involving LIKE operations ? I worked on a similar project some time ago and one of the limitation for such implementation I encountered was use of glob-style patterns in redis.
- siscia 10y agoDidn't quite get your question. 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"
- alfanick 10y agoThis is just a bridge to in-memory sqlite accessible from redis connection – it does not emulate sql for redis data - both databases are completely independent, unfortunately.
- siscia 10y agoWhy you say unfortunately? 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.
- aalekhN 10y agoAh, I was under impression that it emulates SQL nature for redis data (kind of like an extension to InnoDB Memcache architecture). Anyways nice work @siscia, thanks for sharing !!
- camtarn 10y agoThis paragraph is what I needed to see in the project readme. Thanks.
- deleted 10y ago[deleted]
- gtrubetskoy 10y agoThat's not hard to do, I did that in Thredis: 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"
- pizza234 10y agoWhich would be a use case, from a technical perspective? 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.
- siscia 10y agoSQLite gives you a lot of simplicity over client-server databases such as Postgres or MySQL. 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.
- edibleEnergy 10y agoWell, SQLite has to be accessed over a filesystem. This sounds like it would proxy to a sqlite db located on the Redis server. Still sounds dicey but I could see the appeal if you didn't have the DBA skills necessary to set up a decent PostgreSQL or other SQL server.
- pizza234 10y agoWell, although the requirements which would lead to such setup are clearer now, it's still smelly to me. 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.