Question to REDIS database (CloudDB) experts

Hello experts,

I have installed my own Redis database on my RaspberryPi and connected the database via the CloudDb component.
It works great! :slight_smile:
@TIMAI2 Thanks

My questions:

  1. A Redis instance has 16 databases (0-15)
    With the settings "Server" and "Port" of the CloudDB component I always end up on database 0. In some publications I have seen that you can specify the database using the port: e.g. 6379/2.
    But I cannot specify this in the CloudDB component.

Is there a way for AI2 to access the various databases of a Redis instance?

  1. Redis offers the key type: Sorted sets
    I understood that Redis automatically sorts the lists (players / points) here. You can use this as a great key for high scores?

Is there a way for AI2 to use this key type?

  1. There is also the List key type.

What is the difference if I save a list as a Value or use the KeyType List?

Can I even use the key type list via AI2?

The cloudDB component and blocks is really only setup to handle key:value pairs.

To use the advanced features of redis you would need to develop your own "front end" on your raspberry pi such as phpredis, although there are many....https://redis.io/clients, and then interact using the web component or webviewer.

1 Like

Thank you,
that with phpredis sounds interesting, but it is probably a size too big for me :frowning:

But: next weekend I want to install Wordpress on the Raspberry Pi, PHP and MariaDB are included?
So it's going in this direction :slight_smile:

Are there perhaps already examples of how one can access php (Redis) components or web viewers interacting with the web?

With: $ redis-> swapdb (0, 1); / * Swaps DB 0 with DB 1 atomically * /
Should I then be able to change the database :slight_smile:

High art

I have not used phpRedis, therefore cannot advise on how it works. From what i see, it does appear possible to utilise all the redis goodies e.g. SET and LISTS, and to be able to change databases.

Suggest you give it a try, and follow the extensive documentation provided.

Thank you very much, I will do that.

How can AI2 access phpRedis? How do I call phpRedis from AI2 or how do I transfer the data from AI2 to phpRedis?

You will need to use the web component to send php requests

Yes you said that :slight_smile:
Do you have an example of how I can use the component?
How do I go to the server and so on?

Thank you for your help!

Something like this:

image

2 Likes

Should I close this topic, now that you are also asking on Kodular ?

Hi TIMAI2. I am using the Taifun Background Location paid extension. But I would like to know if you can help me to find a method to save the coordinates in CloudDB please.


using the web component, for details see also [PAID] 📍 Location Service Extension - #140 by Taifun

Taifun

Will that help me to be able to run in the background?

My method uses the web component, and Taifun suggests to use the web component. Actual answer is I do not know, I do not believe anyone has tried this yet....

The first step is to use the web component and get it running in the foreground

The second step then is to use the locationservice extension and set up its background web functionality accordingly

Taifun

I'll try that, run the appropriate tests, and share the results to help someone else.

I want to create a GPS app that sends data in the background to locate our truck drivers from our construction company. They have to go to work in a very dangerous area and there are many vehicle thefts. We're not that interested in trucks, but our drivers are. I will follow your advice, thank you very much!