|
| 1 | +# Hybrid online store |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +The HybridOnlineStore allows routing online feature operations to different online store backends based on a configurable tag (such as `tribe`, `team`, or `project`) on the FeatureView. This enables a single Feast deployment to support multiple online store backends, each configured independently and selected dynamically at runtime. |
| 6 | + |
| 7 | +## Getting started |
| 8 | + |
| 9 | +To use the HybridOnlineStore, install Feast with all required online store dependencies (e.g., Bigtable, Cassandra, etc.) for the stores you plan to use. For example: |
| 10 | + |
| 11 | +``` |
| 12 | +pip install 'feast[gcp,cassandra]' |
| 13 | +``` |
| 14 | + |
| 15 | +## Example |
| 16 | + |
| 17 | +{% code title="feature_store.yaml" %} |
| 18 | +```yaml |
| 19 | +project: my_feature_repo |
| 20 | +registry: data/registry.db |
| 21 | +provider: local |
| 22 | +online_store: |
| 23 | + type: hybrid_online_store.HybridOnlineStore |
| 24 | + routing_tag: team # or any tag name you want to use in FeatureView's for routing |
| 25 | + online_stores: |
| 26 | + - type: bigtable |
| 27 | + conf: |
| 28 | + project_id: my_gcp_project |
| 29 | + instance: my_bigtable_instance |
| 30 | + - type: cassandra |
| 31 | + conf: |
| 32 | + hosts: |
| 33 | + - cassandra1.example.com |
| 34 | + - cassandra2.example.com |
| 35 | + keyspace: feast_keyspace |
| 36 | + username: feast_user |
| 37 | + password: feast_password |
| 38 | +``` |
| 39 | +{% endcode %} |
| 40 | +
|
| 41 | +### Setting the Routing Tag in FeatureView |
| 42 | +
|
| 43 | +To enable routing, add a tag to your FeatureView that matches the `routing_tag` specified in your `feature_store.yaml`. For example, if your `routing_tag` is `team`, add a `team` tag to your FeatureView: |
| 44 | + |
| 45 | +```yaml |
| 46 | +tags: |
| 47 | + team: bigtable # This tag determines which online store is used |
| 48 | +``` |
| 49 | + |
| 50 | +The value of this tag (e.g., `bigtable`) should match the type or identifier of the online store you want to use for this FeatureView. The HybridOnlineStore will route all online operations for this FeatureView to the corresponding backend. |
| 51 | + |
| 52 | +### Example FeatureView |
| 53 | + |
| 54 | +{% code title="feature_view" %} |
| 55 | +```yaml |
| 56 | +name: user_features |
| 57 | +entities: |
| 58 | + - name: user_id |
| 59 | + join_keys: ["user_id"] |
| 60 | +ttl: null |
| 61 | +schema: |
| 62 | + - name: age |
| 63 | + dtype: int64 |
| 64 | + - name: country |
| 65 | + dtype: string |
| 66 | +online: true |
| 67 | +source: |
| 68 | + path: data/user_features.parquet |
| 69 | + event_timestamp_column: event_timestamp |
| 70 | + created_timestamp_column: created_timestamp |
| 71 | +tags: |
| 72 | + team: bigtable # This tag determines which online store is used |
| 73 | +``` |
| 74 | +{% endcode %} |
| 75 | + |
| 76 | +The `team` tag in the FeatureView's `tags` field determines which online store backend is used for this FeatureView. In this example, all online operations for `user_features` will be routed to the Bigtable online store, as specified by the tag value and the `routing_tag` in your `feature_store.yaml`. |
| 77 | + |
| 78 | +The HybridOnlineStore will route requests to the correct online store based on the value of the tag specified by `routing_tag`. |
| 79 | + |
| 80 | +The full set of configuration options for each online store is available in their respective documentation: |
| 81 | +- [BigtableOnlineStoreConfig](https://rtd.feast.dev/en/latest/#feast.infra.online_stores.bigtable.BigtableOnlineStoreConfig) |
| 82 | +- [CassandraOnlineStoreConfig](https://rtd.feast.dev/en/master/#feast.infra.online_stores.cassandra_online_store.cassandra_online_store.CassandraOnlineStoreConfig) |
| 83 | + |
| 84 | +For a full explanation of configuration options, please refer to the documentation for each online store backend you configure in the `online_stores` list. |
| 85 | + |
| 86 | +Storage specifications can be found at [docs/specs/online_store_format.md](../../specs/online_store_format.md). |
| 87 | + |
| 88 | +## Functionality Matrix |
| 89 | + |
| 90 | +The set of functionality supported by online stores is described in detail [here](overview.md#functionality). Below is a matrix indicating which functionality is supported by the HybridOnlineStore. |
| 91 | + |
| 92 | +| | HybridOnlineStore | |
| 93 | +|-----------------------------------------------------------|-------------------| |
| 94 | +| write feature values to the online store | yes | |
| 95 | +| read feature values from the online store | yes | |
| 96 | +| update infrastructure (e.g. tables) in the online store | yes | |
| 97 | +| teardown infrastructure (e.g. tables) in the online store | yes | |
| 98 | +| generate a plan of infrastructure changes | no | |
| 99 | +| support for on-demand transforms | yes | |
| 100 | +| readable by Python SDK | yes | |
| 101 | +| readable by Java | no | |
| 102 | +| readable by Go | no | |
| 103 | +| support for entityless feature views | yes | |
| 104 | +| support for concurrent writing to the same key | yes | |
| 105 | +| support for ttl (time to live) at retrieval | no | |
| 106 | +| support for deleting expired data | no | |
| 107 | +| collocated by feature view | yes | |
| 108 | +| collocated by feature service | no | |
| 109 | +| collocated by entity key | yes | |
| 110 | + |
| 111 | +To compare this set of functionality against other online stores, please see the full [functionality matrix](overview.md#functionality-matrix). |
0 commit comments