The release of the Redis 7.4 database management system, which belongs to the NoSQL class, has been announced. Redis provides features for storing data in a key/value format, enhanced by support for structured data formats such as lists, hashes, and sets, as well as the capability to execute server-side scripts in Lua. Unlike in-memory storage systems like Memcached, Redis stores the database not only in memory but also on disk, ensuring database persistence in case of a crash.
Redis 7.4 is announced as the first version released under new licensing terms — instead of the previously used BSD license, the code is now available under proprietary licenses RSALv2 (Redis Source Available License v2) and SSPLv1 (Server Side Public License v1). Those wishing to continue using the code under the BSD license can turn to projects like Valkey (a fork developed with the participation of Amazon, Google, Oracle, Ericsson, and Snap), Redict (a fork from the creator of the Sway shell and the Hare language), Garnet (a Microsoft database compatible with Redis), or KeyDB (a high-performance fork of Redis 5 from Snapchat).
The SSPL and RSAL licenses lead to discrimination against certain categories of users, which prevents them from being considered open or free. In terms of their goals, both licenses are similar, with the key difference being that the SSPL license is based on the copyleft AGPLv3 license, while the RSAL license is based on the permissive BSD license. The RSAL license allows for the use, modification, distribution, and integration of the code into applications, except when those applications are commercial or used to provide managed paid services. The SSPL license additionally includes a requirement for supplying not only the application's own code but also the source texts of all components involved in providing the cloud service under the same license.
The Redis DBMS supports transactions, allowing a group of commands to be executed in a single step, ensuring consistency and isolation (commands from other requests cannot interfere) of the execution of a given set of commands, and in case of issues, allowing for rollback of changes. All data is fully cached in memory. Client libraries are available for most popular languages, including Perl, Python, PHP, Java, Ruby, and Tcl.
Commands for managing data include increment/decrement, standard operations on lists and sets (union, intersection), renaming keys, multiple selections, and sorting functions. Two storage modes are supported: periodic data synchronization to disk and maintaining a change log on disk. In the second case, complete integrity of all changes is guaranteed. Master-slave data replication can be organized across multiple servers, carried out in a non-blocking mode. A publish/subscribe messaging mode is also available, which creates a channel where messages are spread to subscribed clients.
Key functionality changes in Redis 7.4:
- The ability to limit the lifespan of individual fields in hashes and structures for storing grouped collections of records in key-value format has been added. Unlike assigning a lifespan to a key, the proposed change allows for not only a total lifespan for all related fields but also individual lifespan values for specific fields. This can be used, for example, to ensure a shorter lifecycle for authentication tokens compared to other session data.
- New data types bfloat16 and float16 have been proposed, optimized for use in machine learning applications, allowing for reduced memory consumption compared to previously available types float32 and float64. When used in hashes, these new types enable a 47% reduction in memory usage in vector databases, a 59% decrease in data retrieval latencies, and a 58% reduction in index creation time compared to float64.
- The use of secondary indexes has been simplified. When querying information from secondary indexes, it is no longer necessary to escape specific special characters such as '@' and '.', and double quotes can be used to enclose data portions. Additionally, indexing of empty and missing fields has been significantly improved—new keyword INDEXMISSING and function ismissing() have been proposed for creating indexes and forming queries that consider the presence of fields. New operators INTERSECT and DISJOINT have been added to simplify the search for geospatial data. There are now capabilities for analyzing memory consumption by the index.
- Support for filters has been added to exclude items in added datasets. For example, when periodically loading sensor data into the database, a filter can be added to ignore values where the time difference from the previous value is below a certain threshold.
- Support for triggers and functions in JavaScript, proposed in the previous release, has been discontinued.
Source: opennet.ru
