Skip to content
About Me
----

MLOps Architecture & Foundations: From DevOps to Continuous Training

Architect Key Takeaways

Production guide to Machine Learning Operations (MLOps), comparing DevOps vs MLOps, Continuous Training (CT), Feature Stores, reproducible pipelines, and preventing training-serving skew.

MLOps Architecture & Foundations: From DevOps to Continuous Training

Section titled “MLOps Architecture & Foundations: From DevOps to Continuous Training”

In traditional software development, DevOps solved the continuous delivery of deterministic code. If the unit tests pass and the container builds, the application behavior is predictable.

Machine Learning systems are fundamentally different: their behavior depends not only on Code, but on the dynamic interplay of Code + Data + Model Parameters. A model deployed today with 98% accuracy can silently degrade to 60% accuracy next month without a single line of code changing—a phenomenon known as Model Decay or Drift.

MLOps (Machine Learning Operations) is the engineering discipline that bridges data science and DevOps to automate the continuous training, evaluation, validation, deployment, and monitoring of ML systems in production.

Enterprise MLOps Architecture Lifecycle


1. DevOps vs MLOps: The Core Architectural Shift

Section titled “1. DevOps vs MLOps: The Core Architectural Shift”
Dimension Traditional DevOps Enterprise MLOps
Core Artifact Compiled Binaries & Container Images Code + Large Datasets + Hyperparameters + Model Weights
Testing Scope Unit, Integration, SAST, DAST, E2E Data Validation, Feature Skew, Model Accuracy, Bias, Latency
Deployment Trigger Code commit / Git tag Code commit, New Data Arrival, or Automated Drift Trigger
Continuous Integration (CI) Linting, building containers, running tests Validating data schemas, building feature sets, running test runs
Continuous Delivery (CD) Deploying service container to Kubernetes Deploying model prediction pipelines, canary model endpoints
Continuous Training (CT) Non-existent (code doesn’t self-train) The defining pillar of MLOps: Automated retraining on fresh data

2. The Three MLOps Maturity Levels (Google Cloud Standard)

Section titled “2. The Three MLOps Maturity Levels (Google Cloud Standard)”

Organizations transition through three distinct maturity stages:

Level 0: Manual Process (Data Science Silo)

Section titled “Level 0: Manual Process (Data Science Silo)”
  • Data extraction, feature engineering, model training, and validation are driven by manual Jupyter Notebook scripts.
  • Transition from research to production requires software engineers to rewrite Python code into C++/Java or wrap .pkl files in Flask APIs.
  • No automated retraining; models are updated only when customer complaints trigger an ad-hoc panic.

Level 1: Automated ML Pipeline (Continuous Training - CT)

Section titled “Level 1: Automated ML Pipeline (Continuous Training - CT)”
  • The model training pipeline is fully containerized and orchestrated (e.g., via Kubeflow Pipelines or AWS SageMaker Pipelines).
  • Triggers for retraining are automated: scheduled cron jobs, new dataset thresholds, or performance degradation alerts.
  • Data validation occurs before training, failing fast if schema anomalies or missing values are detected.

Level 2: Full CI/CD/CT Automated Lifecycle

Section titled “Level 2: Full CI/CD/CT Automated Lifecycle”
  • Automated CI pipeline builds, tests, and packages pipeline components.
  • Automated CD deploys new model prediction microservices via Canary and Shadow traffic.
  • Real-time feature stores eliminate training-serving skew.
  • In-flight monitoring continuously calculates Population Stability Index (PSI) and Kolmogorov-Smirnov (KS) tests to detect data drift and automatically kick off Level 1 retraining pipelines.

3. Eliminating Training-Serving Skew: The Role of Feature Stores

Section titled “3. Eliminating Training-Serving Skew: The Role of Feature Stores”

The most common failure in enterprise ML is Training-Serving Skew—where features computed during offline training (batch SQL queries in Snowflake/BigQuery) differ subtly from features calculated in live production APIs (real-time stream).

A modern Feature Store provides a dual-storage abstraction:

  1. Offline Store (Parquet, S3, Snowflake): Retains historical data snapshots for training with point-in-time correctness, preventing data leakage.
  2. Online Store (Redis, DynamoDB): Stores the latest feature values with sub-10ms lookup latency for real-time inference microservices.
from feast import FeatureStore
# Initialize feature store pointing to enterprise repository
store = FeatureStore(repo_path=".")
# 1. Offline Training: Fetch historical features with point-in-time correctness
training_data = store.get_historical_features(
entity_df=orders_df,
features=[
"user_features:daily_transaction_count",
"user_features:average_order_value_30d",
"risk_features:failed_login_attempts_1h",
]
).to_df()
# 2. Online Production API: Low-latency sub-10ms feature retrieval
online_features = store.get_online_features(
features=[
"user_features:daily_transaction_count",
"user_features:average_order_value_30d",
"risk_features:failed_login_attempts_1h",
],
entity_rows=[{"user_id": 984521}]
).to_dict()

Git is designed for text source code, not gigabyte-sized CSVs or multi-terabyte image training datasets. Committing raw datasets or model weights directly into Git leads to repository corruption.

DVC (Data Version Control) solves this by storing metadata pointers (.dvc files) in Git while uploading the actual heavy binary data to cloud object storage (AWS S3, Google Cloud Storage, or MinIO):

data/fraud_transactions_2026.parquet.dvc
# 1. Track large training dataset with DVC
dvc add data/fraud_transactions_2026.parquet
git add data/fraud_transactions_2026.parquet.dvc .gitignore
git commit -m "feat(data): version Q1 2026 fraud training dataset"
# 3. Push binary data to corporate AWS S3 bucket
dvc remote add -d s3remote s3://enterprise-mlops-datasets/fraud-detection/
dvc push

Any engineer can now run git checkout <commit-hash> && dvc pull to reproduce the exact dataset used to train any historical model.


5. Architectural Best Practices for MLOps Engineers

Section titled “5. Architectural Best Practices for MLOps Engineers”
  1. Decouple Model Training from Serving: Never train models inside the serving container. Training runs on ephemeral GPU worker clusters (Ray / Kubeflow), while serving runs on lightweight inference endpoints (Triton / KServe).
  2. Enforce Semantic Model Versioning: Every registered model must contain explicit metadata linking to:
    • The exact Git commit of the training code.
    • The exact DVC commit hash of the input dataset.
    • The training run UUID in MLflow/Weights & Biases.
  3. Automate Data Validation Gates: Use libraries like Great Expectations to assert schema types, missing value percentages, and value ranges before starting expensive multi-node GPU training jobs.