---
title: "How we built a secure, performant, multi-tenant cloud platform to run untrusted code"
description: "Deno Deploy runs untrusted JavaScript and TypeScript in pools of V8 isolates inside VMs called runners, split into a control plane for deployments and a data plane of edge regions."
url: "https://swe.quest/articles/how-we-built-a-secure-performant-multi-tenant-cloud-platform-to-run-untrusted-2ee4fd4f231472d5"
canonical: "https://deno.com/blog/build-secure-performant-cloud-platform"
source: "Deno"
published: "2024-05-17"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["multi-tenancy","serverless","sandboxing","cdn-edge","system-design"]
---

# How we built a secure, performant, multi-tenant cloud platform to run untrusted code

A post on [Deno](https://swe.quest/sources/deno.md), published 2024-05-17, 10 min read, Case study. Original: [https://deno.com/blog/build-secure-performant-cloud-platform](https://deno.com/blog/build-secure-performant-cloud-platform)

## Summary

Deno Deploy runs untrusted JavaScript and TypeScript in pools of V8 isolates inside VMs called runners, split into a control plane for deployments and a data plane of edge regions. At deploy time, code is transpiled with swc, all dependencies are vendored and ordered breadth-first so they can be streamed into V8, and the bundle is replicated to regional buckets. Postgres stays off the critical path, and edge proxies keep an in-memory domain-to-deployment table. Requests arrive via Anycast, and the proxy picks a runner using heuristics over CPU and memory load. Isolation combines namespaces, cgroups, seccomp and a watchdog process, built against a five-point tenant threat model.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [CDN & edge](https://swe.quest/tags/cdn-edge.md) (Infrastructure)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)

## Prerequisites

- V8 isolates ([easy posts on Runtimes & VMs](https://swe.quest/tags/runtimes.md?difficulty=easy))
- serverless functions ([easy posts on Serverless](https://swe.quest/tags/serverless.md?difficulty=easy))
- Linux namespaces and cgroups ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))

## Keywords

Deno Deploy, Deno Subhosting, V8, swc, Anycast, seccomp, cgroups, Postgres

## Related posts

- [The Anatomy of an Isolate Cloud](https://swe.quest/articles/the-anatomy-of-an-isolate-cloud-63ec66f5321e5ffc.md): Deno · 2022-09-27 · Easy · 6 min read · Sandboxing & isolation, Multi-tenancy, Serverless, CDN & edge, Runtimes & VMs
  Deno Deploy runs untrusted user JavaScript in V8 isolates rather than VMs or containers, trading heavier isolation for much lower overhead and faster deploys.
- [How security and tenant isolation allows Deno Subhosting to run untrusted code securely](https://swe.quest/articles/how-security-and-tenant-isolation-allows-deno-subhosting-to-run-untrusted-code-bc85ef9b28cccb45.md): Deno · 2023-11-27 · Easy · 6 min read · Multi-tenancy, Sandboxing & isolation, Serverless, Linux
  Deno Deploy and Deno Subhosting isolate untrusted tenant code using layered defenses mapped to a five-point threat model: per-deployment V8 isolates, a virtualized filesystem, and separate VPCs for ingress and outbound traffic.
- [How immutable scripts in Deno allow Windmill.dev (YC S22) to build production-grade ops](https://swe.quest/articles/how-immutable-scripts-in-deno-allow-windmill-dev-yc-s22-to-build-production-db6cb3961bcb6bf5.md): Deno · 2023-05-18 · Easy · 3 min read · TypeScript, Sandboxing & isolation, Multi-tenancy, Performance engineering
  Windmill.dev, an open-source platform for building internal workflows and UIs from scripts, runs TypeScript on Deno because inline, version-pinned imports make each script a self-contained, reproducible file that is hashed immutably and stored in Postgres.
- [Introducing Deno Sandbox](https://swe.quest/articles/introducing-deno-sandbox-ffb8d1f44b3562f3.md): Deno · 2026-02-03 · Medium · 3 min read · Sandboxing & isolation, AI agents, Serverless, Virtualization, Security
  Deno Sandbox runs untrusted, often LLM-generated code in lightweight Linux microVMs on Deno Deploy that boot in under a second and are created via JavaScript or Python SDKs.
- [Supabase Edge Runtime: Self-hosted Deno Functions](https://swe.quest/articles/supabase-edge-runtime-self-hosted-deno-functions-55b12d1d5db96506.md): Supabase · 2023-04-11 · Medium · 7 min read · Serverless, Runtimes & VMs, JavaScript, Rust, Open source
  Supabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno\_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
