Title: perf: Parallelize DynamoDB batch reads in sync online_read by abhijeet-dhumal · Pull Request #6024 · feast-dev/feast · GitHub
Open Graph Title: perf: Parallelize DynamoDB batch reads in sync online_read by abhijeet-dhumal · Pull Request #6024 · feast-dev/feast
X Title: perf: Parallelize DynamoDB batch reads in sync online_read by abhijeet-dhumal · Pull Request #6024 · feast-dev/feast
Description: Summary Execute DynamoDB BatchGetItem requests in parallel using ThreadPoolExecutor instead of sequentially. This significantly reduces latency when reading features for many entities that span multiple batches. Changes Pre-split entity IDs into batches upfront Use ThreadPoolExecutor to execute batch requests concurrently Skip parallelization for single batch (no overhead) Merge results in original order after parallel fetch Expected Behavior For multiple batches, DynamoDB BatchGetItem requests should execute in parallel, reducing total latency from N × network_latency to approximately 1 × network_latency. Current Behavior The sync online_read method executes batch requests sequentially in a while loop: while True: batch = list(itertools.islice(entity_ids_iter, batch_size)) if len(batch) == 0: break response = dynamodb_resource.batch_get_item(RequestItems=...) # Sequential! result.extend(batch_result) For 500 entities with batch_size=100, this makes 5 sequential network calls. Steps to Reproduce Configure DynamoDB online store with batch_size=100 Call get_online_features for 500 entities Profile network latency - observe 5 sequential calls Specifications Version: 0.47.0+ Platform: All Subsystem: sdk/python/feast/infra/online_stores/dynamodb.py Performance Impact For 500 entities with batch_size=100 (5 batches): Before: 5 sequential network calls = 50-150ms After: 5 parallel network calls = 10-30ms Estimated savings: 40-120ms for large entity sets Possible Solution Already implemented in this PR using ThreadPoolExecutor: with ThreadPoolExecutor(max_workers=min(len(batches), batch_size)) as executor: responses = list(executor.map(fetch_batch, batches)) Related RHOAIENG-46061 (60ms p99 SLA target for online feature serving) Note: The async path (online_read_async) already uses asyncio.gather() for parallel execution
Open Graph Description: Summary Execute DynamoDB BatchGetItem requests in parallel using ThreadPoolExecutor instead of sequentially. This significantly reduces latency when reading features for many entities that span mul...
X Description: Summary Execute DynamoDB BatchGetItem requests in parallel using ThreadPoolExecutor instead of sequentially. This significantly reduces latency when reading features for many entities that span mul...
Opengraph URL: https://github.com/feast-dev/feast/pull/6024
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:dd9b1502-9436-f77f-597f-48c0ec5fb073 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E0BA:1D90CC:2A70178:3B12154:6A4F5C08 |
| html-safe-nonce | 279b9f214037a507edf21976c35fb919667afad91fc59939cb91fb7778d731c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEJBOjFEOTBDQzoyQTcwMTc4OjNCMTIxNTQ6NkE0RjVDMDgiLCJ2aXNpdG9yX2lkIjoiNzIyMTE4MDc3NzcxMDQ0MzUyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bfc9181009644e14213c1b9f91e4e78ddfcfbcfc0a89e95dba037490d25abf6b |
| hovercard-subject-tag | pull_request:3326116222 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/6024/files |
| twitter:image | https://avatars.githubusercontent.com/u/84722973?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/84722973?s=400&v=4 |
| og:image:alt | Summary Execute DynamoDB BatchGetItem requests in parallel using ThreadPoolExecutor instead of sequentially. This significantly reduces latency when reading features for many entities that span mul... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width