ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on AIF-C01

Ingesting data into SageMaker Feature Store

PutRecord, SDK, Spark and Data Wrangler ingestion, and what reaches the online and offline stores.

You know from AI Practitioner

  • Feature Store keeps ML features in an online store and an offline store.
  • The online store serves low-latency lookups. The offline store keeps history in S3.
  • Features are shared between training and serving.
Read the AI Practitioner lesson
Batch job
Stream consumer
PutRecord
Online store
Offline store
S3 and Glue table
latestall records
Batch and stream writers call PutRecord, which fills both stores.
  • PutRecord

    Use for
    Streaming, single records
    Note
    Synchronous call
  • SDK ingest

    Use for
    A dataframe in a notebook
    Note
    Many parallel PutRecord calls
  • Spark connector

    Use for
    Large batch from EMR or Glue
    Note
    Scales with Spark
  • Data Wrangler

    Use for
    Visual flow to features
    Note
    Export from the flow
Four ways to ingest, and when each fits.

1 / 2

  • PutRecord

    Use for
    Streaming, single records
    Note
    Synchronous call
  • SDK ingest

    Use for
    A dataframe in a notebook
    Note
    Many parallel PutRecord calls
  • Spark connector

    Use for
    Large batch from EMR or Glue
    Note
    Scales with Spark

2 / 2

  • Data Wrangler

    Use for
    Visual flow to features
    Note
    Export from the flow
Four ways to ingest, and when each fits.

What it is

Every record needs a record identifier and an event time. The identifier names the entity, such as a customer. The event time says when the values were true, as an ISO-8601 UTC string or seconds since the epoch. A record can be up to 350 KB. The online store keeps only the record with the latest event time per identifier, so a late record with an older time does not overwrite it. The offline store keeps every record.

What it is

The PutRecord API writes one record. It updates the online store at once and the offline store in batches a little later. It is also the call for streaming ingestion: a Lambda function or a Flink job reads a Kinesis or Kafka stream and calls PutRecord. For batch, the SageMaker Python SDK ingest method sends a dataframe with many PutRecord calls in parallel. The Feature Store Spark connector ingests Spark dataframes at scale from EMR or Glue. Data Wrangler can export a flow to Feature Store.

What it is

The offline store is a folder in S3, written as Parquet or as Apache Iceberg tables, with a table in the Glue Data Catalog. Athena queries it, and training jobs read from it. A feature group can have the online store, the offline store or both. Choose both when training needs history and serving needs low latency.

Remember

  • Required: a record identifier and an event time. Record up to 350 KB.
  • PutRecord: one record, online store at once, offline store in batches.
  • Streaming ingestion: Lambda or Flink reads the stream and calls PutRecord.
  • Batch: SDK ingest for dataframes, Spark connector for large volumes, Data Wrangler export.

Remember

  • Online store keeps the latest event time. Offline store keeps every record.
  • Offline store is S3 (Parquet or Iceberg) with a Glue catalog table.

On the exam

  • “Stream clickstream features into the online store” points to PutRecord from a Lambda or Flink consumer.
  • “Ingest a very large Spark dataframe of features” points to the Feature Store Spark connector.
  • “Query the full feature history with SQL” points to the offline store and Athena.