Skip to content

Conversation

@ntkathole
Copy link
Member

What this PR does / why we need it:

Optimizes the DynamoDB online store implementation to reduce online feature serving latency.

  1. O(1) dictionary lookup instead of O(n log n) sorting - _process_batch_get_response now uses dictionary-based lookup for response ordering instead of sorting.

  2. Cached TypeDeserializer - Added class-level cached TypeDeserializer instance to avoid per-request object instantiation overhead in async reads.

  3. Entity ID computation caching - _to_entity_ids now caches computed entity IDs within a request to avoid redundant hashing for duplicate entity keys.

  4. VPC endpoint support for async client - The endpoint_url config is now properly passed to the async aiobotocore client, enabling DynamoDB VPC endpoints for reduced network latency.

  5. Improved default configuration values:

    • batch_size: 40 → 100 (max allowed by DynamoDB BatchGetItem)
    • max_pool_connections: 10 → 50 (better concurrency)
    • keepalive_timeout: 12s → 30s (better connection reuse)
    • connect_timeout: 60s → 5s (faster failure detection)
    • read_timeout: 60s → 10s (faster failure detection)
    • total_max_retry_attempts: None → 3 (bounded retries)
    • retry_mode: None → "adaptive" (smart retry with rate limiting)
  6. Pre-allocated result lists - Response processing now pre-allocates result lists instead of using append-based growth.

@ntkathole ntkathole self-assigned this Jan 22, 2026
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant