Ingesting Data into Feature Store by Streaming and Batch
This lesson explains how features reach Feature Store through streaming writes or batch ingestion, and how the choice depends on freshness and where the features are computed.
Learning outcomes
After completing this lesson, you will be able to:
- Write records with PutRecord for streaming ingestion.
- Load data in batches with the SDK and processing jobs.
- Handle event time, consistency and backfills.
Streaming ingestion with PutRecord
The PutRecord API writes one record at a time to a feature group. The record is available in the online store immediately and is replicated to the offline store, typically within minutes. Because each call writes a single record, PutRecord suits streaming pipelines that update features as events happen.
Streaming pipelines call PutRecord from Lambda functions triggered by Kinesis events, from Amazon Managed Service for Apache Flink applications that compute aggregates such as a user's purchases in the last hour, or directly from application code. This keeps online features only seconds old, which real-time models such as fraud detection depend on.
import boto3
fs = boto3.client("sagemaker-featurestore-runtime")
fs.put_record(
FeatureGroupName="card-features",
Record=[
{"FeatureName": "card_id", "ValueAsString": "c-1029"},
{"FeatureName": "event_time", "ValueAsString": "2026-10-17T09:15:00Z"},
{"FeatureName": "txn_count_10m", "ValueAsString": "4"},
{"FeatureName": "txn_sum_10m", "ValueAsString": "312.50"},
],
)Batch ingestion
For large historical or periodic loads, the SageMaker Python SDK's FeatureGroup.ingest() writes a pandas DataFrame using multiple workers. The Feature Store Spark connector ingests DataFrames from Glue, EMR or SageMaker AI processing jobs. Data Wrangler flows can export directly to a feature group, and SageMaker Pipelines can run these as steps. When only the offline store is needed, data can be written to the offline store directly for historical backfills.
The following table summarises the ingestion methods.
| Method | Freshness | Typical source |
|---|---|---|
| PutRecord API | Seconds | Lambda, Flink, application code |
| SDK ingest() from pandas | Batch | Notebooks, processing jobs |
| Spark connector | Batch at scale | Glue, EMR, processing jobs |
| Data Wrangler export | Batch | Visual data flows |
The following diagram shows two feature groups that are updated at different rates, a nightly batch job for customer profiles and a streaming job for session features, and their update paths.

Choose the ingestion path
Event time, consistency and backfills
Every record carries an event time, the moment the feature values became true, which is distinct from the time the record was written. The online store keeps the record with the latest event time for each identifier, so a late-arriving record with an older event time does not overwrite newer values. The offline store keeps every record, which is what makes point-in-time joins possible: for a label at a given date, the join selects the latest feature record whose event time is before that date.
Setting event times correctly is therefore essential. A batch job that recomputes yesterday's customer attributes should stamp the records with the time the underlying data refers to, not the time the job ran; otherwise point-in-time joins can pair labels with features that were not yet available, or miss features that were.
A backfill loads historical feature values when a new feature group is created or a new feature is added. Because training needs history while online inference needs only current values, large historical loads are often written to the offline store only, with the latest values ingested into the online store. Online replication to the offline store is asynchronous, so a training job that queries the offline store immediately after a large streaming write may not see the newest records yet; pipelines that depend on fresh offline data should allow for that delay.
The following diagram shows how each store treats a late record.

Event time
Hybrid feature freshness
A recommendation model uses two kinds of features: slow-moving customer attributes (lifetime value, favourite category), recomputed daily over 50 million customers, and fast-moving session features (items viewed in the last 5 minutes).
- A nightly Glue job computes customer attributes and ingests them with the Spark connector into
customer-profile. - A Flink application computes session features from the clickstream and calls PutRecord on
customer-session. - At inference, the service calls BatchGetRecord on both feature groups for the customer ID.
Separating the two update rates into two feature groups keeps the expensive daily computation in batch and the cheap, frequent updates in streaming, while inference reads both in one call.
How are features updated in real time?
Show answer
With the PutRecord API, called for example from Lambda or Flink.
Exam Tips
Remember for the exam
- Real-time feature updates: PutRecord from Lambda or Flink.
- Large batch loads: SDK ingest() or the Spark connector.
- Data Wrangler flows can export to a feature group.
- Records written online replicate to the offline store.
- Separate feature groups for different update rates.