Databases

What is Redis

What it is

An ultra-fast data store that lives in the server's memory.

How we use it

For caching (so the main database isn't hit on every request) and task queues โ€” for example, sending messages in the background.

Where it helps a business

  • An employee was filling in a ticket in the bot, the bot restarted, and everything had to start over.
  • A website fetches the same data from the database every time and slows down.
  • Sign-in sessions need to be stored quickly and separately from the main database.

How we use it

  • Dialogues that survive a restart. In the IT help desk unfinished dialogues live in Redis rather than in the bot's memory, so a restart does not cut them off.
  • Cache and sessions. In the online store Redis 7 holds the cache and sessions, in a separate container next to the database.

Common problems

  • Without Redis, states are lost. In the birthday bot and the electronic queue dialogues live in memory and break off on restart; in ToshaMusic moving states to Redis is on the roadmap.

When you do not need it

A small bot with short dialogues and rare restarts does not need Redis: losing an unfinished dialogue costs nothing.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.