SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
  • Batch vs Stream Processing
  • Change Data Capture (CDC)
  • MapReduce
  • ETL Pipelines
  • Data Lakes
  • Data Warehousing
  • Data Lakehouse
  • Lambda Architecture
  • Kappa Architecture
  • Streaming Engines
  • Spark and Hadoop
  • Workflow Orchestration (Airflow)
  • Parquet and Columnar File Formats
  • Data Governance and Feature Stores
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Advanced Data Topics/Big Data Processing

Data Governance and Feature Stores

Who owns the data, who may use it, and one shared place for the inputs of machine learning models.

⏱ 12 min readIntermediateHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

Data governance is the set of rules and tools that answer: who owns this data, what does it mean, who may use it, how good is it, and how long do we keep it? A feature store is one governed place for the inputs of machine learning models, so training and live predictions use the same numbers.

  • Governance basics: ownership, a data catalog, lineage, quality checks, access control, PII tags and retention.
  • Feature store: an offline store (big, for training) and an online store (fast, for serving), fed from one feature definition.
  • The big win: no more "it worked in training but is wrong in production" (training/serving skew).

02Concept: What is it?

As a company grows, data spreads over many tables, files and teams. Soon nobody knows which table is the right one, what a column means, whether it holds personal data, or what breaks if it changes. Governance is how you keep that under control. It is a mix of people (an owner for each dataset), process (rules for access and retention) and tools (catalogs, lineage, quality checks).

The main parts of governance

PartThe question it answersExample
OwnershipWho is responsible for this data?The payments team owns the orders table
Data catalogWhat data exists, and what does it mean?A searchable page for each table with a description
LineageWhere did it come from, and what uses it?Orders feeds the revenue dashboard and the churn model
Data qualityCan I trust it?No null customer IDs, row counts within normal range
Access control and classificationWho may see it, and is it sensitive?Email is tagged PII, only support staff can read it
Retention and deletionHow long do we keep it?Delete clickstream after 13 months, honour deletion requests
Data contractWhat do producers promise to consumers?Column names, types and meaning will not change without notice

Feature stores in one picture

A feature is a number a model uses as input, for example "orders in the last 7 days". Training needs that number for millions of past moments, in bulk. A live app needs it for one customer in a few milliseconds. A feature store keeps both: an offline store (a warehouse or files such as Parquet) and an online store (a fast key-value database), both filled from one definition.

One definition, two stores
📥Raw dataevents, tables
→↓feature definition
🧮Feature pipelinewritten once
→↓writes to both
🗄️Offline storehistory, for training
⚡Online storelatest value, for serving
The same code makes the feature for training and for serving, so the two cannot drift apart.
🧠Governance is not only about saying no
Good governance makes data easier to find and trust, as well as safer. A catalog that works saves more time than any rule costs.

03Real-Life Example

🍵The Library and the Recipe Card
A big library has a catalog so you can find a book, a librarian in charge of each section (the owner), a restricted shelf for rare items (access control), and a rule that old newspapers are thrown away after a year (retention). Now picture a restaurant chain. If every kitchen writes its own version of a recipe, the dish tastes different in every city. A feature store is one master recipe card that every kitchen copies exactly: training kitchen and serving kitchen make the same dish.
Library and kitchens
Governance and feature stores
The catalog
A data catalog
The librarian of a section
A data owner or steward
The restricted shelf
Access control on PII
Throw away old newspapers
Retention and deletion rules
Where did this book come from?
Data lineage
One master recipe card
One shared feature definition
Every kitchen follows the card
Offline and online stores use the same code
The dish tastes different in each city
Training/serving skew

04Why Do We Need It?

🔎Find and trust data
A catalog and owners mean people stop guessing which table is right.
🛡️Protect sensitive data
Tags and access rules keep personal data away from people who should not see it.
⚖️Meet legal rules
Privacy laws such as GDPR and CCPA ask you to know what you hold, why, and for how long. Check the exact rules with your legal team.
🧯Safer changes
Lineage shows who is hit when a table changes, before you break them.
🎯Models that match production
A feature store gives training and serving the same numbers.
♻️Reuse features
A feature built once by one team can be used by many models.
Governance makes data findable, trusted and safe. A feature store applies the same discipline to the inputs of machine learning.

05Where Do We Use It?

🏦Banks and insurers
Strict rules on who sees customer data, and audit trails for every access.
🏥Healthcare
Patient data is classified and limited, and many records must be kept or deleted on a fixed schedule.
🛒E-commerce
Fraud and recommendation models need fresh features in milliseconds at checkout.
🚗Ride and delivery apps
Live features such as “drivers nearby in the last minute” for pricing and matching.
📊Data platforms
A catalog and lineage over the lake and warehouse, so analysts can find and trust tables.
🤖ML platforms
Shared features, versioned definitions and point-in-time correct training sets.

06Types / Parts / How It Works

Offline store and online store

Offline storeOnline store
Used forTraining, backfills, analysisLive predictions
HoldsFull history of feature values over timeThe latest value for each key
Typical storageWarehouse tables, Parquet files on object storageKey-value or in-memory database
Read patternLarge scans, many rowsOne key lookup, a few milliseconds
Updated byBatch jobsStreaming jobs, or copied from the offline store

Two ideas that matter

Skew and point-in-time joins
Training/serving skew
🧑‍💻Training codecounts days 3 to 10
🧑‍🔧Serving codecounts days 4 to 9
Two copies drift apart
Point-in-time join
🕒Row for 1 Marchonly features known on 1 March
🚫No peekingno data from after the label
Avoids data leakage
Both are about making training data honest.
The problem The fix

Governance building blocks

BlockWhat it isTypical tools (examples)
Data catalogA searchable inventory with descriptions and ownersDataHub, Amundsen, cloud catalogs
LineageA graph of how data moves between jobs and tablesOpenLineage, catalog lineage views
Quality checksAutomatic tests on freshness, nulls, ranges, duplicatesGreat Expectations, dbt tests
ClassificationTags such as PII, public, confidentialCatalog tags, cloud data-loss-prevention scanners
Access controlRole-based rules, masking and row filtersWarehouse roles, policy engines
Feature storeManaged offline and online feature tablesFeast, Tecton, Databricks and SageMaker feature stores
VisualizerSkew, lineage and PII tagsIn demo 1, switch between “Each team writes its own code” and “One shared feature definition” and compare the training and serving values. In demo 2, click different steps to see what a change would reach and where personal data lives.
Pick a demo
How is the feature “orders in the last 7 days” computed?
One customer's orders. The model is used today, on day 10.
Day 1
not in training
not in serving
Day 3
counted in training
not in serving
Day 5
counted in training
counted in serving
Day 9
counted in training
counted in serving
Day 10
counted in training
not in serving
Offline store (training)
Window: day 3 to day 10, both ends included
4 orders
Online store (serving)
Re-written by another team: day 4 to day 9
2 orders
Value seen in training
4
Value seen in serving
2
Training/serving skew
2 off
The model learned from a feature that counted 4 orders, but in production it is given 2. Nobody changed the model; two copies of the same idea drifted apart (one includes the end days, one does not). Accuracy drops and nobody gets an error message.

A tiny, fixed example, not real data. In real systems, catalogs and lineage tools read this graph from pipeline metadata, and feature stores such as Feast, Tecton and cloud-vendor feature stores keep the offline and online copies in sync.

07How to Use It / Steps / Implementation

Starting governance without a big program

  1. 1
    Name an owner for every important dataset
    A person or team, not “the data team”. They answer questions and approve access.
  2. 2
    Write down what the data means
    A short description for each table and column, in a catalog people can search.
  3. 3
    Tag sensitive columns
    Mark PII and other restricted fields, and turn on masking or limited access for them.
  4. 4
    Track lineage
    Record which jobs read and write which tables, so you can see the impact of a change.
  5. 5
    Add automatic quality checks
    Test freshness, nulls and ranges in every pipeline run, and alert on failure.
  6. 6
    Set retention and deletion rules
    Decide how long each kind of data is kept, and automate the clean-up.
  7. 7
    Publish data contracts
    Producers promise stable columns and meaning, and consumers are told before a change.

Adding a feature store

  1. 1
    Define each feature once
    Name it, give it a key (such as customer_id), a source and a transformation, and put it under version control.
  2. 2
    Compute it into the offline store
    A batch job fills history, so you can build training sets.
  3. 3
    Copy or stream the latest values to the online store
    Keep a key-value copy for fast lookups.
  4. 4
    Build training sets with point-in-time joins
    Each training row only sees features that were known at that row’s time.
  5. 5
    Serve by key
    The live app asks for features by customer ID and gets the latest values in milliseconds.
  6. 6
    Monitor freshness and drift
    Alert if the online store falls behind, or if values drift from their training range.
💡Start small
You do not need a feature store for one model with a few features. Add one when several models share features, or when skew starts to hurt.

08Key Terms to Know

TermMeaning in easy words
Data governanceRules, roles and tools for managing data: ownership, quality, access and retention
Data owner / stewardThe person or team responsible for a dataset
Data catalogA searchable inventory of datasets with descriptions and owners
LineageThe record of where data came from and where it goes
PIIPersonally identifiable information, such as name, email or ID number
Data classificationLabelling data by sensitivity, such as public or confidential
RetentionHow long data is kept before it is deleted or archived
Data contractAn agreement between data producers and consumers about format and meaning
FeatureA number or value a model uses as input
Feature storeA system that stores, serves and shares ML features
Offline storeThe large historical store used for training
Online storeThe low-latency store used for live predictions
Training/serving skewA difference between the feature values seen in training and in production
Point-in-time joinA join that uses only data known at the time of each training example
BackfillComputing a feature for past dates, so it can be used for training

09Pros, Cons and Trade-offs

✅ Pros
  • People can find and trust data
  • Sensitive data is protected and tracked
  • Changes are safer because impact is visible
  • Features are reused, not rebuilt
  • Training and serving match, so models behave in production as they did in tests
⚠️ Cons
  • Takes people time and discipline
  • Catalogs go stale without ownership
  • Too many rules slow teams down
  • A feature store adds systems to run
  • Two stores must be kept in sync

Trade-offs

ChoiceWe gainWe lose
Strict central controlSafety and consistencySpeed and team freedom
Federated ownership by domainFaster teams, closer to the dataNeeds shared standards to stay consistent
Feature storeNo skew, reuse, point-in-time correctnessMore infrastructure and process
Each model computes its own featuresSimple at the startDuplicates, drift and skew later
Streaming featuresFresh valuesMore complex than batch

10Common Problems and Mistakes

Common mistakes

  1. No owner. A dataset nobody owns has no description, no quality checks and no one to ask.
  2. A catalog nobody updates. Stale descriptions are worse than none.
  3. Treating governance as a one-off project. It is a habit, not a launch.
  4. Copying PII into many places. Every copy needs the same protection and the same deletion.
  5. Computing features twice. Separate training and serving code drifts apart, as in the demo.
  6. Leaking the future into training. Joining on the latest value instead of the value at that time makes the model look better than it is.
  7. Letting the online store go stale. The model then predicts from old data without any error.

Things to watch

🔴Deletion requests
If a person asks to be deleted, you must find every copy. Lineage and tags make that possible.
🕒Freshness
Track how old the online value is, and alert when it is older than the model expects.
🧭Feature versions
Changing a feature’s meaning silently changes every model that uses it. Version it.
🔑Over-wide access
Give each role the least data it needs, and mask what it does not need to see.

11Real-World Examples

🧰Feast
An open-source feature store that manages offline and online stores from one set of definitions.
🏢Tecton
A managed feature platform, built by people who worked on Uber’s Michelangelo ML platform.
☁️Cloud feature stores
Databricks, Amazon SageMaker and Google Vertex AI each offer a managed feature store.
🔍DataHub and Amundsen
Open-source data catalogs with search, ownership and lineage, from LinkedIn and Lyft.
✅Great Expectations and dbt tests
Tools that run data quality checks inside pipelines.
📜Privacy rules
Laws such as GDPR and CCPA are a main reason companies track personal data and retention.
📝Note
Product names are examples only. Features, names and ownership of tools change, so check the current documentation before choosing one.
Mini case: a fraud model at checkout
💳Checkoutneeds a score in 50 ms
→↓lookup by customer ID
⚡Online storeorders_last_7d = 4
→↓same value as training
🤖Fraud modeltrained on offline store
The same feature definition fills both stores. The live call reads from the online store.

12Related Topics to Read Next

Data Lakes→

Where much of the data that governance covers is kept.

Data Warehousing→

The usual home of the offline feature store.

Data Lakehouse→

Adds tables and rules on top of a lake, which governance builds on.

Parquet and Columnar File Formats→

The file format of most offline stores.

ETL Pipelines→

The pipelines that produce features and datasets.

Workflow Orchestration (Airflow)→

Schedules feature jobs and quality checks.

Key-Value Databases→

The usual form of an online feature store.

Change Data Capture (CDC)→

A way to keep the online store fresh from source changes.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔Governance: owner, catalog, lineage, quality, access, PII tags, retention.
  • ✔Data contract: producers promise columns and meaning to consumers.
  • ✔Feature store: offline store (training) plus online store (serving).
  • ✔One definition: fills both stores, so there is no training/serving skew.
  • ✔Point-in-time join: training rows only see data known at that time.
  • ✔Backfill: compute features for past dates to build training sets.
  • ✔Start small: owners, catalog and quality checks first. Add a feature store when features are shared.
  • ✔One line: “Know your data, protect it, and compute each feature once.”
← Previous
Parquet and Columnar File Formats
Next →
Deployment Strategies Overview