|
| 1 | +# Hazelcast Online Store |
| 2 | + |
| 3 | +This contribution makes it possible to use [Hazelcast](https://hazelcast.com/) as online store for Feast. |
| 4 | + |
| 5 | +Once the Hazelcast client configuration is given inside `feature_store.yaml` file, everything else |
| 6 | +is handled as with any other online store: schema creation, read/write from/to Hazelcast and remove operations. |
| 7 | + |
| 8 | +## Quick usage |
| 9 | + |
| 10 | +The following refers to the [Feast quickstart](https://docs.feast.dev/getting-started/quickstart) page. |
| 11 | +Only the Step 2 is different from this tutorial since it requires you to configure your Hazelcast online store. |
| 12 | + |
| 13 | +### Creating the feature repository |
| 14 | + |
| 15 | +The easiest way to get started is to use the Feast CLI to initialize a new |
| 16 | +feature store. Once Feast is installed, the command |
| 17 | + |
| 18 | +``` |
| 19 | +feast init FEATURE_STORE_NAME -t hazelcast |
| 20 | +``` |
| 21 | + |
| 22 | +will interactively help you create the `feature_store.yaml` with the |
| 23 | +required configuration details to access your Hazelcast cluster. |
| 24 | + |
| 25 | +Alternatively, you can run `feast init -t FEATURE_STORE_NAME`, as described |
| 26 | +in the quickstart, and then manually edit the `online_store` section in |
| 27 | +the `feature_store.yaml` file as detailed below. |
| 28 | + |
| 29 | +The following steps (setup of feature definitions, deployment of the store, |
| 30 | +generation of training data, materialization, fetching of online/offline |
| 31 | +features) proceed exactly as in the general Feast quickstart instructions. |
| 32 | + |
| 33 | +#### Hazelcast setup |
| 34 | + |
| 35 | +In order to use [Hazelcast](https://hazelcast.com) as online store, you need to have a running Hazelcast cluster. |
| 36 | +You can create a cluster using Hazelcast Viridian Serverless easily or deploy one on your local/remote machine. |
| 37 | +See this [getting started](https://hazelcast.com/get-started/) page for more details. |
| 38 | + |
| 39 | +Hazelcast online store provides capability to connect local/remote or Hazelcast Viridian Serverless cluster. |
| 40 | +Following is an example to connect local cluster named "dev" running on port 5701 with TLS/SSL enabled. |
| 41 | + |
| 42 | +```yaml |
| 43 | +[...] |
| 44 | +online_store: |
| 45 | + type: hazelcast |
| 46 | + cluster_name: dev |
| 47 | + cluster_members: ["localhost:5701"] |
| 48 | + ssl_cafile_path: /path/to/ca/file |
| 49 | + ssl_certfile_path: /path/to/cert/file |
| 50 | + ssl_keyfile_path: /path/to/key/file |
| 51 | + ssl_password: ${SSL_PASSWORD} # The password will be read form the `SSL_PASSWORD` environment variable. |
| 52 | + key_ttl_seconds: 86400 # The default is 0 and means infinite. |
| 53 | +``` |
| 54 | +
|
| 55 | +If you want to connect your Hazelcast Viridian cluster instead of local/remote one, specify your configuration as follows: |
| 56 | +
|
| 57 | +```yaml |
| 58 | +[...] |
| 59 | +online_store: |
| 60 | + type: hazelcast |
| 61 | + cluster_name: YOUR_CLUSTER_ID |
| 62 | + discovery_token: YOUR_DISCOVERY_TOKEN |
| 63 | + ssl_cafile_path: /path/to/ca/file |
| 64 | + ssl_certfile_path: /path/to/cert/file |
| 65 | + ssl_keyfile_path: /path/to/key/file |
| 66 | + ssl_password: ${SSL_PASSWORD} # The password will be read form the `SSL_PASSWORD` environment variable. |
| 67 | + key_ttl_seconds: 86400 # The default is 0 and means infinite. |
| 68 | +``` |
| 69 | +
|
| 70 | +#### TTL configuration |
| 71 | +
|
| 72 | +TTL is the maximum time in seconds for each feature to stay idle in the map. |
| 73 | +It limits the lifetime of the features relative to the time of the last read or write access performed on them. |
| 74 | +The features whose idle period exceeds this limit are expired and evicted automatically. |
| 75 | +A feature is idle if no get or put is called on it. |
| 76 | +Valid values are integers between 0 and Integer.MAX_VALUE. |
| 77 | +Its default value is 0, which means infinite. |
| 78 | +
|
| 79 | +```yaml |
| 80 | +[...] |
| 81 | +online_store: |
| 82 | + [...] |
| 83 | + key_ttl_seconds: 86400 |
| 84 | +``` |
| 85 | +
|
| 86 | +### More info |
| 87 | +
|
| 88 | +You can learn about Hazelcast more from the [Hazelcast Documentation](https://docs.hazelcast.com/home/). |
| 89 | +
|
0 commit comments