---
title: "Example — multi-tenant"
---

# Example — multi-tenant

Per-tenant connection-pool isolation and per-tenant cost budgets via the `cost-governor` plugin.

**Source on GitHub**: [`HeliosDB-Proxy/examples/multi-tenant`](https://github.com/HeliosDatabase/HeliosDB-Proxy/tree/main/examples/multi-tenant)

## Demonstrates

- Three demo tenants (`acme-co`, `globex`, `initech`) each with their own pool slice
- Per-tenant CPU / memory / connection budgets enforced at the proxy layer
- `cost-governor` WASM plugin rejecting queries that exceed the daily cost budget
- `column-mask` WASM plugin redacting PII columns based on the caller's role

## Run

```bash
cd HeliosDB-Proxy/examples/multi-tenant
docker compose up -d
./test-tenants.sh
```

`test-tenants.sh` runs queries as each tenant and shows:
- Acme connecting through its dedicated pool
- Globex hitting its budget and getting `ERROR: cost-governor: daily budget exhausted`
- Initech's analyst role seeing `mask_ssn(ssn)` instead of raw SSNs

## Plugin configuration

The `proxy.toml` references the bundled plugins from [`HeliosDB-Proxy-Plugins`](https://github.com/HeliosDatabase/HeliosDB-Proxy-Plugins). For the publisher path (sign + push to OCI registry), see the [`helios-plugin` CLI](/docs/proxy/plugins/).
