What is Sqlite?

Redis is a data structure server, Remote Data Server, It is an in-memory database cache for storing and retrieving data. It is open-source software with an active community.

All the databases store and retrieve the data from disk. The operation such as disk reading and writing is costly on a database. In the case of Redis, Data is read and stored in the memory cache and gives the best performance.

It is easy to read and write from a programming language with few lines of code.

Even though Redis is a memory cache server, It supports deploying in a single or cluster node architecture and provides horizontal and vertical scaling. Because of this, it is highly available.

Data also can be replicated across multiple nodes in big data architecture.

It supports different kinds of data such as String, Sets, Lists, SortedSet, Hashes, and Bitmaps

Redis use case application

For example, You are developing a multi-tenant HR sass application for the web.

In this application, Each tenant can hold details such as company name, security as well and company employee information.

Usually, store this company metadata as well as the employee in the database.

In the HR application,

multiple tenants log in to the application and do the below steps

  • Login to hr application with tenant user details, need to make SQL query for every operation to get tenant details
  • once the login is successful, the Application has the below operations
  • Show a list of employees for each tenant
  • He can add or modify employee data on the tenant.

For each employee processing, you need to SQL query to get tenant details. Two database calls need to be made for every operation.

To avoid this, Move the tenant details to the in-memory database and the employee to the database.

This reduces the loading time.