Sub topic 15
Trade-offs and vendor lock-in
This chapter assumes you know the three service models (IaaS, PaaS, SaaS), the shared responsibility split, and the public, private, hybrid, and multi-cloud deployment models. It covers what you give up when you move up the stack, and how to limit the cost of depending on one provider.
The core trade-off
Each step from IaaS to PaaS to SaaS hands more layers to the provider. You gain speed and lose control.
- Less effort: no patching, capacity planning, or runtime setup for the layers the provider owns.
- Less control: you cannot change the operating system on a PaaS, or a feature on a SaaS product.
- Less portability: the more provider-specific features you use, the harder it is to leave.
Cost follows a similar pattern. Managed services often cost more per unit of compute than raw virtual machines. They can still cost less overall, because you spend less engineering time operating them.
What vendor lock-in is
Vendor lock-in means that switching providers costs more than staying, so you stay even when a better or cheaper option exists. The cost of switching comes from several sources.
| Source of lock-in | Example | Why it hurts |
|---|---|---|
| Proprietary APIs | A database that only the provider offers | Code must be rewritten to use another database |
| Data gravity | Terabytes stored with one provider | Moving data takes time and costs egress fees |
| Tooling and skills | Provider-specific deployment scripts and team training | Pipelines and people must be retrained |
| Contracts | Committed-spend discounts | Leaving early forfeits the discount |
Lock-in is usually lowest with IaaS and highest with SaaS. A virtual machine running standard Linux can move to another provider with modest effort. A SaaS product holds your data in its own format, and exporting it may be slow or incomplete.
Reducing the cost of leaving
You cannot remove lock-in, but you can reduce it.
- Use open standards. Prefer standard formats, protocols, and open-source engines such as PostgreSQL over proprietary services when the features are equivalent.
- Keep an abstraction layer. Hide provider calls behind your own interface so only one module changes during a migration.
- Keep your data exportable. Test that you can export data in a documented format before you depend on a service.
- Package your workloads. Containers run on most providers and reduce the work of moving a service.
- Read the contract. Check data export terms, egress fees, and notice periods.
The following Python sketch shows the abstraction idea. The application depends on a small interface, and each provider gets its own implementation.
from abc import ABC, abstractmethod
class FileStore(ABC):
@abstractmethod
def save(self, name: str, data: bytes) -> None: ...
class LocalStore(FileStore):
def __init__(self, folder: str) -> None:
self.folder = folder
def save(self, name: str, data: bytes) -> None:
with open(f"{self.folder}/{name}", "wb") as f:
f.write(data)
def archive_report(store: FileStore) -> None:
store.save("report.txt", b"quarterly numbers")To use a different provider's object storage, you write another FileStore subclass. archive_report does not change.
Lock-in is not always bad
Some lock-in is a fair price for a benefit. A managed database that removes weeks of operations work may justify depending on one provider. The useful question is whether the benefit is worth the exit cost, and whether you know that cost before you commit. For a workload that is likely to change providers, favor portable choices. For one that will stay put, favor the managed feature.
Exercise
A team stores 50 TB of data in a provider's proprietary database, using provider-specific query features. Name two sources of lock-in this creates and one step that would reduce the exit cost.
Show answer
The proprietary query features are lock-in through proprietary APIs, because queries must be rewritten for another database. The 50 TB of stored data is lock-in through data gravity, because moving it takes time and may incur egress fees. A step that reduces exit cost is to test regular exports in a documented format, or to move to an open-source engine such as PostgreSQL behind an abstraction layer.