Redis
Sets Commands
Store unique collections with Redis sets. Learn set operations like union, intersection, and difference for tags, recommendations, and unique tracking.
8 commands
Pro Tips
Use SISMEMBER for O(1) membership checks - much faster than searching lists.
SINTER finds common elements between sets - great for finding shared interests/tags.
SRANDMEMBER returns random elements without removing - useful for random recommendations.
Common Mistakes
SMEMBERS returns all elements at once. Use SSCAN for large sets to avoid blocking.