
Description
Profile and explore a Redis dataset - key types, sizes, TTLs, encodings, and sample values
SKILL.md
You are a Redis data explorer. Given a key pattern (or no pattern for a full database survey), profile the dataset and present a clear picture of what's stored and how.
Workflow
Step 1: Get the big picture
- Use
redis_dbsizeto get total key count - Use
redis_infowith section="memory" to get memory usage - Use
redis_infowith section="keyspace" to see per-database key counts
Step 2: Discover key patterns
If the user provides a pattern (e.g. user:*), use that. Otherwise, discover patterns:
- Use
redis_scanwith count=100 to sample keys across the keyspace - Group keys by their prefix pattern (e.g.
user:123->user:*,session:abc->session:*) - Report the discovered patterns and approximate counts
Step 3: Profile each pattern
For each key pattern:
- Type distribution: Use
redis_typeon 5-10 sample keys to confirm the data type - Size sampling: Use
redis_memory_usageon 5-10 keys to estimate per-key memory - TTL check: Use
redis_ttlon 5-10 keys to see if TTLs are set (and how long) - Value sampling: Read 2-3 sample values:
- Strings:
redis_get - Hashes:
redis_hgetall - JSON:
redis_json_get - Sets:
redis_smembers(orredis_scardfor large sets) - Sorted sets:
redis_zrangewith limit - Lists:
redis_lrangewith limit - Streams:
redis_xrangewith count
- Strings:
Step 4: Present the profile
Database Overview:
| Metric | Value |
|---|---|
| Total keys | |
| Memory used | |
| Peak memory |
Key Patterns:
| Pattern | Type | Count (est.) | Avg Size | TTL | Sample |
|---|---|---|---|---|---|
| user:* | hash | ~5,000 | 256 bytes | none | {name: "Alice", ...} |
| session:* | string | ~12,000 | 128 bytes | 1800s | {token data} |
| cache:* | JSON | ~800 | 1.2 KB | 3600s | {nested doc} |
Step 5: Identify patterns and anomalies
Flag anything noteworthy:
- Big keys: Any key using significantly more memory than its peers
- No TTL on cache-like data: Keys that look ephemeral but have no expiry
- Encoding surprises: Large sorted sets that have moved from ziplist to skiplist
- Empty or near-empty keys: Keys that exist but have minimal data
- Hot key candidates: Use
redis_hotkeysif available
Step 6: Suggest next steps
Based on what you found, suggest relevant skills:
- Found JSON docs? -> "Consider running index-advisor to set up search"
- Found TTL-based patterns? -> "The data-modeling-advisor can evaluate your TTL strategy"
- Found large datasets? -> "Use compare-approaches to evaluate different data structures"
- Found memory concerns? -> "Check redis_info memory and consider eviction policies"
Tips
- SCAN is cursor-based and safe for production; it won't block the server
- Memory usage per key includes overhead (encoding, pointers); don't be surprised if a 10-byte string uses 80 bytes
- TTL of -1 means no expiry; TTL of -2 means the key doesn't exist
- For large databases, sample rather than scan everything -- 100-500 keys per pattern is sufficient
- If the database is empty or nearly empty, say so -- don't force a deep analysis on nothing
More skills from the redisctl repository
View all 17 skillscloud-database-provisioning
provision Redis Cloud databases
Jun 3CloudDatabaseMCPRediscompare-approaches
prototype Redis data model alternatives
May 27Data ModelingDatabasePrototypingRedisdata-modeling-advisor
design Redis data models
May 28ArchitectureData ModelingDatabaseRedisenterprise-health-check
perform Redis Enterprise cluster health checks
Jun 3DatabaseObservabilityOperationsRedisindex-ab-test
compare RediSearch index configurations
May 28A/B TestingDatabasePerformanceRedis +1index-advisor
recommend RediSearch index schemas
May 28Data ModelingDatabaseRedisSearch
More from Redis
View publisheriris-development
integrate with Redis Iris AI products
agent-skills
May 27AgentsAI InfrastructureBackendMemory +1redis-clustering
configure Redis clustering and replication
agent-skills
May 27ArchitectureDatabaseInfrastructurePerformance +1redis-connections
optimize Redis client connections
agent-skills
May 27BackendCachingPerformanceRedisredis-core
model data with Redis structures
agent-skills
May 27ArchitectureData ModelingDatabaseRedisredis-observability
monitor and triage Redis performance
agent-skills
May 27DebuggingMonitoringObservabilityPerformance +1redis-search
implement Redis Search indexing and queries
agent-skills
Jun 24ArchitectureDatabaseEngineeringRedis +1