Skip to main content
Give each of your customers its own namespace, so its answers read only its documents, are measured and corrected on its own outcomes, and are budgeted and billed on their own. The namespace is also the unit of scale and cache. Here a customer of yours is a tenant. A platform with 50,000 tenants has 50,000 namespaces, and many of them are idle at any time. A namespace that Brussle does not judge in a billing period costs only its storage (no judgments and no tenant fee).

What tenants cost

Brussle bills each tenant’s usage as it bills any other usage: judgments, storage, writes and queries. Platforms also pay a small tenant fee for each active tenant namespace in each billing period, past the namespaces that the plan includes (25 on Developer and Team, 100 on Scale).
  • A namespace is active in a period if Brussle billed at least one row in it in that period.
  • A namespace that you only write to or read from never counts.
  • default/quickstart never counts.
The fee for each active namespace is:
  • $2 up to the 1,000th namespace
  • $1 up to the 10,000th
  • $0.50 above that
Brussle counts from your first namespace and takes your plan’s included namespaces off the bottom. The fee comes on top of your plan’s minimum and does not count toward it. Brussle takes the fee on the last day of the period from credit that you bought, never from the credit of your plan’s minimum, and the fee is not part of any namespace’s budget. For example, a platform on Team has 5,000 tenant namespaces, and Brussle judged 2,000 of them this billing period with 72M standard rows on Jev, which count as 144M: The 3,000 tenants that Brussle did not judge cost only their storage. On Scale, which includes 100 namespaces, the same platform would pay $2,800 of fee (900 × $2 + 1,000 × $1). See tenant namespaces for the bands, and for when Brussle takes the fee from your balance.

Staging tenants count like any other

You can copy your tenants in staging (for example acme/staging/tenant_123 beside acme/prod/tenant_123). Each staging tenant that Brussle judges in a billing period is an active namespace and counts toward the tenant fee like a production tenant. You can mark acme/staging/ as non-production, which keeps staging’s tenants out of production’s pooled correction. The mark does not change the tenant fee or any other line of your bill. For example, a platform on Team has 1,600 production tenants that Brussle judged this billing period, and a staging copy of each that Brussle also judged, with 75M standard rows on Jev between them, which count as 150M: To keep staging cheap, copy only the tenants that you need to test. With 20 staging tenants instead of 1,600, the fee is $2,570 (975 × $2 + 620 × $1). Give each staging namespace a small budget, and try things in default/quickstart, which is free up to its limit. See staging and test environments for the layout, the mark, and how to move a change from staging to production.

Name namespaces as a hierarchy

Use the hierarchy for the environment and the tenant, as in acme/prod/tenant_123 and acme/staging/tenant_123.
  • Lists (GET /namespaces?prefix=acme/prod/) and key scopes work on prefixes.
  • A delete works on one namespace at a time.
  • There is no project object, since the hierarchy is your project structure.
See tenants and environments.

Scope keys by prefix or namespace

Limit each API key to a namespace prefix or to one namespace and give it a role, so each backend service has only the access that it needs: A prefix stops at a /, so acme/prod/tenant_1* includes acme/prod/tenant_1 and everything under acme/prod/tenant_1/, but never acme/prod/tenant_12. For a tenant’s own key, scope the key to the tenant’s namespace. A scope can name namespaces that do not exist yet. You can create a key for team-a/* or for acme/prod/tenant_456 before its first write and give it to the team or tenant when you set them up. The key’s first write or judgment creates the namespace. Keys belong to your organization, not to people, and you create them on the dashboard’s Keys page. The page asks for the role of each key and never chooses one for you, and it shows the role and the scope with the new key.

Size for your organization’s limits

Your tenants’ keys share your organization’s limits:
  • Keys. An organization has at most 10,000 API keys that are not revoked, and the Keys page shows how many you have. When a tenant leaves, revoke its key.
  • Requests. Each key can send 1,000 requests a second, and all your organization’s keys together 2,000, so more keys do not give more requests. A request past either limit gets rate_limited (429) with Retry-After, and details.rate_limit says which limit it passed (per_key or per_org). One busy tenant can use the organization’s limit, and then other tenants’ requests get 429 too. If one tenant must not slow the others, limit each tenant’s requests in your own service.
  • Higher limits. When your tenants together need more keys or more requests, email scale@brussle.com with your organization’s id and the limit that you need.
See limits.

Create many tenants at once

The first write, judgment, group or subscription for a new name creates its namespace, and your organization creates at most 1,000 new namespaces in each UTC minute. To onboard more tenants than that at once (for example when you move your existing customers to Brussle), do one of these:
  • Create the namespaces at most 1,000 a minute.
  • Send the requests at once and let the SDKs retry. Brussle refuses a request that would create one namespace too many with rate_limited (429) and a Retry-After of the seconds until the next minute. The SDKs wait and retry up to max_retries (maxRetries) times, 2 by default. Each retry gets at most one more minute’s 1,000 namespaces, so for N new tenants at once, set the retries to at least N ÷ 1,000. Without an SDK, wait for Retry-After and send the same request again.
The limit applies only to new namespaces, so it does not slow writes and queries to existing tenants. A namespace that you delete and write to again counts as new. Each tenant’s namespace holds at most 100,000,000 documents or 256 GB. See namespace limits.

Define judgments once for every tenant

Create the judgment on a prefix, such as acme/prod/*, and every namespace under the prefix gets it, including tenants that you create later. A tenant can override its thresholds and its freshness policy, and can detach the judgment into its own copy. See templates. You can define a judgment on each tenant’s namespace instead, with one call for each tenant (usually when you set the tenant up):
settles_definition is the settles judgment from match one record to another, with confirm set. Each tenant then has its own definition and versions, and its own correction on its own outcomes alone. The first create on a new tenant creates its namespace, so it counts toward the creation limit.

Each tenant’s own model key

A provider key stored for your organization reaches every tenant namespace. To run a tenant on its own key (its own provider account, its own limits), store a key for that tenant’s namespace, which wins there and only there. A tenant whose key the provider rejects waits, with credential_unusable, and never falls back to the organization’s key, while revoking a tenant’s key returns it to the organization’s.

Correct each tenant on its outcomes

Each tenant posts outcomes on its own namespace path, and on a template Brussle pools them across tenants into one correction for each template version and engine epoch, fitted each night. A tenant that you add today reads the pooled correction from its first answer. Since the pool was fitted on other tenants’ outcomes, it is not yet measured on that tenant. Once the tenant posts outcomes, the report on its own path measures what it reads against them. On Team and Scale, a tenant also gets its own correction, held toward the pool’s, from 50 outcomes of its own with 15 of each kind. On a bool with features, the tenant also gets its own weights over the features from 100 outcomes with 20 of each kind, so a count that means something different for one of your customers is read as it means there. A tenant reads its own correction only when it is clearly better than the pool on that tenant’s held-out outcomes. To hold one fit for every tenant, pin it on the template’s prefix path, since a tenant cannot set calibration itself. Per-customer corrections covers the rest: what a tenant reads and why, the interval on a tenant, and which readers are judged again.

Get told when documents change in any tenant

A subscription on the same prefix tells you when a document in any tenant starts or stops matching a filter, so you do not poll each tenant. Here, the subscription tells you when a payment in any tenant waits for a person because settles could not match it:
  • Each event names the tenant in namespace, so one receiver can route events for all your tenants without a lookup. subscription.defined_on says that the event came from the template.
  • Each tenant keeps its own set of matching documents, starting at its next change. An idle tenant does no subscription work, and tenants that you create later are included.
  • Tenants cannot opt out or change the subscription, so to leave a tenant out, add a condition on id or on an attribute to the filter.
  • Staging works the same way. Put a subscription on acme/staging/* with an endpoint scoped to acme/staging/, and staging events go only to your staging receiver. An endpoint must include the full prefix of each subscription that sends to it.
  • The limit. A tenant can create a subscription only while it has fewer than 100, counting the template’s, although subscriptions that the template gets later can take a tenant past 100. See templates.

Budgets per tenant

Give each namespace its own judging budget for each billing period, so a burst in one tenant cannot make your bill large. Brussle prices each request to the engine before it sends it, and stops judging before the cost goes past the budget. When a tenant’s namespace reaches its budget:
  • Its changed answers become stale.
  • Its documents that Brussle never judged read unavailable.
  • Its writes continue. With "on_exceeded": "reject", Brussle refuses them with budget_exceeded instead.

Keep tenants fast after idle time

An idle namespace falls out of the cache, so the first query after that is cold (some hundreds of milliseconds). Two tools help:
  • Warm a namespace with POST /namespaces/{ns}/warm (ns.warm()) when you know that a session is about to start. Warming is free and best effort. See warm a namespace.
  • Pin a namespace that must stay fast after idle time with PATCH /namespaces/{ns} and {"pinned": true}, and it stays in the cache once loaded. Pinning has a price. See pin a namespace.