redis Valid Keys


Redis keys are binary-safe, so literally anything can be used as a key. The only limitations are that they must be less than 512MB.

Examples of valid keys:

<div id="div64">

Any other string less than 512MB in size.
The raw binary content of an image or other binary file.
An entire multi-line text document.
An entire SQL query.
Any integer, hexadecimal, octal, or binary value.
Anything else you can think of less than 512MB in size. 

Invalid Redis keys:

Anything larger than 512MB.