Redis & PostgreSQL Question

Hey everyone,

I probably have a stupid question, but I still hope someone can help me.

What is being saved in these databases? Could someone give me example for Redis and PostgreSQL?

Thanks in advance!

Hi There,

Redis is just the temporary application data, its cache memory for application.
In PostgreSQL, it store all device/user/organisation/network etc data used on the UI interface. Actual Device data is not saved there.

Regards
Jayesh

1 Like

It is temporary, but I would stop short of calling it just cache. OTAA keys are kept there, and if you toss the database, you will need all your devices to rejoin. See other threads on Redis persistence considerations.

1 Like

Redis is important for the hole server, it keeps every device’s session, if it restart, all device will lost their activation, and it is recommended to make snapshoot for redis while running, in case of failure and reboot.
For pg database, it do the persistent for such as devices,applications,gateways,xxx-profiles,and device queue.

1 Like

Please note that depending your Redis configuration, it takes snapshots either after X time or X operations (which comes first). On restart, it will recover the snapshot. When properly configured, you can restart Redis without problem :slight_smile:

3 Likes

hi @brocaar
where is the activation key stored ?

The NS stores it in Redis inside the DeviceSession object (Protobuf encoded). The AS stores it in the device table.

1 Like

hi @brocaar
how to backup all data that is docker?

Is it possible to cut the application server over to strictly using postgresql, no redis?