Skip to content

Online store batch read/write interface #2281

Closed

Description

@felixwang9817

Is your feature request related to a problem? Please describe.

The current OnlineStore read and write interfaces are batched with respect to entity rows, but not with respect to feature views:

@abstractmethod
def online_read(
    self,
    config: RepoConfig,
    table: FeatureView,
    entity_keys: List[EntityKeyProto],
    requested_features: Optional[List[str]] = None,
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:

@abstractmethod
def online_write_batch(
    self,
    config: RepoConfig,
    table: FeatureView,
    data: List[
        Tuple[EntityKeyProto, Dict[str, ValueProto], datetime, Optional[datetime]]
    ],
    progress: Optional[Callable[[int], Any]],
) -> None:

This makes it difficult to do store-specific optimizations. For example, batching Redis retrievals could lead to a significant speedup.

Describe the solution you'd like

Introduce non-breaking (e.g. non-abstract) methods to the OnlineStore interface:

@abstractmethod
def online_read(
    self,
    config: RepoConfig,
    tables: List[FeatureView],
    entity_keys: List[EntityKeyProto],
    requested_features: Optional[List[str]] = None,
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:

@abstractmethod
def online_write_batch(
    self,
    config: RepoConfig,
    tables: List[FeatureView],
    data: List[
        Tuple[EntityKeyProto, Dict[str, ValueProto], datetime, Optional[datetime]]
    ],
    progress: Optional[Callable[[int], Any]],
) -> None:

Describe alternatives you've considered
N/A

Additional context
This is partially motivated by #2254. In particular, having a batch interface would allow for greater optimizations to the Redis online store implementation.

Activity

  1. judahrand commented on Feb 4, 2022

    @judahrand
    Member

    Slightly tangential but also worth noting that there doesn't seem to be any real reason to pass entity_keys as List[EntityKeyProto] anymore. Creating these Proto objects is unnecessary overhead when the OnlineStores could just use Mapping[str, ValueProto]. It's a less important optimization but if we're thinking of changing the interface anyway 🤷

  2. stale commented on Jun 12, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  3. moved this to Done in Feast Roadmapon Jun 19, 2022
  4. stale commented on Dec 20, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  5. moved this from Paused (contributions welcome) to Done in Feast Roadmapon Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions