Skip to content

Wire transparent compression into SET/GET path #28

Description

@mack42

Source: Audit finding P6

`src/compression.rs` is implemented but never invoked from any command handler — `compression_enabled` config flag is dead. The unused-allocation fix landed in 0.11.0 (`maybe_compress` no longer does `to_vec()`), but the feature itself is non-functional.

Decisions required:

  1. Storage shape: Does `RedisObject::String` store compressed bytes (transparent decompression on every read) or do we need a separate `String { data, compressed }` variant?
  2. STRLEN: Must return original (uncompressed) size — use `compression::original_size()`.
  3. APPEND/SETRANGE/GETRANGE: Either decompress-modify-recompress, or skip compression for keys ever touched by these.
  4. INCR/DECR: Numeric values are never compressed (below threshold).
  5. MGET/scan responses: Decompress before serialization.

Suggested first step: Add a benchmark with realistic payload sizes to verify the win is worth the read-path overhead before plumbing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions