feat: Addresses performance issues in the Redis online store#6337
Open
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
Open
feat: Addresses performance issues in the Redis online store#6337ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
Conversation
c202cf6 to
bde2067
Compare
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
bde2067 to
59b6694
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses several correctness and performance issues in the Redis online store
identified in #3596.
Changes
1. Batched
get_online_featurespipeline (read latency: O(N_fv) → O(1))The base class
get_online_featurescallsonline_readonce per feature view,each opening and executing its own Redis pipeline. Since all feature views for
the same entity already share one Redis hash key, all
HMGETcommands acrossevery feature view can be batched into a single pipeline execution.
RedisOnlineStorenow overridesget_online_featuresto pre-compute allentity keys and hash field keys, issue one
pipeline.execute()for everything,then demultiplex results back per feature view. For a request spanning N feature
views this cuts Redis round trips from N to 1.
2. Fixed
delete_tableN+1 query patternThe previous implementation called
client.hgetall(key)synchronously insidethe
scan_iterloop — one blocking round trip per entity key. Replaced with athree-phase approach:
SCAN(no per-key round trips)HKEYSfor all collected keys (1 round trip)HDEL/DELcommands (1 round trip)3.
skip_dedupconfig option for write throughputAdded
skip_dedup: bool = FalsetoRedisOnlineStoreConfig. When enabled,online_write_batchskips the first timestamp-read pipeline and writes allrows in a single pass, halving round trips. Intended for initial bulk loads or
append-only pipelines where concurrent out-of-order writes are not a concern.
4.
online_write_batch_asyncimplementedPreviously raised
NotImplementedError. Now fully implemented using theexisting
_get_client_asyncinfrastructure, withskip_dedupsupport.Files Changed
sdk/python/feast/infra/online_stores/redis.py— only file modified; baseclass
OnlineStoreand all other store implementations are untouched.Performance Impact
get_online_featureswith N feature viewsonline_write_batchwithskip_dedup=Truedelete_tablewith K entity keysRelated