---
title: ML platform for a bank (feature store, registry, deployment)
url: https://gurkanozkan.ai/learn/design/mle-ml-platform-for-a-bank-feature-store-registry-deployment-12/
markdown: https://gurkanozkan.ai/learn/design/mle-ml-platform-for-a-bank-feature-store-registry-deployment-12.md
kind: design
role: ML engineering
json: https://gurkanozkan.ai/api/learn/design/mle-ml-platform-for-a-bank-feature-store-registry-deployment-12.json
---

# ML platform for a bank (feature store, registry, deployment)

Design the internal platform that lets data scientists take a model from notebook to batch and real-time production safely, inside a regulated bank whose production stack is mostly Go microservices.

## Constraints

- 50 data scientists
- 100 production models
- real-time p99 budget 50 ms for payment-path models
- hundreds of features shared across teams

## What to cover

- **Requirements**: Design the internal platform that lets data scientists take a model from notebook to batch and real-time production safely, inside a regulated bank whose production stack is mostly Go microservices.
- **Estimates**: 50 data scientists; 100 production models; real-time p99 budget 50 ms for payment-path models; hundreds of features shared across teams.
- **API**
- **Data model**
- **Architecture**: Monorepo with dataset-creation and training jobs; managed training compute.; Model registry with validation status and lineage.; Feature definitions in SQL (e.g. dbt) materialised offline in the warehouse and synced to an online KV store.; Batch inference via a scheduler (e.g. Airflow) publishing events; real-time Python inference services behind a Go gateway.; Monitoring for systems, features (data tests and freshness alerts) and model performance.; Approval workflow for model risk; self-serve templates.
- **Deep dives**
- **Trade-offs**: build vs buy (Vertex/SageMaker vs custom); framework freedom vs standardisation; a Python model service inside a Go ecosystem; one-off pipelines vs a shared feature store.
- **Evaluation**: Platform metrics: time from notebook to production, number of incidents attributable to the platform, feature reuse rate, p99 inference latency, cost per model.; User satisfaction surveys.

## Reference design

### Requirements

**Functional**: a paved road from notebook to production for both batch and real-time models — reproducible dataset creation and training, shared feature definitions usable offline and online, a model registry with validation status and lineage, deployment (shadow, canary, live) into a Go microservice estate, monitoring, and a model-risk approval workflow.

**Users**: ~50 data scientists who know Python and SQL, not Go or Kubernetes; backend engineers who call models from Go services; model-risk and compliance reviewers.

**Constraints**
- Regulated bank: auditable lineage (which data and code produced which model and decision), approvals proportional to risk (payment and credit decisions vs internal analytics), PRA model risk management expectations, Consumer Duty, explainability where customers are affected.
- Real-time p99 ≤ 50 ms for payment-path models, including feature lookup.
- ~100 production models, hundreds of shared features.
- Existing stack (assumption): GCP, BigQuery, dbt, Airflow, Cassandra, Go microservices, an event bus, Grafana and Looker.

**Success**: time from notebook to production falls from months to weeks for standard models; fewer incidents; features reused rather than rebuilt.


### Estimates

- **Models**: ~100 in production, say 70 batch and 30 real-time; ~10 new or retrained models per week across teams.
- **Real-time traffic**: payment-path models see ~1k requests/s at peak (card authorisations, transfers); other real-time models (chat routing, fraud on logins) a few hundred requests/s combined.
- **Online features**: 10M customers × ~300 features × ~8 bytes ≈ 24 GB of values, ~100 GB with replication and overhead — small for Cassandra; read path p99 5–10 ms for a single-partition lookup.
- **Batch**: ~70 Airflow DAGs nightly; BigQuery scans of a few TB/day for feature materialisation; predictions written back to BigQuery and published as events.
- **Latency budget (payment path, p99 50 ms)**: Go service → gateway 2 ms, feature fetch (one partition read) 10 ms, model inference (GBDT) 5 ms, serialisation and network 5 ms, gateway checks and logging 3 ms → ~25 ms, leaving ~25 ms headroom for tails and retries; a fallback default decision if the model does not answer within ~40 ms.
- **Training compute**: most bank models are GBDTs or small networks trained on CPU in minutes to hours; occasional GPU jobs (text models) on a managed queue.
- **Platform team**: ~6–8 engineers can run this if most components are managed services.


### API

The platform's interfaces are mostly declarative files and CLIs:
```yaml
# features/customer_spend.yml (dbt model + metadata)
entity: customer_id
owner: fincrime-ds
freshness_sla: 1h
online: true
features: [spend_7d, spend_30d, distinct_merchants_30d]
```
```
ml train   --config train.yml           # dataset snapshot + training job, logs lineage
ml register --run r_123 --risk-tier 1   # → registry entry, status "draft"
ml validate --model fraud-auth:v12      # standard checks + validation report
ml deploy  --model fraud-auth:v12 --mode shadow|canary:5%|live
```
Serving contract for Go callers (protobuf over gRPC via the gateway):
```
Predict(model: "fraud-auth", entity_ids, request_features) → {score, version, reason_codes, latency_ms}
```
Batch outputs: BigQuery table per model plus an event `prediction.published` for downstream services.


### Data model

- **FeatureDefinition**: name, entity, SQL/dbt model, owner, version, freshness SLA, online flag, data classification, tests.
- **FeatureValue (online)**: Cassandra partition per entity → feature values with event timestamps.
- **DatasetSnapshot**: query, as-of time, feature versions, row counts, storage URI, hash — point-in-time correct joins.
- **Model**: name, version, artefact URI, framework, training code commit, dataset snapshot, feature list and versions, metrics, risk tier, owner, intended use, limitations.
- **ValidationRecord**: checks run (performance, stability, bias, explainability), validator, findings, status (draft → validated → approved → deployed → retired).
- **Deployment**: model version, environment, mode (shadow | canary | live), traffic share, start/end, rollback reference.
- **PredictionLog**: request id, model version, feature values used, output, latency — basis for audit and for training on logged features.
- **MonitorConfig**: metrics, thresholds, owners, escalation.


### Architecture

```
Monorepo (dataset + training code, templates) ─► CI (tests, lint, data checks)
   ─► Managed training compute (jobs on Kubernetes / Vertex)
   ─► Model registry: artefact, lineage, validation status, risk tier
   ─► Approval workflow (tier 1: independent validation + sign-off;
      tier 3: owner self-approval with automated checks)
Features: dbt SQL in BigQuery (offline, point-in-time) ─► sync job ─► Cassandra (online)
          streaming features for payment path: Go stream processors writing
          to Cassandra, backfilled offline with the same definitions
Serving:
   batch ─► Airflow DAG template: score in BigQuery/Python ─► table + events
   real time ─► Go gateway (auth, timeouts, circuit breaker, schema checks,
                fallback default, logging) ─► Python model service (template,
                autoscaled) ─► Cassandra features
Monitoring: systems (Grafana), features (dbt tests/alerts), model performance
   and drift (Looker dashboards on prediction logs + labels), on-call per model
```


### Deep dives

**Training–serving skew.** The most common real-time failure: a feature computed one way in SQL for training and another way in Go for serving. Mitigations: one definition per feature with tests comparing offline and online values on sampled entities daily; log the features actually used at serving time and train new versions on those logs where possible; point-in-time joins for offline datasets so no future data leaks in.

**Python models inside a Go estate.** Data scientists keep Python; the Go gateway owns everything operational (auth, deadlines, retries, circuit breaking, fallbacks, typed protobuf contracts), so Go services never depend on Python internals. For the strictest latency paths, GBDTs can be compiled (e.g. ONNX or a tree compiler) and served natively from Go, trading framework freedom for a removed network hop.

**Safe deployment.** Shadow first (score real traffic, log only), compare with the incumbent on live data, then canary with automatic rollback on latency or score-distribution alarms, then live. Every deploy and rollback is one command and is recorded against the registry entry for audit.


### Trade-offs

- **Build vs buy (Vertex/SageMaker vs custom)**: managed services reduce platform toil but fit awkwardly with a Go estate, an existing Cassandra store and bank-specific approvals. Buy commodity parts (training compute, experiment tracking), build the thin glue the bank's constraints require.
- **Framework freedom vs standardisation**: freedom speeds research; standard templates (GBDT and PyTorch serving images, one feature API) make 100 models operable by a small team. Allow anything in research, require a template for production.
- **A Python model service inside a Go ecosystem**: Python keeps data scientists productive but adds a hop and a second runtime to operate; contain it behind the gateway, and compile models to native code where latency demands.
- **One-off pipelines vs a shared feature store**: one-off pipelines ship faster for the first model and then duplicate, drift and break; a shared store costs governance effort but gives reuse, consistency and lineage.


### Evaluation

- **Platform metrics**: median time from notebook to production per model type; number of incidents attributable to the platform (vs model logic); feature reuse rate (share of features used by more than one model); p99 inference latency per real-time model against its budget; cost per model (compute, storage, serving).
- **Governance metrics**: share of production models with complete lineage and current validation (target 100%), approval cycle time, overdue revalidations.
- **Model health**: drift and performance dashboards per model with owners; alerts on feature freshness, missing values, score distribution shifts, and outcome metrics once labels arrive.
- **User satisfaction surveys**: quarterly survey of data scientists and backend engineers (ease of deployment, debugging, documentation), plus support-ticket themes driving the platform roadmap.


## What a strong design shows

- Designs the paved road end to end — features, training, registry, approvals, deployment, monitoring — around a Go estate and a regulated bank.
- Keeps one feature definition across offline and online paths and actively tests for training–serving skew.
- Proportions model-risk approvals to risk tier and records lineage for audit.
- Isolates Python serving behind a Go gateway with deadlines, fallbacks and typed contracts, meeting a 50 ms p99 budget.
- Measures the platform by time to production, incidents, reuse, latency and cost, plus user feedback.

---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
