Sub topic 10
SaaS: Using Finished Software
Software as a Service (SaaS) is the model where the provider runs a complete application and you use it over a network, usually through a web browser or an API. This chapter assumes you know what a server, an operating system, and an application are, and that you are comfortable with terms like HTTP and IP address. It also assumes you have read the earlier chapters on the stack and on IaaS and PaaS.
What SaaS gives you
In IaaS you rent virtual hardware. In PaaS you rent a platform that runs your code. In SaaS you rent the finished product. The provider owns and operates every layer: the physical hardware, the virtualization, the operating system, the runtime, and the application code itself.
You do not deploy anything. You sign up, sign in, and configure the product for your needs. Common examples are email and calendar suites, customer relationship management (CRM) tools, accounting software, video conferencing, and ticketing systems.
Three traits follow from this:
- Access over the network. You reach the product through a browser, a mobile app, or an API. Nothing is installed on a server you own.
- One product, many customers. Most SaaS products serve many customers from one shared deployment. This is called multi-tenancy.
- Continuous updates. The provider ships new versions on its own schedule. You get them without running an upgrade.
Where SaaS sits in the stack
The diagram below shows which layers each model hands to the provider. In SaaS, only your data, your users, and your configuration remain with you.
Using SaaS through an API
Many SaaS products expose a REST API next to the web interface. That lets you connect the product to your own systems. You still run no servers for the product itself. You only call it.
# SaaS: you consume the finished product through its interface or API.
# api.example.com and API_TOKEN are placeholders.
curl -H "Authorization: Bearer $API_TOKEN" \
https://api.example.com/v1/contactsCompare this with the earlier IaaS and PaaS examples. With aws ec2 run-instances you created a machine and then had to manage it. With eb deploy you uploaded code. Here you have nothing to create or deploy. You ask the provider's application for data it already holds.
The request carries a bearer token in the Authorization header. A token identifies the caller to the provider. Treat it like a password: keep it in an environment variable or a secrets manager, never in source code.
How multi-tenancy works
Multi-tenancy means a single running copy of the software serves many customers, called tenants. The provider separates tenants logically instead of giving each one its own servers. Typical approaches are:
| Approach | How tenants are separated | Typical trade-off |
|---|---|---|
| Shared database, shared schema | A tenant ID column on each row | Cheapest to run, weakest isolation |
| Shared database, separate schema | One schema per tenant | Moderate cost and isolation |
| Separate database per tenant | One database per tenant | Stronger isolation, higher cost |
| Separate deployment per tenant | A dedicated stack per tenant | Strongest isolation, highest cost |
Sharing is what makes SaaS affordable. It also introduces two risks you should know about:
- Data leakage between tenants. A bug in the provider's access checks could expose one tenant's data to another. Mature providers test for this heavily, but it is a real category of incident.
- Noisy neighbors. A very busy tenant can slow the shared system for others. Providers manage this with rate limits and quotas.
Rate limits matter to you as a customer. If your integration calls the API in a tight loop, the provider will often reject requests with an HTTP 429 (Too Many Requests) response. Your code should handle it by waiting and retrying.
import time
import requests
def get_with_retry(url, token, max_attempts=5):
"""GET a SaaS API endpoint, backing off when rate limited."""
headers = {"Authorization": f"Bearer {token}"}
delay = 1
for attempt in range(max_attempts):
response = requests.get(url, headers=headers, timeout=10)
if response.status_code != 429:
response.raise_for_status()
return response.json()
# Honor Retry-After when the provider sends it (in seconds).
retry_after = response.headers.get("Retry-After")
time.sleep(int(retry_after) if retry_after else delay)
delay *= 2
raise RuntimeError("Still rate limited after retries")This sketch doubles its wait after each rejected attempt and uses the provider's Retry-After header when one is present.
What you still own
SaaS removes infrastructure work. It does not remove responsibility. Under the shared responsibility model, the provider secures the product and the layers beneath it. You remain responsible for how your organization uses it:
- Identity and access. You decide who gets an account and what each person can do. Enforce multi-factor authentication and remove accounts when people leave.
- Your data. You decide what information goes into the product, how it is classified, and who can export it.
- Configuration. Sharing settings, public links, and integration permissions are yours to set. Many real breaches come from a document or storage link set to "anyone with the link", not from a flaw in the provider's code.
- Compliance. Laws about where personal data may live, and how long it may be kept, apply to you even when a vendor holds the data.
- Backups and exit. Providers protect against their own failures, but they may not protect you from an administrator deleting records by mistake. Check what the product retains, and export data on your own schedule when it matters.
Strengths and limits
SaaS suits needs that are common across many organizations, where building your own would add cost without adding advantage.
| Strength | Limit |
|---|---|
| No servers or software to install, patch, or scale | Little control over features and release timing |
| Fast to start, often within minutes | Customization limited to what the vendor allows |
| Predictable per-user or per-usage pricing | Costs grow with headcount or volume |
| Provider handles availability and security of the platform | An outage at the provider is outside your control |
| Integrations through APIs and webhooks | Data may be hard to move out in a usable form |
Two limits deserve extra attention.
Forced change. Because the provider updates the product for everyone, a feature you rely on can change or disappear. You cannot pin an old version the way you can on your own server.
Lock-in. The more business process and data you put in a product, the harder it is to leave. Check early whether you can export your data in an open, documented format, and whether the API gives you everything the interface does. A later chapter returns to lock-in in more detail.
Pricing in SaaS
SaaS billing usually follows one of these patterns:
- Per user per month. You pay for each named account. Cost is easy to predict but rises with headcount, including people who rarely log in.
- Tiered plans. Features and limits grow with the plan level. Watch for features you need that sit only in the higher tiers.
- Usage-based. You pay for what you consume, such as messages sent or records stored. This tracks value closely but can surprise you during spikes.
- Free tier or freemium. A limited free plan leads to paid upgrades.
This still fits the measured-service idea from the essential characteristics. The unit being measured is simply closer to the business, such as a seat or a transaction, than to a CPU hour.
When SaaS is the right choice
Choose SaaS when the function is standard (email, payroll, ticketing, document collaboration), when you want results quickly, and when your team has no reason to operate the software. Look to PaaS or IaaS when the application is your own product, when you need behavior no vendor offers, or when rules about data location or control rule out a shared service.
A useful test is to ask what makes your organization different. If the answer is not "how we run this piece of software", buying it as SaaS is usually the sensible default.
Exercise
A company moves its team email from a server it runs to a SaaS email product. Name two tasks that disappear from the IT team's workload, and two responsibilities that remain with the company.
Show answer
Tasks that disappear: patching and maintaining the mail servers and operating system, and capacity planning, hardware, and availability of the mail infrastructure. Responsibilities that remain: managing user accounts and access (for example enforcing multi-factor authentication and removing leavers), and configuring sharing, retention, and data handling to meet the company's compliance needs. Exporting or backing up mail data for recovery also stays the company's concern.
Exercise
Your integration calls a SaaS API and begins receiving HTTP 429 responses. What does this mean, and how should the client respond?
Show answer
The 429 status means the provider is rate limiting the caller because too many requests arrived in a given period. The client should stop sending requests immediately, wait for the time given in the Retry-After header if present, and otherwise retry with an increasing delay (exponential backoff), giving up after a limited number of attempts. Reducing request volume, for example by batching or caching, prevents the problem.
Exercise
Why is a shared-schema multi-tenant design cheaper than giving each customer a separate deployment, and what risk does it add?
Show answer
Many tenants share one running application and one database, so the provider pays for far fewer servers and operates a single system. The added risk is weaker isolation: a flaw in the access checks could expose one tenant's data to another, and a heavy tenant can slow the system for the others (the noisy neighbor problem).