[Home](../README.md) | Prev: [Redis as the Spring cache](09-redis-as-cache.md) # 10. Production checklist Each line points at the chapter where the reason was demonstrated. Items marked *not run here* are general advice this repository does not exercise. **Serialization** - [ ] Keys go through `StringRedisSerializer`, in every template, in every service that shares the Redis ([chapters 2 and 3](03-string-template-and-two-keyspaces.md)). - [ ] Values are JSON with a serializer you chose, not the JDK default ([chapter 4](04-json-serializers.md)). - [ ] If you use the generic Jackson serializer, it has a `PolymorphicTypeValidator` allow-list, not `enableUnsafeDefaultTyping()` ([chapter 4](04-json-serializers.md)). - [ ] You are on `GenericJacksonJsonRedisSerializer` / `JacksonJsonRedisSerializer`, not the deprecated `Jackson2` classes ([chapter 4](04-json-serializers.md)). - [ ] Changing a serializer on a Redis that already has data has a migration or a new key prefix (*not run here*). **Expiry** - [ ] Every cache and session key has a TTL, and refreshes re-supply it ([chapter 8](08-ttl.md)). - [ ] `@RedisHash` entities with `timeToLive` either have keyspace events on or you accept the leftover index entries ([chapter 6](06-hash-ttl-and-keyspace-events.md)). - [ ] Nothing correctness-critical depends on receiving an expiry event ([chapters 6 and 7](07-pub-sub.md)). - [ ] With a custom `RedisCacheConfiguration`, the TTL is in the bean ([chapter 9](09-redis-as-cache.md)). **Messaging** - [ ] Pub/Sub is used only for messages you can afford to lose ([chapter 7](07-pub-sub.md)). **Operations** (*not run here*) - [ ] `KEYS *` is fine in these transcripts because the keyspace has a handful of keys. On a real server it is O(N) and blocks it; use `SCAN`. - [ ] Redis requires authentication and is not reachable from the internet. Anyone who can write to it can choose the class your generic serializer instantiates ([chapter 4](04-json-serializers.md)). - [ ] Connection and command timeouts are set deliberately, not left at defaults. - [ ] Do not point these tests at a production Redis: [LocalRedis](../src/test/java/com/ankurm/redis/LocalRedis.java) exists to stop that, because the tests call `FLUSHALL`. [Home](../README.md) | Prev: [Redis as the Spring cache](09-redis-as-cache.md)