Sub topic 15
Trade-offs and vendor lock-in
This chapter assumes you know what IaaS, PaaS, and SaaS provide and how they split the stack between you and the provider. It also assumes you know the public, private, hybrid, and multi-cloud deployment models. Here you will look at what each choice costs you later, with a focus on vendor lock-in.
Every service model is a trade
Moving from IaaS to PaaS to SaaS hands more layers to the provider. You gain speed and lose control. No model is better in general. Each one trades something you can see now for something you may only notice later.
| Dimension | IaaS | PaaS | SaaS |
|---|---|---|---|
| Time to first result | Hours to days | Minutes to hours | Minutes |
| Operational effort | High: OS, patching, scaling | Medium: code and configuration | Low: user and data administration |
| Flexibility | High: any OS, any runtime | Medium: supported runtimes only | Low: features the vendor ships |
| Portability of what you build | Highest | Medium | Lowest |
| Typical cost shape | Pay for capacity, including idle capacity | Pay for the platform tier or usage | Pay per user or per volume |
The table is a tendency, not a rule. A badly run IaaS fleet can cost far more in staff time than a PaaS bill. A SaaS product with a good export tool can be easier to leave than a PaaS app built on proprietary features.
Where the costs hide
Control versus effort
Control means you can change a layer. Effort is the work of keeping that layer healthy. On IaaS you can tune kernel parameters, and you must also apply security patches. On PaaS you cannot change the kernel, and you never patch it. Ask whether you need to change a layer, not whether you would like to.
Flexibility versus constraints
A PaaS supports a fixed list of runtimes, versions, and request limits. Typical limits include maximum request duration, ephemeral local disk, and no background daemons. If your workload fits, the limits cost nothing. If it doesn't, you find out late, often in production. A SaaS product is the same at a larger scale: you get the features and customization hooks the vendor chose.
Cost: unit price versus total cost
IaaS has the lowest unit price for raw compute. A virtual machine that is 20% utilized still bills 100% of the hours. A managed service costs more per hour but removes work, such as database backups or failover. Compare the total cost of ownership: the bill, the engineers' time, and the cost of outages. Also look at how cost grows. Per-user SaaS pricing grows with headcount. Usage-based PaaS pricing grows with traffic. Some prices fall per unit at volume, and some do not.
Data gravity and egress
Data gravity is the tendency of applications to move toward the data they use, because moving large datasets is slow and costly. Providers usually charge little or nothing to send data in, and charge for data leaving their network. This charge is called egress. A 50 TB dataset that takes weeks and thousands of dollars to move out is an exit barrier, even if the compute is easy to relocate.
What vendor lock-in is
Vendor lock-in is a situation where switching providers costs so much, in money, time, or risk, that you effectively stay. It is a cost, not a yes or no state. Lock-in comes in several forms:
- API and service lock-in. Your code calls a provider-specific service, such as a proprietary queue, a proprietary database API, or a workflow engine.
- Data format lock-in. Your data is stored in a format only the vendor's tools read well, or exports lose structure such as relations, history, and permissions.
- Operational lock-in. Your team's skills, monitoring, deployment scripts, and runbooks are built around one provider's tooling.
- Identity and network lock-in. Users, roles, and private network layouts are defined in the provider's identity and networking systems.
- Commercial lock-in. Committed-spend contracts, reserved capacity, and volume discounts make leaving expensive until the term ends.
Lock-in generally grows as you move up the stack. IaaS workloads are usually ordinary virtual machines running ordinary software, so they move with moderate effort. A PaaS app often depends on platform features such as build packs, routing, and add-ons. A SaaS tenant holds your data in the vendor's schema, with workflows you configured inside the product.
Lock-in is not always a mistake. Taking a managed database means accepting some dependence on it in exchange for not running it yourself. The mistake is accepting it without noticing, or without estimating the exit cost.
Deployment models and lock-in
The deployment models from earlier in the course change the lock-in picture.
- Public cloud gives the most services and the strongest pull toward provider-specific features.
- Private cloud moves lock-in to your own platform and its vendor, such as a virtualization or private cloud software supplier, and to your own staff's knowledge.
- Hybrid cloud lets you keep sensitive or latency-bound workloads close and burst the rest. It adds the work of connecting and securing two environments.
- Multi-cloud uses more than one provider. It can reduce dependence on a single vendor and support resilience or regulatory needs. It also costs more: duplicated skills, duplicated tooling, and a lowest-common-denominator design if you avoid each provider's best services.
Multi-cloud is not free insurance. If you use only the features all providers share, you give up the managed services that made the cloud attractive. Many teams choose to be single-provider by default and plan a credible exit for the few components where lock-in would hurt most.
Reducing lock-in without giving up the cloud
Treat portability as something you buy selectively. These practices are common and cheap compared with full multi-cloud:
- Prefer open standards and open source engines where the managed service is a hosted version of something common, such as PostgreSQL, MySQL, Kubernetes, or Kafka. Moving between hosted versions is easier than rewriting.
- Keep an adapter layer between business logic and provider services, so only a thin module knows which provider you use.
- Package workloads in containers so the runtime travels with the code.
- Describe infrastructure as code, and know that provider-specific templates still describe provider-specific resources.
- Keep your data exportable. Test exports regularly, in open formats, and keep an independent backup outside the provider.
- Negotiate and read terms: exit assistance, data return, egress fees, notice periods, and committed-spend minimums.
The adapter layer is the easiest of these to show. The business function below depends on a small interface, not on a provider.
from pathlib import Path
from typing import Protocol
class BlobStore(Protocol):
def put(self, key: str, data: bytes) -> None: ...
def get(self, key: str) -> bytes: ...
class LocalStore:
"""Stores blobs on local disk. Useful for development and tests."""
def __init__(self, root: str) -> None:
self.root = Path(root)
def put(self, key: str, data: bytes) -> None:
path = self.root / key
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(data)
def get(self, key: str) -> bytes:
return (self.root / key).read_bytes()
class S3Store:
"""Stores blobs in Amazon S3. Requires boto3 and AWS credentials."""
def __init__(self, bucket: str) -> None:
import boto3 # imported here so LocalStore works without boto3
self.client = boto3.client("s3")
self.bucket = bucket
def put(self, key: str, data: bytes) -> None:
self.client.put_object(Bucket=self.bucket, Key=key, Body=data)
def get(self, key: str) -> bytes:
response = self.client.get_object(Bucket=self.bucket, Key=key)
return response["Body"].read()
def save_report(store: BlobStore, name: str, text: str) -> None:
store.put(f"reports/{name}.txt", text.encode("utf-8"))
if __name__ == "__main__":
store = LocalStore("./data")
save_report(store, "q1", "revenue up")
print(store.get("reports/q1.txt").decode("utf-8"))Moving to another provider's object storage means writing one new class, not touching save_report. The adapter has a cost. It exposes only features every backend can offer, so you cannot use provider-specific options such as storage classes or event triggers without widening the interface.
Other risks that come with the trade
- Provider outages and shared fate. A regional outage affects every customer in that region. More managed layers means more of your uptime depends on someone else's.
- Price and policy changes. A provider can raise prices, retire a service, or change limits. SaaS vendors can change features or terms for all customers at once.
- Compliance and data residency. Laws may require data to stay in a country or under certain controls. Check where each service stores and processes data.
- Skill concentration. Deep expertise in one provider makes your team effective and also makes switching harder.
Estimating your exit cost
Before committing to a service, ask a few concrete questions:
- What would we have to rewrite if this service disappeared in 12 months?
- How would we export our data, in what format, how long would it take, and what would it cost?
- Which parts of the contract bind us, and for how long?
- What is the cost of the lock-in compared with the cost of avoiding it, such as extra staff or a slower launch?
If the exit cost is small compared with the benefit, accept the lock-in. If it is large and the service is core to your business, invest in portability, or pick a more open alternative.
Exercise
Your team runs a customer-facing web app on a PaaS. It uses the platform's proprietary job queue and a managed PostgreSQL database, and it stores 20 TB of uploads in the provider's object storage. A new finance rule asks you to show a credible plan for leaving the provider within a year. Which of the three dependencies is likely the cheapest to move and which the most expensive, and why? Name one step to reduce the cost of the most expensive one.
Show answer
PostgreSQL is likely the cheapest, because it is an open engine with standard dump and restore tools, and any provider offers a compatible hosted version. The proprietary job queue needs code changes, since no other provider has the same API, but it is a small piece of the application. The 20 TB of uploads is likely the most expensive: moving it takes time, and egress fees apply. To reduce that cost, put an adapter such as BlobStore in front of storage, replicate the data continuously to a second location, and check the provider's egress fees and data-return terms in the contract.
Exercise
A startup chooses a SaaS CRM and configures many custom fields and automations inside it. Which two kinds of lock-in apply, and what should it do in the first month to keep its options open?
Show answer
Data format lock-in applies, because records may export without their relationships, history, or automation logic. Operational lock-in applies, because staff learn the vendor's workflows and build processes around them. In the first month the startup should test a full export in an open format such as CSV or JSON, document the custom fields and automations outside the product, and read the contract for data-return terms and notice periods.