Live data from Hacker News

RediSQL – A Redis module that provides a functional SQL database

github.com

11–20 of 60 posts

Re: RediSQL – A Redis module that provides a functional SQL database

#12
post #8
post #3

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

Can 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?

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

Re: RediSQL – A Redis module that provides a functional SQL database

#13

It's a cute project, I remember you posted it before. I remember somebody else had a go at this a few years back https://groups.google.com/forum/#!topic/redis-db/TLfwGfldgUU

It is a little different from Threadis since, in my understanding, threadis is more a redis fork. While rediSQL is a redis module.

Using a redis module get you A LOT of thing from free and you really stand on the shoulder of giants.

Re: RediSQL – A Redis module that provides a functional SQL database

#14
post #6
post #5

Where does it save the data? Just in a blob in Redis? Does it support replication? How about persistence - - can I use standard Redis persistence? I'm kinda new to modules in Redis. Definitely could use this for migration off SQLite to a solid DB.

Just update the readme. For now it works in memory, after Saturday it will save data in a standard SQLite file. Replication and SQL are fairly tricky beast together. What is your use case?

Can rqlite [1] be helpful here?

[1] http://www.philipotoole.com/replicating-sqlite-using-raft-co...

Re: RediSQL – A Redis module that provides a functional SQL database

#15
post #3

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

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

Re: RediSQL – A Redis module that provides a functional SQL database

#16
post #14
post #6

Earlier quoted context omitted.

Just update the readme. For now it works in memory, after Saturday it will save data in a standard SQLite file. Replication and SQL are fairly tricky beast together. What is your use case?

Can rqlite [1] be helpful here? [1] http://www.philipotoole.com/replicating-sqlite-using-raft-co...

It may. The real question in my opinion is: What kind of replication we need?

We want to replicate just to being sure that the data is safe? Then really you could simply stream to all the replicas what happens to the master.

You want to increase read performance? Then you first start caching result, then you start stream to slave and only make read from them.

You want to increase write performace? That is quite a bad beast. You start by making the single instance as fast as possible (96k insert per second [1]) then you pretty much hit the ceiling in my opinion.

You could partition the SQL tables, but then what happens to joins and select? They must go over the network (high latency), spot distributed deadlock (highly variable latency) and it start to become an huge complex project.

[1]: http://stackoverflow.com/questions/1711631/improve-insert-pe...

Re: RediSQL – A Redis module that provides a functional SQL database

#17
post #15
post #3

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

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

Didn'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"

Re: RediSQL – A Redis module that provides a functional SQL database

#18
post #15
post #3

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

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

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

Re: RediSQL – A Redis module that provides a functional SQL database

#19
post #15

Earlier quoted context omitted.

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

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

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

Re: RediSQL – A Redis module that provides a functional SQL database

#20
post #15

Earlier quoted context omitted.

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

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

Ah, 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 !!
Post reply on HN