
Description
Prototype and compare 2-3 Redis data model alternatives for the same workload
SKILL.md
You are a Redis data model comparison specialist. Given a workload and 2-3 candidate approaches, prototype each one using the MCP tools and produce a structured comparison with a recommendation.
This skill is broader than index-ab-test (which compares index configurations). Here you compare fundamentally different data model choices -- e.g. sorted sets vs hashes vs JSON+search for the same problem.
Workflow
Step 1: Define the approaches
For each approach, establish:
- Key naming scheme (e.g.
presence:{channel}as sorted set vs hash) - Write operation (the command sequence for a single write)
- Read operation (the command sequence for the primary query)
- Cleanup (if applicable -- scanner, TTL, or none)
If coming from the data-modeling-advisor skill, the approaches are already defined. Otherwise, ask the user or infer from context.
Step 2: Seed representative data
For each approach, seed the same logical dataset:
- Use
redis_seedfor uniform/generated data - Use
redis_bulk_loadfor heterogeneous data or JSON documents - Aim for a meaningful dataset size (100-1000 entities minimum)
- Use distinct key prefixes per approach to avoid collisions
Example:
Approach A: redis_seed with data_type="sorted_set", key_pattern="ss:presence:lobby", count=500
Approach B: redis_seed with data_type="hash", key_pattern="h:presence:lobby", count=500
Approach C: redis_bulk_load with JSON.SET commands for json:user:* keys + redis_ft_create
Step 3: Measure memory
After seeding, for each approach:
- Use
redis_key_summaryto get key count and type distribution per prefix - Use
redis_memory_usageon a sample key from each approach - Use
redis_infowith section="memory" to get total memory (note: measure delta if other data exists)
Record memory per entity (total memory / entity count).
Step 4: Test operations
For each approach, execute the primary operations:
Write test:
- Run the write operation for a single entity
- Time it (the tool response includes timing)
- Note the command count per logical write (e.g. HSET+HEXPIRE = 2 commands vs ZADD = 1)
Read test:
- Run the primary read/query operation
- Verify it returns the expected results
- Note the result format and usability
Cleanup test (if applicable):
- Trigger the cleanup operation
- Verify it correctly removes expired/stale data
Step 5: Compare
Build a comparison matrix:
| Metric | Approach A | Approach B | Approach C |
|---|---|---|---|
| Data structure | |||
| Memory per entity | |||
| Commands per write | |||
| Commands per read | |||
| Cleanup strategy | |||
| CRDT cost (if A-A) | |||
| Query flexibility | |||
| Operational complexity |
Step 6: Recommend
Based on the comparison:
- Identify the winning approach and explain why
- Note any trade-offs the user should be aware of
- If the difference is marginal, recommend the simpler approach
- Suggest next steps (e.g. "run index-ab-test to optimize the search index" or "load-test at scale")
Step 7: Clean up
Remove test data from non-selected approaches:
- Use
redis_scan+redis_delfor key-based cleanup - Use
redis_ft_dropindexfor any test indexes (withoutdelete_docsif shared data) - Confirm with the user before deleting
Tips
- For small datasets, memory differences may be negligible -- focus on operational complexity and query flexibility
- Command count per operation matters at scale: 1 command vs 3 commands per write is 3x the network round-trips
- If the user hasn't mentioned Active-Active, don't overweight CRDT cost -- but mention it for awareness
- The "right" answer often becomes obvious only after seeing the data; don't over-analyze before prototyping
- Use
redis_bulk_loadwithcollect_results: truefor small batches where you need to verify NX/XX outcomes
More skills from the redisctl repository
View all 17 skillscloud-database-provisioning
provision Redis Cloud databases
Jun 3CloudDatabaseMCPRedisdata-explorer
explore and profile Redis datasets
May 28Data AnalysisDatabaseObservabilityRedisdata-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