Skip to content

Redis Online Store adapter is not production-ready #3596

Open
@roelschr

Description

Purpose of this issue

I'm opening this issue to bring to light some concerns and potential areas for improvement in the Redis Online Store adapter for the whole community. I understand that the Feast team has other priorities, and the community is also encouraged to contribute. My main goal is to make this information more clear for existing and future users, so they can make informed decisions based on the documentation and avoid potential pitfalls (that my team was not able to avoid prior to start using Feast with Redis).

Expected Behavior

Redis is positioned as a well-supported Online Store within Feast, with a dedicated blog post, being used in performance assessment, and boasting the most complete set of functionalities.

Current Behavior

However, it seems that the current implementation of Redis' Online Store has some issues and lacks certain basic functionalities, even those mentioned in the functionality matrix.

Here is a list of concerns:

  1. While, in theory, feature data is "collocated by entity key", in practice it works as if it were "collocated by feature view". This is due to get_online_features() performing one read_from_online_store per feature view in your request. This implies that the more feature views you request, the longer get_online_features() will take, regardless of key collocation. Additionally, all database reads are synchronous.

  2. Although, in theory, it "supports TTL (time to live) at retrieval", Feature View TTL doesn't seem to matter in practice. Instead, you have to set up a store-level TTL that is only used to expire whole entities. In complex production feature store, with several feature views for the same entity and different TTL requirements, this is never going to be useful. As a result, you can get features older than TTL during online feature retrieval with Redis. Here is a "closed" and marked as "done" issue mentioning this.

  3. In theory, the online store should "generate a plan and update infrastructure (e.g. tables)". However, in practice, renaming or deleting features and feature views will leave them stored in Redis, causing it to grow indefinitely. Feast will only delete data from Redis when the last features/feature view of a specific entity is not in use anymore. Here is a "closed" issue mentioning this. This is not an issue when using key_ttl_seconds, but in complex production-level feature stores, this may not be a viable solution.

Possible Solution

Switching to another online store (like Dynamo or Cassandra) can solve some of the issues, but not all. The performance of Redis itself is not in question, but the Feast implementation may need improvements.

Some possible fixes include:

  1. I see no reason for all online stores to not be "collocated by entity key". I really like this about Feast's Redis data model. In offline stores, feature views have conflicting timestamps and different historical sources. But in online stores, you want to only keep the latest values (like a common dimension in a warehouse), so all feature views that share the entities can be stored in one table/hash/whatever. It would speed up online feature retrieval across all online stores. Cassandra, for example, could very much implement the same data model for column families. But Feast itself doesn't make use of the better data model in Redis.

  2. Addressing the conflict between Redis' inability to allow EXPIRE (or ttl) in hash child keys and the "collocated by entity key" design. One basic principle in Feast is that if you request a feature from the online store and its value is older than its TTL, you should get a null. Workarounds may be needed to make Redis a more suitable data store for Online Stores in this regard. Cassandra, for example, has TTL for both table and individual columns.

  3. Implementing the use of HDEL for infrastructure updates when feature views are renamed/deleted. For individual features, the change might be more substantial, as update_infra() currently only has access to feature views and entities to create/delete. Further exploration of this issue is necessary.

I hope that addressing these concerns can lead to a more robust and reliable implementation of the Redis Online Store adapter in Feast, or even improve Feast as a whole. As a heavy user, I would prioritize these changes over other integrations, and I believe I'm likely not the only one. Strengthening the Redis integration and enhancing Feast's performance will undoubtedly benefit the wider community.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions