CertSafari
    Snowflake SnowPro Advanced: MLOps Engineer (MLA-B01)· Lessons

    Domain 1 · Lesson 3/17

    Offline/online and Dev/Prod feature consistency

    Ensure temporal integrity and feature consistency.

    10 min read
    4% of exam
    5 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Explain how one feature view definition feeds both the offline store and online serving
    • Estimate how stale online values can be from refresh_freq and target_lag
    • Compare offline and online reads for the same keys without timezone artefacts
    • Check that Dev and Prod produce the same feature values after promotion

    1.One feature definition, two stores

    Training-serving skew is the online version of leakage. Leakage means a training row carries a feature value the model could not have known at prediction time. A point-in-time read avoids it by returning, for each row's timestamp, the latest feature value at or before that timestamp. Skew is the mirror failure: the model was trained on one set of values and is served slightly different ones. The Feature Store avoids this by design. Online serving is not a second pipeline. It is a setting on the same feature view whose offline table builds the training sets. Values computed offline are synchronized to the online store, which keeps the latest row per entity key for millisecond reads. Once registered, the pipeline definition cannot change, so the logic producing those values stays the same for as long as the feature view exists.

    You turn online serving on with an OnlineConfig on the feature view. store_type=OnlineStoreType.POSTGRES selects the Online Feature Store. If you leave store_type out, you get hybrid-table online serving, which syncs from the offline store in the same way. One consistency detail matters for hybrid tables. If the source has several rows with the same key, specifying timestamp_col makes Snowflake keep the row with the most recent timestamp. Without it, whichever row was processed last wins, and that may not be the row an offline point-in-time read would choose.

    The two settings that decide how fresh online values are
    SettingWhat it controlsRange or default
    refresh_freqHow often the offline dynamic table refreshes from source dataTime delta (minimum 1 minute) or cron expression
    OnlineConfig.target_lagHow often offline values sync to the online store; not used for stream feature views10 seconds to 8 days; default 10 seconds
    OnlineConfig.store_typeOnline store implementationDefault OnlineStoreType.HYBRID_TABLE; POSTGRES for the Online Feature Store

    Because the lags add up, an online value can briefly trail the offline table it came from. A consistency check that runs right after a refresh can report a mismatch that will resolve itself. Compare only after roughly refresh_freq + target_lag has passed. Background sync also has a failure mode to watch: if the online refresh fails five times in a row, the online table is suspended, and it serves increasingly stale values until you fix the cause using its refresh history.

    Checkpoint 1 of 3· Match them up

    A feature view serves the same features offline and online. Match each setting to what it controls.

    Tap a term, then the definition that fits it.

    Sources123

    2.Verifying that online values match training values

    The direct parity test reads the same entity keys from both stores and compares them. read_feature_view accepts store_type. An offline read gives the values that training sets are built from, and an online read gives what inference will receive. The online store holds only the latest row per key, so compare it against the latest offline value for each key, not against a historical training row.

    Reading the same keys from online storagepython
    fs.read_feature_view(
        feature_view=fv,
        keys=[["entity_key_1"], ["entity_key_2"]],
        feature_names=["FEATURE_A", "FEATURE_B"],
        store_type=StoreType.ONLINE,
    )

    Session timezone can produce a false mismatch, because the two stores do not share one rule for reading timestamps. The Postgres-backed online store treats timestamps as UTC. An offline read of a TIMESTAMP_NTZ or TIMESTAMP_LTZ column depends on the session TIMEZONE parameter, and offline-only or hybrid-table feature views can store other timestamp types, so an offline read cannot always assume UTC. The SDK does not report which timezone applied. Suspect this whenever the session is not already UTC and the feature view uses those timestamp types, including stream feature views synced to the offline store. The typical symptom is an offline count of 0 for a key where the online store shows a positive value. Set the session to UTC before any offline read you plan to compare.

    Pin the session timezone before reading offlinesql
    ALTER SESSION SET TIMEZONE = 'UTC';

    Feature groups prevent skew in column selection as well as in values. If production reads a bundle with read_feature_group, pass the same group to generate_training_set through the feature_group parameter. The training set then has exactly the columns that online reads return. It only works when every member feature view has online serving with store_type=OnlineStoreType.POSTGRES.

    Checkpoint 2 of 3· Check yourself

    During a parity check on a Postgres-backed feature view, an online read for key U17 shows TXN_COUNT = 4. The offline read for U17 returns 0. The timestamp columns are TIMESTAMP_LTZ and the session runs in America/Los_Angeles. What should you do before you conclude that anything is broken?

    Sources24

    3.Checking Dev and Prod produce identical features

    After a feature pipeline is promoted across Dev/Test/Prod, the question is whether Prod computes the same values that Dev did for the same entities at the same timestamps. The snow feature command group, part of Snowflake CLI, is a declarative workflow for that promotion. You describe entities, data sources and feature views as YAML files (with SQL or Python for the transformation) in a project directory, then deploy them in two steps. snow feature plan compares the local definitions with what is deployed in the target and shows what would be created, updated or deleted. Nothing changes until snow feature apply creates or updates those objects. Both environments are built from one set of source files. manifest.yml lists the targets, and source specs can leave out database and schema because the planner fills in whichever target you select. Any difference between Dev and Prod must therefore come from deployed state or data, not from copied definitions.

    One project, several deployment targetsyaml
    manifest_version: 1
    type: feature_store
    default_target: dev
    targets:
      dev:
        account_identifier: MY_ORG-MY_ACCOUNT-DEV
        database: MY_FS
        schema: FEATURES
        role: DATA_SCIENTIST
      staging:
        account_identifier: MY_ORG-MY_ACCOUNT-STAGING
        database: MY_FS
        schema: FEATURES
        role: FS_ADMIN
      prod:
        account_identifier: MY_ORG-MY_ACCOUNT-PROD
        database: MY_FS
        schema: FEATURES
        role: FS_ADMIN

    Check in layers, from definitions to values. These checks together catch drift before a model is promoted:

    • Definition drift: run snow feature plan --target prod after applying. The planner compares local definitions with the deployed state, so an empty diff means Prod matches the reviewed files.
    • Deployed state: run snow feature describe, which shows the deployed state of an entity or feature view, on each feature view in both targets and compare the results.
    • Value drift: run generate_training_set in Dev and in Prod with the same spine of entity IDs and timestamps, both sessions set to UTC, and diff the outputs. For online values, use snow feature query, which reads features for given entity keys from the online store, with the same keys.

    One trap appears when moving from prototype to declarative deployment. Batch feature views in snow feature accept only SQL strings, and streaming ones accept only pandas UDFs. Snowpark DataFrame logic from a Dev notebook therefore has to be rewritten, and a rewrite can silently change results. That is exactly the case where the same-spine value diff earns its keep.

    Checkpoint 3 of 3· Check yourself

    A batch feature view was prototyped in a Dev notebook as a Snowpark DataFrame. The team now wants Prod deployed with the declarative snow feature workflow, and Prod must compute the same values as Dev. Which plan is sound?

    Sources5

    Practise it for real

    Show that an online-enabled feature view serves the same values offline and online for the same keys, and that Prod matches your definitions.

    1. 1.Run ALTER SESSION SET TIMEZONE = 'UTC'; in the session you will read offline from.

      Why: Offline reads can depend on the session timezone, while the Postgres online store uses UTC.

      You should see: The statement succeeds and later offline reads interpret timestamps as UTC.

    2. 2.Call fs.read_feature_view for two or three known entity keys with the offline store type and note the latest value per key.

      Why: These are the values training sets are built from.

      You should see: One latest row per key with the feature columns you requested.

    3. 3.Wait about refresh_freq + target_lag, then call fs.read_feature_view for the same keys with store_type=StoreType.ONLINE.

      Why: The online store trails the offline table by roughly the sum of the two lags.

      You should see: Values identical to the latest offline values for each key.

    4. 4.Run snow feature plan --target prod.

      Why: The planner diffs your local definitions against the deployed Prod state.

      You should see: No pending creates, updates or deletes.

    Stuck? Get a nudge

    If the offline read shows 0 where the online read shows a positive count, check the session timezone before suspecting the sync.

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “It stays integrated with your batch feature pipeline for training while serving the same feature values at inference time.”
      ↩︎ One feature definition, two stores
      “If you don’t specify a timestamp column, the most recently processed row takes precedence.”
      ↩︎ One feature definition, two stores
      “If refresh fails five times in a row, the online table is suspended.”
      ↩︎ One feature definition, two stores
      “the effective lag from source data to the online store is approximately refresh_freq + online_config.target_lag”
      ↩︎ Exam trap 1
      “the effective lag from source data to the online store is approximately refresh_freq + online_config.target_lag”
      ↩︎ Prediction
      “refresh_freq controls how often the offline dynamic table refreshes when source data changes. OnlineConfig.target_lag controls how often those offline values sync to the online store.”
      ↩︎ Checkpoint
    2. 2.
      “A feature view pipeline definition is immutable after it has been registered, providing consistent feature computation as long as the feature view exists.”
      ↩︎ One feature definition, two stores
      “Postgres-backed online stores treat timestamps as NTZ/UTC”
      ↩︎ Verifying that online values match training values
      “The SDK does not currently indicate which timezone applies on read.”
      ↩︎ Verifying that online values match training values
      “feature values can depend on the session TIMEZONE parameter”
      ↩︎ Exam trap 2
      “Until timezone-aware offline reads are available, set the session timezone to UTC before reading offline”
      ↩︎ Checkpoint
    3. 3.
      “selects the most recent snapshot row for each entity key at or before the spine timestamp”
      ↩︎ One feature definition, two stores
    4. 4.
      “This reproduces the same columns offline that read_feature_group returns online, reducing training-serving skew.”
      ↩︎ Verifying that online values match training values
      “All source feature views in the group must have online serving enabled with store_type=OnlineStoreType.POSTGRES.”
      ↩︎ Verifying that online values match training values
    5. 5.
      “Source files under sources/ can omit the database and schema keys.”
      ↩︎ Checking Dev and Prod produce identical features
      “The planner compares your local project definitions against the deployed state in the target environment”
      ↩︎ Checking Dev and Prod produce identical features
      “Nothing is applied until you explicitly run snow feature apply.”
      ↩︎ Checking Dev and Prod produce identical features
      “Snowpark DataFrame has no declarative equivalent.”
      ↩︎ Exam trap 3
      “Any logic you built with Snowpark must be reimplemented as SQL or pandas to use snow feature plan and snow feature apply.”
      ↩︎ Checkpoint

    Ready to test yourself?

    Practise the 15 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.