Skip to content

2023-07-01

Compare
Choose a tag to compare
@jaredwray jaredwray released this 01 Jul 19:37
· 317 commits to main since this release

Redis v2.7.0 with useRedisSets Option

The useRedisSets option lets you decide whether to use Redis sets for key management. By default, this option is set to true.

When useRedisSets is enabled (true):

  • A namespace for the Redis sets is created, and all created keys are added to this. This allows for group management of keys.
  • When a key is deleted, it's removed not only from the main storage but also from the Redis set.
  • When clearing all keys (using the clear function), all keys in the Redis set are looked up for deletion. The set itself is also deleted.

Note: In high-performance scenarios, enabling useRedisSets might lead to memory leaks. If you're running a high-performance application or service, it is recommended to set useRedisSets to false.

If you decide to set useRedisSets as false, keys will be handled individually and Redis sets won't be utilized.

However, please note that setting useRedisSets to false could lead to performance issues in production when using the clear function, as it will need to iterate over all keys to delete them.

Example

Here's how you can use the useRedisSets option:

const Keyv = require('keyv');

const keyv = new Keyv('redis://user:pass@localhost:6379', { useRedisSets: false });

What's Changed

  • add useRedisSets option by @christianllv in #855
  • add iterator on etcd adapter by @christianllv in #857
  • memcache - upgrading typescript to 5.1.6 by @jaredwray in #859
  • test-suite - replacind delay module with helper for all packages by @jaredwray in #860
  • compress-gzip - upgrading eslint and @ava/typescript to latest by @jaredwray in #862
  • compress-brotli - upgrading c8 to 8.0.0 by @jaredwray in #863
  • compress-brotli - upgrading webpack to 5.88.1 by @jaredwray in #864

Full Changelog: 2023-06-26...2023-07-01