Every architecture review we run on Oracle Cloud Infrastructure eventually arrives at the same question: should this thing be a function, a container instance, or a deployment on Kubernetes? The question sounds technical but it is usually answered tribally. Teams that came from a Lambda heavy shop want everything to be a function. Teams that invested years in Kubernetes want everything on OKE. Both instincts produce estates that are more expensive and more fragile than they need to be, because the right answer changes from workload to workload, and OCI gives you three genuinely different compute tiers to match against them.
This article is part of our series on application development and serverless on OCI. We will lay out the criteria that actually decide the question, walk through the three options and where each one wins, compare them side by side, explain cold starts and cost behavior per traffic pattern, give you a numbered decision framework, and finish with hybrid designs, migration paths between tiers, and the mistakes we keep seeing in real estates.
The criteria that actually decide it
Strip away the vendor language and five questions settle almost every placement decision. First, traffic shape: is the load steady, spiky, scheduled, or close to zero most of the day? A workload that idles twenty hours a day has a very different economic profile from one that hums at constant volume. Second, latency tolerance: can the consumer absorb an occasional second of startup delay, or is every request on a tight budget measured in tens of milliseconds? Third, runtime limits: how long does one unit of work take, how much memory does it need, and does it need a GPU, a large local disk, or an unusual runtime? Fourth, state: is the process genuinely stateless between requests, or does it hold connections, caches, sessions, or in memory working sets that make recycling expensive? Fifth, team skills: who will operate this at two in the morning, and what do they already know?
That last one is underrated. A platform decision that ignores the operating team is a decision to fail slowly. Kubernetes in particular is a commitment to a discipline, not just a deployment target, and a three person team with no platform engineer should think hard before signing up for it. The honest version of the question is never which technology is best, it is which technology is best for this traffic shape, this latency budget, this unit of work, and this team.
The three options on OCI
OCI Functions
OCI Functions is the fully serverless tier, built on the open source Fn Project. You write a function, package it as a container image, push it to the registry, and the platform runs it on demand. There are no servers, no clusters, and no idle cost: you pay per invocation and per gigabyte second of execution, and a generous monthly free allowance means light workloads often cost nothing at all. Functions scale from zero to many instances automatically and scale back to zero when traffic stops. The constraints are real, though: execution time is capped at five minutes, memory tops out at a few gigabytes, and an idle function gives up its warm instance, which means the next caller pays a cold start. Our deep guide to OCI Functions covers the development model in detail.
Container Instances
Container Instances is the middle tier and the one most often overlooked. It runs standard container images on dedicated, serverless compute without any orchestrator: no cluster to create, no nodes to patch, no Kubernetes API to learn. You specify shape, OCPU, and memory, point it at an image, and OCI runs it for as long as you ask. Billing is for the underlying compute by the second while the instance runs, at the same rate as the equivalent VM shape, with no premium for the convenience. That makes it ideal for jobs that outlive the five minute function limit, for always on services too small to justify a cluster, and for teams that want containers without the operational weight of Kubernetes. What it does not give you is orchestration: no built in autoscaling across replicas, no rolling deployments, no service discovery. Our Container Instances guide goes deeper on the patterns.
OKE, the managed Kubernetes tier
Oracle Kubernetes Engine is the full orchestration platform: managed control plane, node pools or virtual nodes for the workers, and the entire Kubernetes ecosystem of operators, service meshes, ingress controllers, and deployment tooling. The basic control plane is free and you pay for worker compute; an enhanced control plane carries a small hourly fee and adds features like virtual nodes and finer lifecycle management. OKE wins when you run many services with real interdependencies, when you need fine grained control over scheduling, networking, and rollout strategy, or when portability across clouds and on premises clusters matters. The price is operational: upgrades, node patching, capacity planning, observability, and security hardening are now your platform team's job, even with the managed control plane. Our piece on microservices patterns on OKE shows what good looks like at that tier, and the OKE solution page describes how we help teams run it.
Side by side comparison
| Dimension | OCI Functions | Container Instances | OKE |
|---|---|---|---|
| Unit of deployment | Single function packaged as a container image | One or more containers in an instance | Pods orchestrated across a cluster |
| Scaling | Automatic, from zero to many and back | Manual; you start and stop instances | Horizontal pod and cluster autoscaling, fully configurable |
| Runtime limits | Five minute cap, limited memory | Hours or days, large shapes available | Effectively none within node capacity |
| Idle cost | Zero when idle | Billed while running, zero when stopped | Worker nodes billed whether busy or idle |
| Cold starts | Yes, after idle periods | Startup only when an instance launches | None for running pods |
| Operational load | Minimal | Low | Significant, needs platform skills |
| Best fit | Event handlers, glue code, spiky APIs | Batch jobs, small always on services, sidecars and tools | Microservice platforms, steady high volume systems |
Cold starts, honestly
Cold starts are the tax serverless charges for scale to zero, and they deserve a sober treatment rather than fear. When a function has been idle, the next invocation must pull the image, start the container, and initialize the runtime before any business logic runs. On OCI that typically costs from a few hundred milliseconds for a small image with a lean runtime to several seconds for a heavyweight one. Subsequent calls hit the warm instance and run at full speed. Three things govern how much this hurts: image size, runtime choice, and traffic cadence. A compact image with a fast starting runtime keeps cold starts in the low hundreds of milliseconds; a bloated image with a slow framework can take seconds. Provisioned concurrency can keep a set number of instances warm for latency sensitive functions, at the cost of paying for them while they wait.
The practical rule: if your consumer is a human staring at a spinner, budget for the worst case cold start, not the average. If the consumer is a queue, an event stream, or a scheduled trigger, cold starts are usually irrelevant and the scale to zero economics win outright. And if a steady trickle of traffic keeps your functions warm around the clock, you are no longer getting the idle savings that justified serverless in the first place, which is exactly the signal to look one tier down the table.
Cost behavior per traffic pattern
The three tiers have different cost curves, and the crossover points are what matter. For spiky or rare traffic, Functions is close to unbeatable: you pay only for execution, the free tier absorbs a lot, and idle hours cost zero. For scheduled batch work, Container Instances usually wins: a four hour nightly job on a modest shape costs a few cents per run and nothing the rest of the day, with no orchestrator overhead and no function time limit to engineer around. For steady continuous load, dedicated compute wins on raw unit cost: per request pricing carries a premium over an OCPU you keep busy around the clock, so a function handling millions of requests per day at constant volume can cost several times what the same workload costs as an always running service on OKE or a container instance.
The trap runs in both directions. We see teams paying for idle OKE worker nodes to host three small services that would cost a tenth as much on Functions and Container Instances, and we see teams running high volume APIs on Functions, paying a serverless premium for traffic that has not been spiky in two years. Run the arithmetic at your real volumes once a quarter; the right answer moves as traffic grows.
A decision framework you can apply per workload
Here is the sequence we use in architecture reviews. Apply it to one workload at a time, in order, and stop at the first decisive answer.
- Check the hard limits first. If a unit of work can exceed five minutes, needs more memory than Functions offers, needs a GPU, or needs unusual runtime control, Functions is out. Choose between Container Instances and OKE.
- Check state. If the process must hold long lived connections, large in memory caches, or session state that cannot move to Redis or the database, it wants a long running container, not a function.
- Map the traffic shape. Idle most of the time or sharply spiky points to Functions. Scheduled and finite points to Container Instances. Steady and continuous points to long running compute, sized for the load.
- Apply the latency budget. If a worst case cold start would break the user experience and provisioned concurrency is not worth its cost, move the workload to an always on tier.
- Count the services. One to five independent services rarely justify Kubernetes. A platform of ten or more interdependent services, with deployment coordination and shared networking concerns, starts to earn OKE.
- Audit the team. If nobody on the team can debug a failing node pool or write a network policy, either invest in those skills deliberately or stay on the serverless tiers until you can.
- Price the finalists at real volumes. Take your actual request counts and durations and compute the monthly cost on each surviving option. The spreadsheet ends more arguments than the whiteboard.
Hybrid patterns that work
The best OCI estates are deliberately mixed. A common shape: the core API platform runs on OKE because it is steady, interdependent, and operated by a real platform team; image processing, webhook handling, and notification fanout run on Functions because they are bursty and event driven; the nightly reconciliation job and the quarterly data migration run on Container Instances because they are finite and exceed function limits. API Gateway fronts both the OKE ingress and the functions, so consumers see one API surface regardless of what executes behind it. Events from Object Storage, Streaming, or the Events service trigger functions that in turn call services on the cluster. Nothing about the platform forces uniformity, and the billing rewards teams that resist it.
Another pattern worth naming is serverless around the edges of a monolith. Plenty of estates arrive on OCI with a large application that is not getting decomposed this year. Wrapping it with functions for new event driven features, while the core stays on VMs or a container instance, delivers most of the serverless benefit without a rewrite anyone will regret.
Moving between tiers
Because all three tiers run standard container images, migration between them is unusually cheap on OCI, and you should treat the first placement as a hypothesis rather than a marriage. A function that outgrows its limits can be repackaged as a long running service: the image largely survives, and the work is in swapping the function handler for an HTTP server and adding health checks. A service on Container Instances that multiplies into a family of services moves to OKE by writing deployment manifests around the images it already has. Traffic moves with a route change at the API Gateway, which is the piece that makes the whole estate rearrangeable: consumers hold a stable URL while you change what executes behind it. The discipline that keeps this cheap is simple: keep business logic out of the handler layer, keep configuration external, and never let a workload grow secret dependencies on its execution environment.
Common mistakes
Five failures account for most of what we find. First, Kubernetes by default: standing up OKE for a handful of small services because it felt like the serious choice, then carrying node management and upgrade toil forever after. Second, Functions as a hammer: chaining a dozen functions into a workflow with hidden ordering dependencies, recreating a distributed monolith with cold starts at every hop. Third, ignoring Container Instances entirely: the middle tier solves the batch job and the small always on service better than either neighbor, and most teams have never evaluated it. Fourth, deciding once and never revisiting: the workload that was spiky at launch is steady at scale, and the pricing crossover passed eighteen months ago without anyone noticing. Fifth, letting the org chart decide: the platform team mandates the cluster, or the innovation team mandates serverless, and workloads get placed by politics instead of by traffic shape. Every one of these is fixable, and the fix starts with measuring rather than believing.
Bringing it together
OCI gives application teams three honest compute tiers: Functions for event driven and spiky work, Container Instances for finite jobs and small services without orchestration, and OKE for platforms that justify Kubernetes. None of them is the answer; each of them is an answer to a particular combination of traffic shape, latency budget, runtime needs, state, and team capability. Run the framework per workload, price the finalists at real volumes, mix tiers without guilt, and revisit placements as traffic evolves. If you want an outside view of where your workloads should land, or a second opinion on an estate that has drifted expensive, that is exactly the work our architecture reviews are built for.
Free white paper
Go deeper on this topic with The OCI Landing Zone and Architecture Guide, a reference architecture for security, networking, and governance on OCI. An independent analyst style report with comparison tables and recommendations, free with a work email. Prefer a monthly summary instead? The OCI Brief delivers one practical OCI briefing a month.
Part of a series
This guide is part of Kubernetes & DevOps on OCI — our complete pillar guide on the topic.
Moving Oracle workloads to OCI, or already running on OCI and not sure the architecture or the spend is right? Most teams bring in a specialist before they commit to a region, a shape, or a Universal Credits number. OCISpecialists.com plans the landing zone, runs the migration, and manages the estate after go live, on a fixed project fee, a managed monthly retainer, or a cost optimization fee paid only on verified savings.