-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Hazelcast as an online store (#3523)
* feat: Add Hazelcast as an online store Signed-off-by: mehmettokgoz <mehmet.tokgoz@hazelcast.com> * Fix template bugs and address review comments. Signed-off-by: mehmettokgoz <mehmet.tokgoz@hazelcast.com> --------- Signed-off-by: mehmettokgoz <mehmet.tokgoz@hazelcast.com>
- Loading branch information
1 parent
8dd7217
commit b05d50b
Showing
23 changed files
with
1,073 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Hazelcast online store | ||
|
||
## Description | ||
|
||
Hazelcast online store is in alpha development. | ||
|
||
The [Hazelcast](htpps://hazelcast.com) online store provides support for materializing feature values into a Hazelcast cluster for serving online features in real-time. | ||
In order to use Hazelcast as online store, you need to have a running Hazelcast cluster. You can create a cluster using Hazelcast Viridian Serverless. See this [getting started](https://hazelcast.com/get-started/) page for more details. | ||
|
||
* Each feature view is mapped one-to-one to a specific Hazelcast IMap | ||
* This implementation inherits all strengths of Hazelcast such as high availability, fault-tolerance, and data distribution. | ||
* Secure TSL/SSL connection is supported by Hazelcast online store. | ||
* You can set TTL (Time-To-Live) setting for your features in Hazelcast cluster. | ||
|
||
Each feature view corresponds to an IMap in Hazelcast cluster and the entries in that IMap corresponds to features of entities. | ||
Each feature value stored separately and can be retrieved individually. | ||
|
||
## Getting started | ||
|
||
In order to use Hazelcast online store, you'll need to run `pip install 'feast[hazelcast]'`. You can then get started with the command `feast init REPO_NAME -t hazelcast`. | ||
|
||
|
||
## Examples | ||
|
||
{% code title="feature_store.yaml" %} | ||
```yaml | ||
project: my_feature_repo | ||
registry: data/registry.db | ||
provider: local | ||
online_store: | ||
type: hazelcast | ||
cluster_name: dev | ||
cluster_members: ["localhost:5701"] | ||
key_ttl_seconds: 36000 | ||
``` | ||
## Functionality Matrix | ||
| | Hazelcast | | ||
| :-------------------------------------------------------- |:----------| | ||
| write feature values to the online store | yes | | ||
| read feature values from the online store | yes | | ||
| update infrastructure (e.g. tables) in the online store | yes | | ||
| teardown infrastructure (e.g. tables) in the online store | yes | | ||
| generate a plan of infrastructure changes | no | | ||
| support for on-demand transforms | yes | | ||
| readable by Python SDK | yes | | ||
| readable by Java | no | | ||
| readable by Go | no | | ||
| support for entityless feature views | yes | | ||
| support for concurrent writing to the same key | yes | | ||
| support for ttl (time to live) at retrieval | yes | | ||
| support for deleting expired data | yes | | ||
| collocated by feature view | no | | ||
| collocated by feature service | no | | ||
| collocated by entity key | yes | | ||
To compare this set of functionality against other online stores, please see the full [functionality matrix](overview.md#functionality-matrix). | ||
21 changes: 21 additions & 0 deletions
21
...python/docs/source/feast.infra.online_stores.contrib.hazelcast_online_store.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
feast.infra.online\_stores.contrib.hazelcast\_online\_store package | ||
=================================================================== | ||
|
||
Submodules | ||
---------- | ||
|
||
feast.infra.online\_stores.contrib.hazelcast\_online\_store.hazelcast\_online\_store module | ||
------------------------------------------------------------------------------------------- | ||
|
||
.. automodule:: feast.infra.online_stores.contrib.hazelcast_online_store.hazelcast_online_store | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: feast.infra.online_stores.contrib.hazelcast_online_store | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
sdk/python/feast/infra/online_stores/contrib/hazelcast_online_store/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Hazelcast Online Store | ||
|
||
This contribution makes it possible to use [Hazelcast](https://hazelcast.com/) as online store for Feast. | ||
|
||
Once the Hazelcast client configuration is given inside `feature_store.yaml` file, everything else | ||
is handled as with any other online store: schema creation, read/write from/to Hazelcast and remove operations. | ||
|
||
## Quick usage | ||
|
||
The following refers to the [Feast quickstart](https://docs.feast.dev/getting-started/quickstart) page. | ||
Only the Step 2 is different from this tutorial since it requires you to configure your Hazelcast online store. | ||
|
||
### Creating the feature repository | ||
|
||
The easiest way to get started is to use the Feast CLI to initialize a new | ||
feature store. Once Feast is installed, the command | ||
|
||
``` | ||
feast init FEATURE_STORE_NAME -t hazelcast | ||
``` | ||
|
||
will interactively help you create the `feature_store.yaml` with the | ||
required configuration details to access your Hazelcast cluster. | ||
|
||
Alternatively, you can run `feast init -t FEATURE_STORE_NAME`, as described | ||
in the quickstart, and then manually edit the `online_store` section in | ||
the `feature_store.yaml` file as detailed below. | ||
|
||
The following steps (setup of feature definitions, deployment of the store, | ||
generation of training data, materialization, fetching of online/offline | ||
features) proceed exactly as in the general Feast quickstart instructions. | ||
|
||
#### Hazelcast setup | ||
|
||
In order to use [Hazelcast](https://hazelcast.com) as online store, you need to have a running Hazelcast cluster. | ||
You can create a cluster using Hazelcast Viridian Serverless easily or deploy one on your local/remote machine. | ||
See this [getting started](https://hazelcast.com/get-started/) page for more details. | ||
|
||
Hazelcast online store provides capability to connect local/remote or Hazelcast Viridian Serverless cluster. | ||
Following is an example to connect local cluster named "dev" running on port 5701 with TLS/SSL enabled. | ||
|
||
```yaml | ||
[...] | ||
online_store: | ||
type: hazelcast | ||
cluster_name: dev | ||
cluster_members: ["localhost:5701"] | ||
ssl_cafile_path: /path/to/ca/file | ||
ssl_certfile_path: /path/to/cert/file | ||
ssl_keyfile_path: /path/to/key/file | ||
ssl_password: ${SSL_PASSWORD} # The password will be read form the `SSL_PASSWORD` environment variable. | ||
key_ttl_seconds: 86400 # The default is 0 and means infinite. | ||
``` | ||
If you want to connect your Hazelcast Viridian cluster instead of local/remote one, specify your configuration as follows: | ||
```yaml | ||
[...] | ||
online_store: | ||
type: hazelcast | ||
cluster_name: YOUR_CLUSTER_ID | ||
discovery_token: YOUR_DISCOVERY_TOKEN | ||
ssl_cafile_path: /path/to/ca/file | ||
ssl_certfile_path: /path/to/cert/file | ||
ssl_keyfile_path: /path/to/key/file | ||
ssl_password: ${SSL_PASSWORD} # The password will be read form the `SSL_PASSWORD` environment variable. | ||
key_ttl_seconds: 86400 # The default is 0 and means infinite. | ||
``` | ||
#### TTL configuration | ||
TTL is the maximum time in seconds for each feature to stay idle in the map. | ||
It limits the lifetime of the features relative to the time of the last read or write access performed on them. | ||
The features whose idle period exceeds this limit are expired and evicted automatically. | ||
A feature is idle if no get or put is called on it. | ||
Valid values are integers between 0 and Integer.MAX_VALUE. | ||
Its default value is 0, which means infinite. | ||
```yaml | ||
[...] | ||
online_store: | ||
[...] | ||
key_ttl_seconds: 86400 | ||
``` | ||
### More info | ||
You can learn about Hazelcast more from the [Hazelcast Documentation](https://docs.hazelcast.com/home/). | ||
Empty file.
Oops, something went wrong.