Are MySQL and Redis the same

What is redis The database presented

The name Redis stands for Remote Dictionary Server. This type of server turns out to be a fast data store. As a database management system (DBMS), Redis offers an in-memory database and a key value store at the same time.

  • In-memory database: With such databases, the DBMS saves all data directly in the main memory. This ensures very short access times - even with large, unstructured amounts of data.
  • Key-Value-Store: Key-value databases also impress with their high performance and can be easily scaled thanks to their simple structure. A key is created for each entry, which can then be used to call up the information again.

With a Redis server, all data is not on the hard drive, but in the main memory. By making this decision, Redis is both Cache as well as Storage: It makes no difference for Redis whether the information is permanently in the database or only for a short time.

Each entry in the database is given a key. Data can then be easily retrieved using these keys. So the entries are not linked to each other and therefore do not have to be requested across several tables. The information is available directly.

However, with storage in the main memory there is also the risk of losing all data in the event of a server crash. To prevent this from happening, Redis can either Duplicate all data regularly on the backup hard drive or save all commands required for a reconstruction in a log file.

The typical data structure from Redis are strings, i.e. simple strings of characters. The keys (one part of the key value store) are also implemented as strings. However, the system can also handle other data structures:

  • Strings: a string with a maximum size of 512 MB
  • Hashes: Entry with several fields
  • Lists: Collection of strings sorted according to the order in which they are entered
  • Sets: an unsorted collection of strings
  • Sorted sets: a user-sorted collection of strings
  • Bitmaps: Collection of bit-level operations
  • HyperLogLogs: Estimation based on unambiguous values
  • Streams: List of strings or complex key-value pairs

Because Redis Open source is, many developers are working on extensions for the DBMS. These modules extend the functionality of the otherwise very slim database and adapt the software for specific areas of application.