Redis Data Type | Navicat Data Editor

A key feature that distinguishes Redis from other key-value stores is that it supports multiple data types, including strings, lists, sets, sorted sets, and hashes. Greek (hash). This makes problem solving easier for developers, since they tend to know which data type to use for each job. This article will outline the six data types supported by Redis. Interested in trying Navicat for Redis? You can  download a fully functional trial version here  and try it out for 14 days.

String

Redis stores strings as sequences of bytes. Strings in Redis are binary safe, which means their length is fixed rather than determined by one or more special terminating characters. Therefore, a string can store up to 512 MB of data.

In  Navicat for Redis  , we can select "Edit" -> "Add Key" in the main menu to create a new key-value pair. This will add a new empty row in the data view and open the editor:

We can use the editor to set the following information:

  • key name
  • key type
  • value
  • TTL (time to live)

Clicking the "Apply" button will fill in a new row with the contents of the "Editor" form. It also shows the magnitude of the value:

Hash

In Redis, a hash is a collection of key-value pairs. As such, they are a good choice for representing objects and storing groups of counters, etc. Each hash can store up to 2^32 - 1 field-value pairs (over 4 billion!).

For hash values, Navicat editor has a table with "field" and "value" columns:

List

A Redis List is just a list of strings, sorted by the order they were added. You can add elements to the head or tail of a Redis list. The maximum length of a list is 2^32 - 1, or 4294967295 elements (each list can have over 4 billion elements!).

In Navicat editor, list values ​​are expressed as "elements". Clicking the ellipsis [...] button to the right of "Elements" will open a special editor where you can enter the complete list:

Set

Redis Set is an unordered collection of strings. Set is similar to list except that Set does not allow duplicates and insertion order is not preserved.

Sets can also be sorted. In an ordered set (Sorted Set), each member is associated with a score (score), and the ordered set is arranged in order of the score value from smallest to largest. While members are unique, scores can be repeated.

The way Navicat handles Set is very similar to the way it handles List. Here is an example:

In the "Key Type" drop-down list, "zset" is an ordered set:

Stream

The Redis stream data type was introduced in Redis 5.0. Stream emulates a log data structure, but also implements multiple operations to overcome some of the limitations of typical append-only logs.

Yes, Navicat for Redis supports Stream data type!

Conclusion on Redis data types

This article provides an overview of the six data types supported by Redis, including the new Stream type. Interested in trying Navicat for Redis? You can   download a fully functional trial version here and try it out for 14 days.

Redis related technical articles

Technical dry goods | Start using Redis

Navicat for Redis Function Introduction

Navicat for Redis and Navicat Premium 16.2 are now officially released | Unleash the full potential of Redis

Navicat for Redis Feature List

Past review 

  1. Navicat now officially supports Redis
  2. Recruit Navicat Monitor 3.0 monitoring tool experience officer |
  3. Nanny level tutorial | Navicat manual backup and automatic backup
  4. Navicat 16 officially supports OceanBase full-line database products
  5. Try Navicat 16 for free
  6. Navicat's 20-year development history | Founded in Hong Kong, China in 1999
  7. The role of WHERE 1=1 in the SQL statement
  8. Calculate percentage of total rows in SQL
  9. The interactive gift event is in progress | The prize is Navicat Premium worth 819 yuan
  10. Fake websites cause multiple security risks | Official solemn statement: Do not buy or download Navicat software from unofficial channels

Guess you like

Origin blog.csdn.net/weixin_53935287/article/details/131457516