>_ IzzyLab

Topic breakdown

KEYS pattern returns all matching keys in a single operation and blocks the server — dangerous on large databases. SCAN walks the keyspace incrementally with a cursor, returning keys in batches without blocking other commands; in redis-cli this is available as --scan --pattern. The keys you get are deleted with DEL (or UNLINK, asynchronously). This pattern (scan + deleting in batches) is the standard for safely bulk-clearing a cache by prefix.

What's checked

  1. cache:* keys deleted
  2. other keys are in place
  3. keys found with a SCAN traversal, without KEYS

What it looks like