forked from kelseyhightower/confd
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
area: backendBackend implementationsBackend implementationsenhancementNew feature or requestNew feature or requestpriority: mediumMedium priority itemMedium priority item
Description
Problem
The DynamoDB backend currently only supports polling mode. Watch mode is not implemented, forcing users to use interval-based polling which has higher CPU overhead and delayed updates.
Current Status
func (c *Client) WatchPrefix(ctx context.Context, prefix string, keys []string, waitIndex uint64, stopChan chan bool) (uint64, error) {
<-stopChan
return 0, nil
}Recommendation
Implement event-driven updates using DynamoDB Streams:
- Enable DynamoDB Streams on tables used by confd
- Subscribe to stream events (INSERT, MODIFY, REMOVE)
- Process stream records to detect changes matching watched prefixes
- Return from WatchPrefix when relevant changes detected
Expected Benefits
- Lower CPU usage (event-driven vs. polling)
- Faster change detection
- Better scalability for large deployments
Implementation Considerations
- DynamoDB Streams have 24-hour retention
- Stream records provide old/new images for comparison
- May need to handle stream shard management
Files
pkg/backends/dynamodb/client.go
Priority
Medium - Feature enhancement, not blocking
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: backendBackend implementationsBackend implementationsenhancementNew feature or requestNew feature or requestpriority: mediumMedium priority itemMedium priority item