Sub topic 9
Hosting models, cost, and data governance
This chapter assumes you have logged runs with MLflow and Weights & Biases (W&B) as in the earlier chapters. You should also know what a client-server application is and be able to read a shell command and a short Python script. The chapter covers where tracking data lives, who operates the service, what it costs, and which data rules apply. These factors often decide the choice before any feature comparison does.
Three hosting models
Every tracker stores the same kinds of data: small structured records (parameters, metrics, tags) and large blobs (artifacts such as model files, plots, and datasets). Hosting is about who runs the service that stores them and where the bytes physically sit.
| Model | Who operates it | Where data sits | Typical examples |
|---|---|---|---|
| Self-hosted | Your team | Your servers or cloud account | Open-source MLflow, Aim, ClearML Server, W&B Self-Managed |
| Vendor-hosted, shared (SaaS) | The vendor | The vendor's multi-tenant cloud | W&B public cloud, Comet cloud, Neptune-style hosted services |
| Vendor-hosted, dedicated or managed | The vendor, or a cloud provider, for you alone | A single-tenant deployment, sometimes in your cloud account | W&B Dedicated Cloud, Databricks managed MLflow, managed MLflow on a cloud ML platform |
Product names and tiers change often, so check each vendor's current documentation before relying on this table. The three-way split stays useful, because it tells you which questions to ask each vendor.
Self-hosting MLflow
The MLflow tracking server has two storage layers, which you configure separately:
- The backend store holds runs, parameters, metrics, and tags. SQLite works for one person. A team should use PostgreSQL or MySQL.
- The artifact store holds files, usually an object-storage bucket on S3, Google Cloud Storage, or Azure Blob Storage.
A minimal team setup looks like this:
pip install mlflow psycopg2-binary boto3
mlflow server \
--host 0.0.0.0 \
--port 5000 \
--backend-store-uri postgresql://mlflow:[email protected]:5432/mlflow \
--artifacts-destination s3://my-team-mlflow-artifacts/runsReplace the placeholder password and read real credentials from a secret store. With --artifacts-destination, the server proxies artifact uploads and downloads. Clients then need no direct bucket credentials, which narrows who can read your model files. Check that the proxy behavior is enabled in the MLflow version you run, because defaults have changed between releases.
Self-hosting gives you several things:
- No licence fee.
- Full control over data location.
- Free choice of network placement, such as a private subnet behind a VPN.
It also hands you the operational work:
- Database backups and restore tests.
- Server upgrades, which can include schema migrations.
- Bucket lifecycle rules.
- Capacity planning for the database as metric history grows.
- Authentication.
The authentication gap
A plain mlflow server accepts any request from any client that can reach it. Newer MLflow releases include an optional basic-authentication app that adds users and per-experiment permissions. Many teams instead place the server behind a reverse proxy or an identity-aware gateway that enforces single sign-on (SSO). If you skip this step, anyone on the network can read and delete runs.
Self-hosting and dedicated options for W&B
W&B is mainly a hosted product, but it offers more than one deployment. The shared cloud is the default. Vendor-operated dedicated deployments give a single customer an isolated instance. A customer-managed (self-managed) option lets you run the server in your own infrastructure, with access to the enterprise features under a licence. Details such as supported platforms, bring-your-own-bucket storage, and which features depend on the licence tier are documented by the vendor and change over time.
For governance work, the question to answer for any tier is: where is the metadata stored, and where are the artifact files stored? Some deployments let you keep artifact files in a bucket you own while the metadata stays with the service. Whether that satisfies your policy depends on the policy.
If the network blocks outbound traffic, the W&B client has an offline mode:
export WANDB_MODE=offline
python train.py
# later, from a machine with access to the server:
wandb sync wandb/offline-run-*Offline mode is useful for air-gapped training clusters. It does not remove the need to decide where the synced data finally ends up.
Managed MLflow
You can get MLflow's API without running the server. Databricks and several cloud ML platforms offer managed MLflow. The client code stays the same, and you change the tracking URI and credentials. This option suits teams that already work on the host platform. Two caveats apply:
- The managed service may support only some MLflow features, or support them at a different version.
- Your data now lives under the platform's governance, billing, and retention rules, which may be better or worse than your own.
Estimating cost
Cost has four parts, and teams often count only the first:
- Licence or subscription. Many vendor plans charge per user, per tracked hour, or per storage volume. Prices change, so use a current quote.
- Infrastructure. A self-hosted server needs a compute instance, a database, and object storage.
- Operations. Count the engineer-hours spent on upgrades, backups, access management, and incidents.
- Data volume. Metric logging frequency and artifact size drive storage and, for hosted plans, may drive the bill.
Operations is the cost people forget. A "free" self-hosted server that takes half a day per month is not free.
The following script compares one year of both options using values you supply. The numbers in it are placeholders, not real prices.
from dataclasses import dataclass
@dataclass
class Scenario:
users: int
seat_price_per_month: float # vendor price per user, from a real quote
infra_per_month: float # server + database + storage
ops_hours_per_month: float # upgrades, backups, support
hourly_engineer_cost: float
storage_gb: float
storage_price_per_gb_month: float
def hosted_cost_per_year(s: Scenario) -> float:
return s.users * s.seat_price_per_month * 12
def self_hosted_cost_per_year(s: Scenario) -> float:
storage = s.storage_gb * s.storage_price_per_gb_month
monthly = s.infra_per_month + storage + s.ops_hours_per_month * s.hourly_engineer_cost
return monthly * 12
if __name__ == "__main__":
for users in (3, 10, 40):
s = Scenario(
users=users,
seat_price_per_month=50.0,
infra_per_month=150.0,
ops_hours_per_month=6.0,
hourly_engineer_cost=80.0,
storage_gb=500,
storage_price_per_gb_month=0.023,
)
print(
f"{users:>3} users | hosted ${hosted_cost_per_year(s):>9,.0f}"
f" | self-hosted ${self_hosted_cost_per_year(s):>9,.0f}"
)With these placeholder inputs, the hosted option is cheaper for a small team, and the self-hosted option wins somewhere between 10 and 40 users. The crossover point matters more than any single total. It moves when you change the ops hours, so treat that value as the main uncertainty and test it with a trial.
Data governance
Governance means controlling who can see data, where it is stored, how long it is kept, and how you prove it. For trackers, work through these areas.
What you are actually storing
Tracking data is more sensitive than it looks. Check for:
- Dataset file paths and bucket names in parameters.
- Sample predictions or images logged as artifacts, which may contain personal data.
- Source code snapshots and git diffs, which some clients upload automatically.
- Environment variables or command-line arguments captured in run metadata. Check that these do not include secrets.
- Model weights, which can be intellectual property.
Audit one real run from your own team before deciding. Open it in the UI and list everything it contains.
Control checklist
| Concern | Question to ask | What to verify |
|---|---|---|
| Data residency | Which region holds metadata and artifacts? | Region settings, backup locations, and subprocessors for hosted services |
| Access control | Can you restrict a project to a group? | Role definitions, SSO and SCIM support, API key scoping |
| Audit | Can you see who read, changed, or deleted a run? | Audit log availability and retention period |
| Retention and deletion | Can you delete a run and its artifacts permanently? | Deletion semantics (MLflow marks runs deleted until you run garbage collection) |
| Encryption | Is data encrypted in transit and at rest? | TLS configuration, bucket encryption, key management options |
| Compliance | Does the setup meet your regulatory obligations? | Vendor attestations such as SOC 2 or ISO 27001, and legal review for GDPR or HIPAA |
| Secrets | Can credentials leak into logs? | Redaction of captured arguments and environment |
Deletion deserves a closer look
In MLflow, deleting a run in the UI marks it as deleted. The run and its artifacts remain until you permanently remove them. In a self-hosted deployment, run mlflow gc against the backend store. If a right-to-erasure request applies, test the whole path: delete a test run, run garbage collection, and then confirm that the files are gone from the bucket. Also check backups and replicas, which keep copies independently.
Scaling limits
Scale can create trouble in a few places:
- Metric volume. Logging every step of a long job creates millions of rows. For self-hosted MLflow, this stresses the database and slows the UI. Log at an interval, or batch metrics.
- Artifact size. Large checkpoints saved every epoch fill buckets fast. Set lifecycle rules, and log only the checkpoints you would reuse.
- Concurrency. Many parallel jobs writing to one small server can hit connection limits. Run the server with a production-grade database and enough workers.
- UI responsiveness. Comparing thousands of runs may be slow in any tool. Use tags and naming conventions so you can filter before you compare.
- Hosted limits. Vendors may rate-limit API calls or cap storage and tracked hours per plan. Read the limits for your tier.
A practical sequence for the hosting decision
- Write down the strictest data rule that applies to your runs, such as "no data leaves our cloud account."
- Remove every hosting model that violates the rule.
- Estimate cost for the remaining models with the script above, and treat ops hours as a range.
- Check access control, audit, and deletion against the table.
- Take the one or two survivors into the trial described in the final chapter.
Exercise
Your team of 6 trains models on data that must stay inside your company's cloud account. A colleague proposes the vendor's shared SaaS tier because it has no ops cost. Which hosting models remain, and what three self-hosting responsibilities must you plan for if you pick open-source MLflow?
Show answer
The shared SaaS tier is out because it sends data outside your account. The remaining models are self-hosted tools (such as open-source MLflow) and a customer-managed or single-tenant deployment, if the vendor's terms keep all data inside your account. For open-source MLflow, plan for: (1) authentication, because the default server has none, so use the basic-auth app or an SSO gateway; (2) backups and upgrades of the PostgreSQL backend store, including schema migrations; (3) artifact bucket management, including lifecycle rules and permanent deletion through garbage collection. Other valid answers include capacity planning for metric volume.
Exercise
In the cost script, the self-hosted option becomes cheaper than the hosted option as users grow. Name the input you should test most carefully before trusting the result, and say why.
Show answer
opshoursper_month. Infrastructure and storage costs are fairly predictable, and seat prices come from a quote, but operations time is a guess that people tend to underestimate. Because it is multiplied by an engineer's hourly cost, a small change moves the crossover point. Measure it during a trial.
Exercise
A user asks you to erase a run containing personal data from a self-hosted MLflow server. You delete the run in the UI. Is the data gone? What else must you do?
Show answer
No. The UI marks the run as deleted but does not remove it. Run mlflow gc against the backend store to remove the run permanently, then verify the artifact files are gone from the bucket. Also check database backups, bucket versioning, and replicas, which can keep copies.