|
| 1 | +# Valkey online store |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +[Valkey](https://valkey.io/) is an open source (BSD-3-Clause), high-performance key/value datastore hosted by the Linux Foundation, created as a community fork of Redis. It maintains compatibility with the Redis wire protocol, so it can act as a drop-in replacement for Redis. Valkey is also offered as a managed engine by major cloud providers (for example, Amazon ElastiCache for Valkey). |
| 6 | + |
| 7 | +Similar to Redis and [Dragonfly](dragonfly.md), Valkey can be used as an online feature store for Feast: Feast's Redis online store only issues core commands (hash reads/writes, scans, key expiry, pipelines), all of which Valkey implements. |
| 8 | + |
| 9 | +Feast's standard online store operations have been verified against Valkey 8.1: `feast apply`, `feast materialize`, online retrieval via `get_online_features`, `feast teardown`, and key expiry via the `key_ttl_seconds` option. Features that depend on Redis modules (such as vector search) are outside the scope of this page. |
| 10 | + |
| 11 | +## Using Valkey as a drop-in Feast online store instead of Redis |
| 12 | + |
| 13 | +Make sure you have Python and `pip` installed. |
| 14 | + |
| 15 | +Install the Feast SDK and CLI |
| 16 | + |
| 17 | +`pip install feast` |
| 18 | + |
| 19 | +In order to use Valkey as the online store, you'll need to install the redis extra: |
| 20 | + |
| 21 | +`pip install 'feast[redis]'` |
| 22 | + |
| 23 | +### 1. Create a feature repository |
| 24 | + |
| 25 | +Bootstrap a new feature repository: |
| 26 | + |
| 27 | +``` |
| 28 | +feast init feast_valkey |
| 29 | +cd feast_valkey/feature_repo |
| 30 | +``` |
| 31 | + |
| 32 | +Update `feature_repo/feature_store.yaml` with the below contents: |
| 33 | + |
| 34 | +``` |
| 35 | +project: feast_valkey |
| 36 | +registry: data/registry.db |
| 37 | +provider: local |
| 38 | +online_store: |
| 39 | + type: redis |
| 40 | + connection_string: "localhost:6379" |
| 41 | +``` |
| 42 | + |
| 43 | +Note that the online store `type` remains `redis`: Feast talks to Valkey over the Redis protocol, and all options of the [Redis online store](redis.md) (such as `key_ttl_seconds`) apply unchanged. |
| 44 | + |
| 45 | +### 2. Start Valkey |
| 46 | + |
| 47 | +There are several options available to get Valkey up and running quickly. We will be using Docker for this tutorial. |
| 48 | + |
| 49 | +`docker run -d -p 6379:6379 valkey/valkey:8.1` |
| 50 | + |
| 51 | +### 3. Register feature definitions and deploy your feature store |
| 52 | + |
| 53 | +`feast apply` |
| 54 | + |
| 55 | +The `apply` command scans python files in the current directory for feature view/entity definitions, registers the objects, and deploys infrastructure. |
| 56 | +You should see the following output: |
| 57 | + |
| 58 | +``` |
| 59 | +.... |
| 60 | +Created entity driver |
| 61 | +Created feature view driver_hourly_stats_fresh |
| 62 | +Created feature view driver_hourly_stats |
| 63 | +Created on demand feature view transformed_conv_rate |
| 64 | +Created on demand feature view transformed_conv_rate_fresh |
| 65 | +Created feature service driver_activity_v1 |
| 66 | +Created feature service driver_activity_v3 |
| 67 | +Created feature service driver_activity_v2 |
| 68 | +``` |
| 69 | + |
| 70 | +## Functionality Matrix |
| 71 | + |
| 72 | +The set of functionality supported by online stores is described in detail [here](overview.md#functionality). |
| 73 | +Below is a matrix indicating which functionality is supported by the Redis online store, which Feast uses to communicate with Valkey. |
| 74 | + |
| 75 | +| | Redis | |
| 76 | +| :-------------------------------------------------------- | :---- | |
| 77 | +| write feature values to the online store | yes | |
| 78 | +| read feature values from the online store | yes | |
| 79 | +| update infrastructure (e.g. tables) in the online store | yes | |
| 80 | +| teardown infrastructure (e.g. tables) in the online store | yes | |
| 81 | +| generate a plan of infrastructure changes | no | |
| 82 | +| support for on-demand transforms | yes | |
| 83 | +| readable by Python SDK | yes | |
| 84 | +| readable by Java | yes | |
| 85 | +| readable by Go | yes | |
| 86 | +| support for entityless feature views | yes | |
| 87 | +| support for concurrent writing to the same key | yes | |
| 88 | +| support for ttl (time to live) at retrieval | yes | |
| 89 | +| support for deleting expired data | yes | |
| 90 | +| collocated by feature view | no | |
| 91 | +| collocated by feature service | no | |
| 92 | +| collocated by entity key | yes | |
| 93 | + |
| 94 | +To compare this set of functionality against other online stores, please see the full [functionality matrix](overview.md#functionality-matrix). |
0 commit comments