A Feast plugin to use Apache Cassandra™ / Astra DB as online store.
Install the plugin alongside Feast with:
pip install feast-cassandra
Once the package is installed, switching online store to Cassandra / Astra DB
is a matter of altering the online_store
key in feature_store.yaml
.
With reference to the Feast quickstart, the minimal steps are:
- (assuming both
feast
and this plugin are installed) - creating a feature repository,
feast init feature_repo
; cd feature_repo
;- editing the
feature_store.yaml
as detailed below; - all subsequent steps proceed as usual.
The only required settings are hosts
and type
. The port number
is to be provided only if different than the default (9042),
and username/password only if the database requires authentication.
[...]
online_store:
type: feast_cassandra_online_store.cassandra_online_store.CassandraOnlineStore
hosts:
- 192.168.1.1
- 192.168.1.2
- 192.168.1.3
keyspace: KeyspaceName
port: 9042 # optional
username: user # optional
password: secret # optional
To point Feast to using an Astra DB instance as online store, an Astra DB token with "Database Administrator" role is required: provide the Client ID and Client Secret in the token as username and password.
The "secure connect bundle" for connecting to the database is also needed: its full path must be given in the configuration below:
[...]
online_store:
type: feast_cassandra_online_store.cassandra_online_store.CassandraOnlineStore
secure_bundle_path: /path/to/secure/bundle.zip
keyspace: KeyspaceName
username: Client_ID
password: Client_Secret
For a more detailed walkthrough, please see the Awesome Astra page on the Feast integration.
The plugin leverages the architecture of Cassandra for optimal performance:
- table partitioning tailored to data access pattern;
- prepared statements.
The author of this plugin acknowledges prior exploratory work by
hamzakpt
and Brian Mortimore,
on which this implementation is loosely based.