HLL is actually stored as string, and it's easy to persist and restore for key-value pairs.
For your reference, HLL in Redis uses two presentations internally to store HLL objects:
- Sparse: For an HLL object whose length is less than hll-sparse-max-bytes (default: 3000) in configuration. Sparse representation is more space efficient, while it may cost more CPU in Redis.
- Dense: The default encoding when sparse encoding cannot be used per configuration.