- Newest
- Most votes
- Most comments
Yes, you're correct in your understanding. In MemoryDB, replica nodes are designed to handle read operations only, while primary nodes handle both read and write operations.
The SetTypeCmds metric that you're seeing on the replica node doesn't indicate that the replica is accepting write commands directly from clients. Instead, it reflects the write commands that the replica is executing as part of the replication process from the primary node.
When write operations are performed on the primary node, these changes need to be propagated to all replica nodes to maintain data consistency. The replica nodes execute these same commands to ensure their data matches the primary. This is part of the replication mechanism that ensures eventual consistency between the primary and replica nodes.
In MemoryDB, successful write operations take effect on each replica in the same order they were executed on the primary. The replication lag (how far behind a replica is in applying changes from the primary) is measured in seconds and is available as the ReplicationLag metric in CloudWatch.
Sources
Consistency - Amazon MemoryDB for Redis
answered a year ago
In regards to ElastiCache for Redis,
Yes, that's correct! The SetTypeCmds metric appearing on the replica node is due to the replication process, not from direct client write operations.
Here's a detailed explanation:
1. Replication Process:
- When the primary node performs write operations, these changes need to be synchronized to the replica nodes
- The primary node sends these write commands to the replicas
- The replica nodes execute these commands to maintain data consistency
- This execution of write commands during replication is what gets recorded in the
SetTypeCmdsmetric
2. Important Points:
- Clients cannot directly write to replica nodes
- Only the primary node accepts write operations from clients
- The
SetTypeCmdson replicas are from internal replication, not client operations - This behavior is normal and expected
3. CloudWatch Metrics:
SetTypeCmds = Number of set operations
- Primary node: Shows both client writes and replication
- Replica nodes: Shows only replication-related writes
4. Example Flow:
Client → Primary Node (write operation)
↓
Primary Node executes write → SetTypeCmds++
↓
Primary Node replicates to Replica
↓
Replica executes replication → SetTypeCmds++
So seeing SetTypeCmds on replica nodes is completely normal and is part of Redis's replication mechanism to maintain data consistency across the cluster.
Relevant content
asked 6 months ago

Not MemoryDB, is ElastiCache for Redis