Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

DynamoDB

Description

The DynamoDB online store provides support for materializing feature values into AWS DynamoDB.

Getting started

In order to use this online store, you'll need to run pip install 'feast[aws]'. You can then get started with the command feast init REPO_NAME -t aws.

Example

feature_store.yaml
project: my_feature_repo
registry: data/registry.db
provider: aws
online_store:
  type: dynamodb
  region: us-west-2

The full set of configuration options is available in DynamoDBOnlineStoreConfig.

Configuration

Below is an example with performance tuning options:

Configuration Options

Option
Type
Default
Description

region

string

AWS region for DynamoDB

table_name_template

string

{project}.{table_name}

Template for table names

batch_size

int

100

Number of items per BatchGetItem/BatchWriteItem request (max 100)

max_read_workers

int

10

Maximum parallel threads for batch read operations. Higher values improve throughput for large batch reads but increase resource usage

max_batched_result_rows

int

2048

Largest request, in entity rows × feature views, whose feature views are read through shared BatchGetItem requests. Set to 0 to always read one feature view at a time

consistent_reads

bool

false

Whether to use strongly consistent reads (higher latency, guaranteed latest data)

warmup_connections

bool

false

Whether to pre-warm the async connection pool on startup with max_pool_connections concurrent lightweight calls (describe_endpoints)

tags

dict

null

AWS resource tags added to each table

session_based_auth

bool

false

Use AWS session-based client authentication

Performance Tuning

Parallel Batch Reads: When reading features for many entities, DynamoDB's BatchGetItem is limited to 100 items per request. For 500 entities, this requires 5 batch requests. The max_read_workers option controls how many of these batches execute in parallel:

  • Sequential (old behavior): 5 batches × 10ms = 50ms total

  • Parallel (with max_read_workers: 10): 5 batches in parallel ≈ 10ms total

For high-throughput workloads with large entity counts, increase max_read_workers (up to 20-30) based on your DynamoDB capacity and network conditions.

Batched Multi-Feature-View Reads: Each feature view is stored in its own table, and a single BatchGetItem request can read from several tables. When a request spans several feature views, the keys of every view are packed into the same BatchGetItem requests (up to batch_size keys each), which are sent in parallel. A request for 10 feature views and 5 entities therefore costs 1 BatchGetItem call instead of 10, on both the sync and async read paths. Requests larger than max_batched_result_rows (entity rows × feature views) read one feature view at a time instead, because at that size each view already fills requests of its own and holding every view's items at once only raises peak memory. A single-view request is never batched. Set max_batched_result_rows: 0 to turn batching off.

Batch Size: Increase batch_size up to 100 to reduce the number of API calls. However, larger batches may hit DynamoDB's 16MB response limit for tables with large feature values.

Connection Warmup: The DynamoDB async client does not establish actual TCP/TLS connections to the AWS endpoint on initialization. The very first feature retrieval request is penalized with a cold-start overhead (~20ms). Setting warmup_connections: true opens up to max_pool_connections connections during server startup, one per concurrent describe_endpoints call. When DynamoDB is reached through a VPC endpoint, these calls need the dynamodb:DescribeEndpoints permission; without it the connections are still opened, but a warning is logged.

Permissions

Feast requires the following permissions in order to execute commands for DynamoDB online store:

Command

Permissions

Resources

Apply

dynamodb:CreateTable

dynamodb:DescribeTable

dynamodb:DeleteTable

dynamodb:TagResource

arn:aws:dynamodb:<region>:<account_id>:table/*

Materialize

dynamodb.BatchWriteItem

arn:aws:dynamodb:<region>:<account_id>:table/*

Get Online Features

dynamodb.BatchGetItem

arn:aws:dynamodb:<region>:<account_id>:table/*

The following inline policy can be used to grant Feast the necessary permissions:

Lastly, this IAM role needs to be associated with the desired Redshift cluster. Please follow the official AWS guide for the necessary steps here.

Functionality Matrix

The set of functionality supported by online stores is described in detail here. Below is a matrix indicating which functionality is supported by the DynamoDB online store.

DynamoDB

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

no

support for ttl (time to live) at retrieval

no

support for deleting expired data

no

collocated by feature view

yes

collocated by feature service

no

collocated by entity key

no

To compare this set of functionality against other online stores, please see the full functionality matrix.

Last updated

Was this helpful?