Study guide

3.3 Feature Management with SageMaker Feature Store

AWS Certified Machine Learning Engineer — Associate MLA-C01

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Introduction & Exam Strategy

1.1 AWS MLA-C01 Blueprint, Format & Strategy 1.2 The Machine Learning Engineering Lifecycle on AWS

2 Domain 1: Data Ingestion & Storage Architecture for ML

2.1 Ingesting Batch and Streaming Data for ML 2.2 High-Performance Storage for Training and Inference 2.3 Data Cataloging, Governance, and Querying

3 Domain 1: Feature Engineering & Data Transformation

3.1 Distributed Feature Engineering with AWS Glue & DataBrew 3.2 Interactive Data Preparation with SageMaker Data Wrangler 3.3 Feature Management with SageMaker Feature Store

4 Domain 1: Data Quality, Integrity & Ground Truth Labeling

4.1 Data Validation, Schema Drift, and Quality Rules 4.2 Handling Missing Values, Outliers & Class Imbalance 4.3 Data Labeling with SageMaker Ground Truth & Ground Truth Plus

5 Domain 2: Model Selection & Framework Architecture

5.1 SageMaker Built-in Algorithms & Selection Criteria 5.2 Custom Models with Script Mode and BYOC 5.3 Foundation Models, JumpStart, and Amazon Bedrock

6 Domain 2: SageMaker Model Training & Hyperparameter Optimization

6.1 SageMaker Training Jobs & Cost Optimization 6.2 Distributed Training Strategies & Architectures 6.3 Hyperparameter Optimization with Automatic Model Tuning (AMT)

7 Domain 2: Model Evaluation, Tracking & Model Registry

7.1 ML Evaluation Metrics & Validation Strategies 7.2 Experiment Tracking with SageMaker Experiments 7.3 Model Governance with SageMaker Model Registry

8 Domain 3: SageMaker Inference Options & Endpoint Architecture

8.1 Real-Time, Serverless, and Asynchronous Inference 8.2 High-Throughput Offline Inference with Batch Transform 8.3 Multi-Model Endpoints (MME) & Multi-Container Endpoints (MCE)

9 Domain 3: Deployment Strategies & Infrastructure Scaling

9.1 Production Deployment Patterns & Traffic Shifting 9.2 Endpoint Auto-Scaling & Hardware Acceleration

10 Domain 3: MLOps Pipelines & Workflow Orchestration

10.1 SageMaker Pipelines Core Architecture 10.2 Advanced Pipeline Patterns & Integration 10.3 End-to-End MLOps CI/CD & Automated Retraining

11 Domain 4: Production Model Monitoring with SageMaker Model Monitor

11.1 Data Quality & Model Quality Monitoring 11.2 Model Bias & Model Explainability Drift 11.3 Operational Observability with Amazon CloudWatch

12 Domain 4: Responsible AI, Bias Detection & Governance

12.1 Pre-Training and Post-Training Bias with SageMaker Clarify 12.2 Model Documentation & Auditing with Model Cards & Dashboard 12.3 Safety, Guardrails & Generative AI Governance

13 Domain 4: ML Security, Network Isolation & Cost Optimization

13.1 IAM Roles and Least Privilege for ML 13.2 Network Isolation, VPC Endpoints & Data Encryption 13.3 ML Cost Optimization & Resource Governance

3.3 Feature Management with SageMaker Feature Store

Key Takeaways Explain This Topic AI

Amazon SageMaker Feature Store is a purpose-built repository that unifies feature definitions, ingestion, storage, and discovery across training and inference workflows.

The Online Store is optimized for low-latency, real-time inference with sub-10ms key-value lookups (GetRecord, BatchGetRecord) and optional Time-to-Live (TTL) expiration.

The Offline Store persists historical, immutable feature records in Amazon S3 in Apache Parquet format, partitioned by year/month/day/hour and indexed in the AWS Glue Data Catalog.

Every Feature Group requires a Record Identifier (unique entity key) and an Event Time feature (timestamp) to enforce temporal consistency and prevent lookahead bias/data leakage.

Point-in-time time-travel queries executed via Amazon Athena reconstruct historical feature snapshots as of the exact label observation timestamp, eliminating train-serve skew.

Last updated: August 2026

Feature Management with SageMaker Feature Store

In enterprise machine learning systems, feature inconsistency between training and production inference is one of the leading causes of silent model degradation. This challenge is known as Train-Serve Skew . Furthermore, when training models on historical event logs, computing features using data from after an event occurred introduces Data Leakage (Lookahead Bias) .

Amazon SageMaker Feature Store is a fully managed, purpose-built repository designed to store, update, discover, and serve machine learning features for both real-time inference and offline batch training. +-----------------------------------------------------------------------------------------+

  • | SAGEMAKER FEATURE STORE ARCHITECTURE |
  • | |
  • | +-----------------------------+ |
  • | | INGESTION PIPELINES | |
  • | | - Streaming: PutRecord API | |
  • | | - Batch: IngestionManager | |
  • | | - SageMaker Data Wrangler | |
  • | +-----------------------------+ |
  • | | |
  • | +--------------------+--------------------+ |
  • | | | |
  • | v v |
  • | +---------------------------+ +---------------------------+ |
  • | | ONLINE STORE | | OFFLINE STORE | |
  • | | - In-Memory / DynamoDB | | - Amazon S3 (Parquet) | |
  • | | - Single-digit ms latency | | - Append-only time-series | |
  • | | - GetRecord / BatchGet | | - Glue Catalog & Athena | |
  • | | - Real-Time Inference End | | - Point-in-Time Joins | |
  • | +---------------------------+ +---------------------------+ |
  • | | | |
  • | v v |
  • | [Real-Time SageMaker Endpoints] [SageMaker Model Training Jobs] |
  • +-----------------------------------------------------------------------------------------+
  • 1. Feature Store Core Concepts & Schema Design

A Feature Store organizes features into logical collections representing business entities (e.g., customers, products, transactions, or IoT devices).

Fundamental Components of a Feature Group

Feature Group: A logical container grouping related features for an entity. Each Feature Group contains a defined list of Feature Definitions.

Record Identifier Name: A unique string feature identifying the entity instance (e.g., customer_id , device_uuid , order_number ). Acts as the primary lookup key.

Event Time Feature Name: A timestamp feature indicating the exact moment when the record was observed or generated (e.g., transaction_timestamp , event_time ).

Feature Definitions (Data Types): Feature Store strictly supports three fundamental data types:

String : Text, categorical values, JSON strings.

Integral : Integer numbers ( int32 , int64 , long ).

Fractional : Floating-point numbers ( float , double ). from sagemaker.feature_store.feature_group import FeatureGroup

  • from sagemaker.session import Session
  • import sagemaker

sagemaker_session = sagemaker.Session()

  • # Define Feature Group schema
  • customer_feature_group = FeatureGroup(
  • name="customer-risk-features-v1",
  • sagemaker_session=sagemaker_session
  • )
  • # Load feature definitions from a pandas DataFrame
  • customer_feature_group.load_feature_definitions(data_frame=df)
  • # Create Feature Group spanning both Online and Offline stores
  • customer_feature_group.create(
  • s3_uri="s3://ml-feature-store-lake/offline-store/",
  • record_identifier_name="customer_id",
  • event_time_feature_name="event_timestamp",
  • role_arn=sagemaker_execution_role,
  • enable_online_store=True,
  • online_store_kms_key_id=kms_key_arn,
  • offline_store_kms_key_id=kms_key_arn,
  • disable_glue_table_creation=False
  • )

Important

Mandatory Fields: Every single record written to a SageMaker Feature Group must contain both the RecordIdentifier and EventTime values. Missing either attribute will result in an ingestion validation failure.

2. Online Store vs. Offline Store Deep Dive

SageMaker Feature Store solves the train-serve skew problem by providing dual synchronized storage engines.

Detailed Store Comparison

Attribute Online Store Offline Store

Primary Purpose Real-time low-latency feature lookup during online model inference Historical batch feature storage for model training and time-travel analytics

Storage Backend High-performance key-value store (DynamoDB / In-Memory cache) Amazon S3 (Apache Parquet columnar format)

Read Latency Sub-10 milliseconds (single-digit ms) Seconds to minutes (queried via SQL engines like Amazon Athena)

Access APIs GetRecord , BatchGetRecord Amazon Athena, Amazon Redshift Spectrum, SageMaker Processing

Record Versioning Overwrites to maintain latest feature values only Append-only immutable log of all historical updates across time

Data Partitioning Primary key hashing Partitioned automatically by year/month/day/hour of ingestion

Time-to-Live (TTL) Supported (records expire automatically after duration) Retained indefinitely based on S3 Lifecycle policies

  • Catalog Integration N/A Automatically registered as an AWS Glue Data Catalog table
  • 3. Ingestion Methods: Streaming vs. Batch

Features can be ingested into SageMaker Feature Store using multiple synchronous and asynchronous patterns: +-----------------------------------------------------------------------------------------+

  • | FEATURE INGESTION WORKFLOWS |
  • | |
  • | [Streaming Source] |
  • | Kinesis / Lambda ---> PutRecord API ---------> [ONLINE STORE] |
  • | | |
  • | Async Replication (~15 min) |
  • | v |
  • | [Batch Source] [OFFLINE STORE] |
  • | S3 / Spark / Glue ---> IngestionManager ------> (Amazon S3) |
  • +-----------------------------------------------------------------------------------------+
  • 1. Streaming / Real-Time Ingestion ( PutRecord )

For microsecond-level updates (e.g., streaming credit card transaction volume), microservices or AWS Lambda functions invoke the synchronous PutRecord API. When a record is written:

It is immediately written to the Online Store (available for inference within milliseconds).

It is automatically and asynchronously buffered and written to the Offline Store in S3 within approximately 15 minutes in Parquet format. import boto3

import time

featurestore_runtime = boto3.client('sagemaker-featurestore-runtime')

  • # Real-time feature update via PutRecord
  • response = featurestore_runtime.put_record(
  • FeatureGroupName="customer-risk-features-v1",
  • Record=[
  • {"FeatureName": "customer_id", "ValueAsString": "CUST-98421"},
  • {"FeatureName": "event_timestamp", "ValueAsString": str(time.time())},
  • {"FeatureName": "failed_login_count_1h", "ValueAsString": "4"},
  • {"FeatureName": "transaction_velocity_24h", "ValueAsString": "1285.50"}
  • ]
  • )
  • 2. Batch Ingestion ( IngestionManager )

When bulk loading historical datasets (e.g., initial migration of 100 million records), the SageMaker Python SDK provides IngestionManager , which distributes parallel multi-threaded workers to stream records into the feature group. # Bulk ingestion from a Pandas DataFrame

  • customer_feature_group.ingest(
  • data_frame=historical_df,
  • max_workers=8,
  • wait=True
  • )
  • 3. Real-Time Inference Retrieval ( GetRecord / BatchGetRecord )

During endpoint invocation, the SageMaker inference container retrieves the latest features in single-digit milliseconds: # Single record retrieval for real-time scoring

  • record = featurestore_runtime.get_record(
  • FeatureGroupName="customer-risk-features-v1",
  • RecordIdentifierValueAsString="CUST-98421",
  • FeatureNames=["failed_login_count_1h", "transaction_velocity_24h"]
  • )
  • 4. Point-in-Time Correctness & Time-Travel Queries

When creating training datasets for predictive models, joining training labels with the current feature values introduces severe lookahead bias . For example, if a customer churned on March 1st, using their feature values from June 1st to train the model leaks future data.

Point-in-Time Joins reconstruct the exact state of features as they existed at the moment the observation occurred. +-----------------------------------------------------------------------------------------+

  • | POINT-IN-TIME TIME-TRAVEL JOIN |
  • | |
  • | Customer Event: Loan Application at T = 2026-03-01 14:00 |
  • | |
  • | Feature Updates in Offline Store: |
  • | - Update A: 2026-02-15 10:00 (Credit Score: 680, DebtRatio: 0.35) <-- VALID (Latest) |
  • | - Update B: 2026-03-05 09:00 (Credit Score: 610, DebtRatio: 0.55) <-- LEAKAGE (Drop) |
  • | - Update C: 2026-04-01 12:00 (Credit Score: 590, DebtRatio: 0.62) <-- LEAKAGE (Drop) |
  • +-----------------------------------------------------------------------------------------+
  • Point-in-Time SQL Query in Amazon Athena

Because the Offline Store maintains every historical update as an immutable append-only record, you can query Athena using SQL window functions ( ROW_NUMBER() or DENSE_RANK() ) to retrieve the most recent record on or prior to the observation timestamp: WITH ranked_features AS (

  • SELECT
  • f.customer_id,
  • f.credit_score,
  • f.debt_to_income_ratio,
  • f.event_timestamp,
  • o.observation_timestamp,
  • o.loan_default_label,
  • ROW_NUMBER() OVER (
  • PARTITION BY f.customer_id, o.observation_timestamp
  • ORDER BY f.event_timestamp DESC
  • ) AS rank_num
  • FROM "customer_risk_features_v1" f
  • JOIN "loan_observations" o
  • ON f.customer_id = o.customer_id
  • AND f.event_timestamp <= o.observation_timestamp
  • )
  • SELECT
  • customer_id,
  • observation_timestamp,
  • credit_score,
  • debt_to_income_ratio,
  • loan_default_label
  • FROM ranked_features
  • WHERE rank_num = 1;
  • 5. Security, Governance & Cross-Account Sharing

Encryption at Rest: Both Online and Offline stores support fine-grained encryption using AWS Key Management Service ( AWS KMS ) customer managed keys (CMKs).

Access Control: IAM policies restrict read/write access at the Feature Group level ( sagemaker:CreateFeatureGroup , sagemaker:PutRecord , sagemaker:GetRecord ).

Cross-Account Feature Sharing: Large enterprises organize data engineering in a central account and data science training in separate workload accounts. Feature Groups can be shared securely across accounts using AWS Resource Access Manager (AWS RAM) , allowing consumer accounts to discover and query features without replicating data.

Feature Discovery: Search for existing feature groups, schemas, and lineage across the enterprise catalog directly within the SageMaker Studio UI .