🐈
zeeSQL
  • zeeSQL, SQL and search by value for Redis. Fast, Simple and Reliable.
  • How to
    • How to choose between QUERY and EXEC
    • know-what-secondary-indexes-are defined
    • How to load zeeSQL in Redis
    • How to check if an index is used in zeeSQL and SQLite
    • know-what-secondary-indexes-are defined
    • create-an-index
    • create-a-view
    • create-a-secondary-index
    • How to create a trigger
    • quickly-ingest-data
    • How to copy a database
    • get-help
    • work-with-dates
    • using-full-text-search
    • work-with-json
    • How to create a new database in zeeSQL
    • How to create a new table in zeeSQL
    • know-what-tables-are-defined
    • know-what-databases-are-defined
    • works-with-boolean
    • How to get zeeSQL
    • How to get JSON output
    • add-multiple-rows
  • blog
    • node
      • Using RediSQL with Node.js
    • JSON on Redis via RediSQL, SQL steroids for Redis
    • golang
      • Using RediSQL with Go(lang)
    • Doubling the performances of RediSQL, SQL steroids for Redis.
    • zeeSQL now runs on SQLite 3.35
    • Query Redis on two attributes
    • RediSQL for analytics
    • Copying RediSQL databases
    • Release 0.9.0 of RediSQL, SQL steroids for Redis
    • Release 0.8.0 of RediSQL, SQL steroids for Redis
    • Release 0.7.0 of RediSQL, SQL steroids for Redis
    • JSON on Redis via RediSQL, SQL steroids for Redis
    • Release 0.6.0 of RediSQL, SQL steroids for Redis
    • python
      • using-redisql-with-python
    • Release 0.5.0 of RediSQL, SQL steroids for Redis
  • References
  • zeeSQL commits to backward compatibility
  • zeeSQL, a solid product for busy developer
  • zeeSQL and secondary indexes, how to search Redis key by value
  • Tutorial
  • Pricing for zeeSQL
  • Why you should migrate from RediSQL to zeeSQL
  • FAQs
  • Motivation
Powered by GitBook
On this page
  • Common answer and mistake quickly solved
  • ERR - Error the key is empty
  • READONLY You can't write against a read only replica.

Was this helpful?

FAQs

Common answer and mistake quickly solved

ERR - Error the key is empty

You try to execute a command against a database like

REDISQL.EXEC DB-EXAMPLE "SELECT 1;"

and RediSQL returns the error: ERR - Error the key is empty.

Most likely the dabatase DB-EXAMPLE does not exists. To fix the problem you can simply create first the database with

REDISQL.CREATE_DB DB-EXAMPLE

During development is quite convenient to just delete everything from RediSQL, so it may happens that you encounter this error. A possible solution is to always invoke the REDISQL.CREATE_DB command, if the database is not there, it will be created, if the database is already there an error will be raise. As long as you are in a development environment just ignore the error.

READONLY You can't write against a read only replica.

Redis and RediSQL supports replication. You can have the same database in different redis instance, on different processes and potentially on different machine. This means that you can read data from different instances in parallel, greatly improving reading performances. However you cannot write in parallel to different instances, otherwise we wouldn't know what data is "real". You can write only to the master instance.

By policy the REDISQL.EXEC command allow you to read and write and (due to Redis limitation) you cannot use this command on replicas. The REDISQL.EXEC command works only on the master node. This is true even if the query that you are trying to execute is an very simple read only query like SELECT 1;, you cannot REDISQL.EXEC against a replica node.

In order to read from the replicas, you can use the REDISQL.QUERY family of commands. This command is allowed to only read data, without modifying the database, hence you can use it also in the replica instances. Moreover it is a good idea to use it also against the master instance whenever is possible.

If you try to execute the REDISQL.EXEC command against a replica you will get the error READONLY You can't write against a read only replica. To query the replicas use the REDISQL.QUERY command.

PreviousWhy you should migrate from RediSQL to zeeSQLNextMotivation

Last updated 4 years ago

Was this helpful?