What Are 5 Mistakes to Avoid When Using Redis?
Jim Dennis answering in detail this question on Quora:
Here are a few things I’d suggest thinking about when you are considering using Redis:
- Choose consistent ways to name and prefix your keys. Manage your namespace.
- Create a “registry” of key prefixes which maps each to your internal (perhaps wiki) documents for those application which “own” them.
- For every class of data you put into your Redis infrastructure: design, implement and test the mechanisms for garbage collection and/or data migration to archival storage.
- Design, implement and test a sharding (consistent hashing) library before you’ve invested much into your application deployment and ensure that you keep a registry of “shards” replicated on each server.
- Isolate all your K/V store and related operations into a your own library/API or service and absolutely enforce the use of that API/service with an unrelenting and mercilessly iron hand
My five:
- not knowing all data types and their corresponding operations supported by Redis and confusing it for a common key-value store
- not using smart keys (plus this and this)
- not having scripts to manage ranges of keys based on your naming strategy
- not using pipelines and MULTI/EXEC. On the other hand confusing Redis MULTI/EXEC/DISCARD with a relational database transactions
- not being aware of the MOM capabilities available in Redis (including both queues and PUB/SUB) and using something else to fake similar behavior.
What are your 5s?
Original title and link: What Are 5 Mistakes to Avoid When Using Redis? (©myNoSQL)