Skip to main content

Chapter 2: MLOps vs DevOps vs DataOps

Understanding the Ops Landscape​

The modern data and software landscape involves multiple "Ops" disciplines. Understanding how they relate and differ is crucial for building effective teams and systems.

Comparison Overview​

Detailed Comparison Table​

AspectDevOpsDataOpsMLOps
Primary FocusSoftware deliveryData pipeline deliveryML model delivery
Main ArtifactApplication codeData productsML models
TestingUnit, integration, E2EData quality, schemaModel validation, A/B
VersioningCode onlyData lineageCode + Data + Models
MonitoringApp metrics, logsData quality metricsModel performance, drift
CI/CD TargetDeploy applicationsDeploy data pipelinesDeploy models
Feedback LoopBug reportsData issuesModel degradation

DevOps: The Foundation​

DevOps focuses on shortening the development lifecycle while delivering features, fixes, and updates frequently.

Core DevOps Practices​

# Example: Standard DevOps CI/CD Pipeline
name: Application CI/CD
on:
push:
branches: [main, develop]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build
run: npm run build

- name: Unit Tests
run: npm test

- name: Integration Tests
run: npm run test:integration

- name: Build Docker Image
run: docker build -t myapp:${{ github.sha }} .

deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to Production
run: kubectl apply -f k8s/

DevOps Tools​

CategoryTools
Version ControlGit, GitHub, GitLab
CI/CDJenkins, GitHub Actions, GitLab CI
ContainersDocker, Podman
OrchestrationKubernetes, Docker Swarm
MonitoringPrometheus, Grafana, Datadog
IaCTerraform, Ansible, Pulumi

DataOps: Managing Data Pipelines​

DataOps applies DevOps principles to data analytics and data engineering workflows.

Core DataOps Practices​

# Example: DataOps Pipeline with Great Expectations
import great_expectations as gx
from great_expectations.core.batch import BatchRequest

# Create data context
context = gx.get_context()

# Define expectations for data quality
validator = context.get_validator(
batch_request=BatchRequest(
datasource_name="my_datasource",
data_connector_name="default_inferred_data_connector",
data_asset_name="sales_data",
),
expectation_suite_name="sales_data_expectations"
)

# Data quality checks
validator.expect_column_values_to_not_be_null("customer_id")
validator.expect_column_values_to_be_between("quantity", min_value=1, max_value=1000)
validator.expect_column_values_to_be_unique("order_id")
validator.expect_column_values_to_match_regex("email", r"^[\w\.-]+@[\w\.-]+\.\w+$")

# Save expectations
validator.save_expectation_suite(discard_failed_expectations=False)

DataOps Tools​

CategoryTools
OrchestrationApache Airflow, Dagster, Prefect
Data QualityGreat Expectations, dbt tests, Soda
Data CatalogDataHub, Amundsen, Apache Atlas
ETL/ELTdbt, Spark, Fivetran
Data LineageOpenLineage, Marquez

MLOps: The Intersection​

MLOps sits at the intersection of DevOps and DataOps, inheriting practices from both while adding ML-specific capabilities.

What MLOps Adds​

MLOps-Specific Challenges​

ChallengeDescriptionSolution
Model ReproducibilitySame code, different resultsSeed fixing, environment locking
Data DriftInput data changes over timeDrift detection, monitoring
Model DecayModel performance degradesContinuous training, alerts
Experiment ManagementTracking many experimentsMLflow, W&B, Neptune
Feature ConsistencyTrain/serve feature mismatchFeature stores

Team Structures​

Option 1: Centralized MLOps Team​

┌─────────────────────────────────────────────────────────┐
│ MLOps Platform Team │
├─────────────────────────────────────────────────────────┤
│ • Owns ML infrastructure │
│ • Provides self-service tools │
│ • Sets standards and best practices │
│ • Supports multiple ML teams │
└─────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ ML Team │ │ ML Team │ │ ML Team │
│ A │ │ B │ │ C │
└─────────┘ └─────────┘ └─────────┘

Pros:

  • Consistent standards
  • Efficient resource utilization
  • Specialized expertise

Cons:

  • Potential bottleneck
  • May not understand specific team needs

Option 2: Embedded MLOps Engineers​

┌─────────────────────────────────────────────────────────┐
│ Product Team A │
├─────────────────────────────────────────────────────────┤
│ Data Scientists (3) + ML Engineer (1) + MLOps (1) │
└─────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────┐
│ Product Team B │
├─────────────────────────────────────────────────────────┤
│ Data Scientists (2) + ML Engineer (2) + MLOps (1) │
└─────────────────────────────────────────────────────────┘

Pros:

  • Deep domain knowledge
  • Fast iteration
  • Direct communication

Cons:

  • Duplicated efforts
  • Inconsistent practices
  • Resource intensive
┌─────────────────────────────────────────────────────────┐
│ Central MLOps Platform Team │
│ (Infrastructure, Tools, Standards, Support) │
└─────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Product │ │ Product │ │ Product │
│ Team A │ │ Team B │ │ Team C │
│ │ │ │ │ │
│ ML Eng ◄──┼───────┼──► Shared │◄──────┼─► ML Eng │
│ │ │ Tools │ │ │
└───────────┘ └───────────┘ └───────────┘

Responsibilities Matrix​

RACI Matrix for ML Project​

ActivityData ScientistML EngineerMLOps EngineerData Engineer
Data CollectionCIIR/A
Feature EngineeringR/ACIC
Model DevelopmentR/ACII
Training PipelineCR/ACI
Model DeploymentICR/AI
MonitoringICR/AC
InfrastructureIIR/AI

Legend: R = Responsible, A = Accountable, C = Consulted, I = Informed

Collaboration Points​

Data Handoff (DataOps → MLOps)​

# Example: Data contract between DataOps and MLOps
data_contract:
name: customer_features
version: 1.2.0
owner: data-engineering@company.com

schema:
customer_id:
type: string
nullable: false
pattern: "^CUS-[0-9]{8}$"

age:
type: integer
nullable: false
min: 18
max: 120

total_purchases:
type: float
nullable: false
min: 0.0

sla:
freshness: 1 hour
availability: 99.9%

delivery:
format: parquet
location: s3://data-lake/features/customer/
update_frequency: hourly

Deployment Handoff (MLOps → DevOps)​

# Example: Model deployment specification
model_deployment:
name: customer-churn-model
version: 2.1.0

container:
image: mlplatform/models:customer-churn-v2.1.0
resources:
cpu: "2"
memory: "4Gi"
gpu: "0"

scaling:
min_replicas: 2
max_replicas: 10
target_cpu_utilization: 70%

endpoints:
health: /health
predict: /predict
metrics: /metrics

monitoring:
latency_p99_threshold_ms: 100
error_rate_threshold: 0.01

Key Takeaways​

Summary
  1. DevOps focuses on application delivery - MLOps extends this to models
  2. DataOps focuses on data quality - MLOps depends on clean, versioned data
  3. MLOps combines both and adds ML-specific practices (experiment tracking, model versioning)
  4. Team structure should match organizational maturity and size
  5. Clear interfaces between teams prevent bottlenecks and confusion

Practical Exercise​

Create a simple comparison document for your organization:

  1. List current DevOps practices
  2. List current DataOps practices (if any)
  3. Identify gaps for MLOps implementation
  4. Propose team structure changes

Next: Chapter 3: The ML Lifecycle