Code Monkey home page Code Monkey logo

Comments (7)

mmmcorpsvit avatar mmmcorpsvit commented on June 2, 2024 1

i prepare code sample in closest time and share, very thanks for you help!)

from redisql.

siscia avatar siscia commented on June 2, 2024

Hi!

Sorry you are doing nothing wrong, the code in the performance benchmark is wrong and outdated, python was the bottle neck and not RediSQL. As well the docker images with runs the version 3.1 if I remember correctly.

So, how to test the performance of RediSQL? The best thing is to use the redis-benchmark tool that comes along any Redis server.

I am from mobile now and I can't check all the commands, however, after you get RediSQL run ( even on a docker instance) you can do something like this:

.\redis-cli REDISQL.CREATE_DB DB
.\redis-cli REDISQL.EXEC DB "create table foo(a int, b int)"
.\redis-benchmark REDISQL.EXEC DB "insert into foo values(1,2)"

Again, I am just writing this command from top of my head, hence they may be wrong, bit the general idea is correct.

I am not sure about your second question.
So RediSQL can store data both in memory or in a file.
If you create a database passing as argument a filename it will store the data in such file.

REDISQL.CREATE_DB DB /home/foo/test.sqlite

It will create a database that writes on the "home/foo/test.sqlite" file.

For what concerns extension, it really depends on what you mean here. I don't provide an interface to load a custom extension, however I embed the most common used provide by SQLite. In particular the JSON1 extension and the FTS extension are embedded along with few others.

I hope I answered your questions. Anyway everything is explained in more details on the documentation along with examples!

If you have more questions please let me know! Otherwise feel free to close the issue. (Or you can leave it open so it can serve as a reminder to eliminate the wrong benchmark code.)

Cheers,
Simone

from redisql.

mmmcorpsvit avatar mmmcorpsvit commented on June 2, 2024
  1. already fix error, this work code in Python 2/3, please add notes about deprecated tests code and about official Docker (Redisql work fine with Redis 5?)
r = redis.StrictRedis(host='192.168.99.100', port=32778, db=8)


def exdb(command):
    res = r.execute_command('REDISQL.EXEC', 'DB7', "%s;" % command)

r.set('1', 'data1')
r.set('3', 'data3')
r.set('7', 'data7')
r.set('1', 'data1')
r.set('0', 'data0')

exdb('CREATE TABLE foo(A INT, B TEXT)')
  1. are have any way to monitor REDISQL queries? Profiling? For example in Redis-server stdout (this will be fine for debug stage).
  2. Can you little explain about free version, about blocking. If i start read table in one thread, another thread where try write data to same table will be cause error/wait? In PRO version read/write can be do parallel?
  3. How i can use exp and ttl for record of table? Possible to insert record with expiry cycle? (very need feature in my case, please help with this question)
  4. Price of PRO version high, are have any plans do more editions? For startup price in 990 euro too high.
    For example:
    5.1 only 3 tables = free, in this case customer can fully test PRO version
    5.2 Extended version, where possible use any count of tables
    5.3 Premium version, where possible call from query redis data
    5.4 Ultimate version, where possible config redis to use how sqllite:memory or any compatible database driver (this can be interesting if wont just use some soft how EMS SQL Manager etc...), clustering, triggers, crosdatabase queryes etc... will be great when just add syntax highlight with intelligence from example PyCharm and just can work usual

In any way, many thanks for you great work!

from redisql.

siscia avatar siscia commented on June 2, 2024

Hi,

  1. For sure, I just need to find the time to do it! I am a little busy with work but it is definitely something I need to do.

  2. I am not sure what you mean here. It is possible to know what the RediSQL is doing at this moment? NO, not at the moment and I don't believe I will add such feature. There is a way to know what my query will do and how I can examinate it and make it faster? Yes of course, just execute a query explain.

  3. The free version does NOT provide blocking commands. A blocking command means that the Redis thread executes the query and, when the query ends, the control is given back to Redis that can make whatever other operation, but also popping from the event loop. You most likely do NOT want to use it. SQLite that is used as foundation for RediSQL does not provide parallel writes. So only one thread can write to a table in any given moment. I benchmark what happen if I use multithreading allowing more threads against using a simple event loop, so from one side we have threads from a thread pool that can access and read/write to the db, from the other side we have a queue of operation to do and a single thread that pop an operation from the queue and execute it against the DB. The single thread version was faster in all cases I tested. Hence, at the moment, for every database you create there is a single thread looping. If you do 3 times REDISQL.CREATE_DB ... there will be 4 threads in total, 3 from RediSQL and 1 from Redis itself. If you send two operation at the same time against the same database, one of them will wait. If you send two operation against two different databases each of them will work in parallel.

  4. EXP and TTL are not yet supported, but they are not very used in SQL anyway... A solution would be to just include a column with TTL and filter out all the row with expired TTL.

  5. The idea is to let small companies or startups enjoy a full product while leaving out few features that only big players needs. The important features in the PRO version in the replication one, honestly if you need the replication you already have a fleet of servers and you are sustain quite some load. At that point it make sense to pay money to avoid operational headaches and coding time. The rational behind the price structure is this one. And I believe it make sense.

5.n Syntax highlight should come almost for free, since the syntax is simple SQL. What you can do is to store all your queries in a file and highlight it as SQL. Which is a good idea anyway.

If you want to explain further your problem I can help with the architecture of your application. You can either do it publically (opening a new Issues will work) and I would really appreciate it so we can share insight we all the community, or you can send a personal email to myself.

from redisql.

mmmcorpsvit avatar mmmcorpsvit commented on June 2, 2024

th for wide answer, yet have questions:

  1. how can get datatype returned field? All data return how bytes for Python.
  2. how get version installed rediSQL module? After load redis dont write anything info about version
  3. try use rediSQL data in django admin part, this require QuerySet cast rediSQL data. Are any easy way to cast rediSQL to Django ORM Model with QuerySet? I try 2 days, but without successful( Maybe you have this sample? Please help with this part

p.s. sorry my poor English

from redisql.

siscia avatar siscia commented on June 2, 2024

Thanks for your feedback! Your questions are really useful!

I am a little busy right now but I will come back to you very soon answering all your question!

Very quickly, looking into the documentation of QuerySet it seems like the .query field contains the SQL generated for you. Is that not enough? Just get the SQL and pipe it into RediSQL...

Do you have some code where I can experiment? It would make me answering you much much faster.

from redisql.

siscia avatar siscia commented on June 2, 2024

I close for now!

from redisql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.