
OpenMeter vs Stigg (2026): One Platform or a Runtime Layer?
OpenMeter vs Stigg, compared on metering, entitlements, credits, and billing connection. See how each is hosted and when each one fits your AI product.
Learn how multi-tenant architecture works, compare database isolation models, and explore six components & eight best practices for shared infrastructure.
Your AI product started with a shared database, a tenant_id column, and a few usage counters. Everything worked until an enterprise customer requested department budgets, agent-level limits, and dedicated data storage. Now a pricing change touches several services.
Multi-tenant architecture gets harder when customer requirements diverge. Data isolation, access rules, and consumption limits need to work together.
Here's how to structure the architecture and avoid rebuilding your infrastructure with every new requirement.
Multi-tenant architecture is a software design where multiple customers (tenants) share application infrastructure while keeping their data, permissions, and configurations isolated.
Each request carries a tenant identifier that determines which data and resources the customer can access. Databases, compute, and application services can be shared, with isolation enforced through software controls.

The three main multi-tenant architecture models differ in how databases separate tenant data. The choice affects infrastructure cost, data isolation, migrations, and operational work.
AWS describes related pool, bridge, and silo approaches in its multitenant architecture guidance.
In a shared-schema model, all tenants store data in the same tables. Queries use a tenant_id column to retrieve records belonging to the correct customer.
SELECT *
FROM usage_events
WHERE tenant_id = $1;
The model reduces provisioning and migration work because tenants share database objects.
Its main weakness is cross-tenant data exposure. A missing tenant filter can return another customer's records, so database policies and tenant-scoped access controls matter.
Choose this model when tenant workloads have similar requirements and shared infrastructure offers a practical cost advantage.
Separate schemas give each tenant a distinct namespace within a shared database. For example, Tenant A uses tenant_a.usage_events, while Tenant B uses tenant_b.usage_events.
The separation gives applications clearer data boundaries while retaining shared database infrastructure.
However, schema migrations need coordination across tenants, and a failed migration can leave different customers running different schema versions.
Choose separate schemas when customers need stronger logical isolation, and your infrastructure can manage tenant-specific schema lifecycles.
The database-per-tenant model gives each customer a dedicated database boundary. Tenant workloads can have separate backup schedules, database configurations, and resource allocations.
This approach fits customers with strict data residency requirements, demanding workloads, or dedicated storage requirements.
The tradeoff is that provisioning, monitoring, connection management, and migrations grow with the tenant count.
A hybrid architecture can combine these models, keeping smaller tenants on shared infrastructure while assigning dedicated databases to customers with stronger requirements.
The best practices for multi-tenant architecture focus on preventing cross-tenant failures, controlling resource contention, and keeping usage state consistent under concurrent traffic.
Your API gateway identifies the tenant, but the request becomes a background job. The job payload loses its tenant ID, leaving the worker without a verified customer identity.
Require tenant context in service calls, queued jobs, events, and database operations. Reject missing or mismatched identifiers before accessing data.
Include cross-tenant access attempts in security tests. A missing tenant should never trigger a fallback to a default customer.
Every model call consumes resources. Once the tokens have been processed, a post-request usage event cannot recover the compute cost.
Check entitlements and available credits before execution. Reserve credits when the final cost is unknown, then settle against measured usage.
Backend feature gating also protects endpoints that users can call without going through the UI.
An enterprise customer upgrades its plan. The API recognizes the new allowance, but a background worker continues enforcing the old limit.
The conflict comes from duplicated entitlement logic. Services need one authoritative interface that returns effective access status, usage limits, current consumption, and unlimited allowances.
A common decision layer lets plan changes and add-ons use the same rules across the application.
Two agents draw from a wallet containing 100 credits. Each requests 80 credits, and both pass because neither deduction has committed.
Atomic transactions, compare-and-swap, and reservations offer ways to protect shared balances. The right mechanism depends on the data store and concurrency requirements.
Retries create another risk. Idempotency keys prevent duplicate deductions when a successful request is repeated, while an append-only ledger preserves the transaction history.
Average latency can look healthy while one customer monopolizes shared resources. A burst of agent workflows might exhaust database connections or create contention against a shared credit pool.
Test concentrated tenant workloads, including parallel sessions and traffic spikes. Aggregate tests can miss the pressure created by requests competing for the same state.
For customers with sustained resource demands, a hybrid isolation model can assign dedicated infrastructure.
A temporary Stripe or Zuora slowdown shouldn't leave AI requests waiting for an access decision.
Let the runtime enforcement layer handle entitlements and credit checks during product requests. Billing providers can continue processing invoices, taxes, and payments through separate workflows.
The application retains control over request latency and fallback behavior.
A tenant reaches its credit limit, but one application instance still holds an older balance. Requests continue passing until the cached state changes.
Change-driven cache invalidation helps propagate plan changes, limit updates, and credit depletion across services.
The application also needs rules for unreachable entitlement services. Define when cached state can be used and which defaults apply when no decision is available.
A load test distributes thousands of requests across different tenants and passes. Production traffic then concentrates requests against one wallet, which exposes a race the test never exercised.
Test contention against the same tenant state, covering:
A passing test should confirm correct balances, tenant isolation, and access decisions when requests overlap, or services fail.
Running every customer on shared infrastructure saves money and makes updates easier. The trouble starts when one customer uses more than their fair share of resources or a mistake in access controls puts another customer's data at risk.
The main benefits come from sharing infrastructure and operating one application environment:
IBM identifies shared infrastructure and centralized updates as advantages of multitenancy.
For AI products, shared infrastructure also supports a common runtime for metering requests and managing customer usage allowances.
Shared infrastructure creates risks, such as:
These drawbacks become more pronounced when AI agents generate concurrent workloads against shared infrastructure.
The six core components of multi-tenant architecture handle tenant identification, data isolation, entitlements, usage metering, enforcement, and billing integration.
Each component deals with a different responsibility within the application.
Every request needs a verified tenant identity before it accesses customer data or usage state.
Tenant context has to travel across the request lifecycle, including application services, background jobs, usage events, and database operations.
The tenant ID can come from a verified JWT claim, API credential mapping, or gateway lookup. Client-provided identifiers must be validated against the authenticated identity.
A missing or mismatched tenant ID should cause the operation to fail.
The data isolation layer separates customer records according to the chosen database model.
Tenant boundaries extend beyond database tables. Caches, object storage, search indexes, queues, and analytics records can also contain tenant-owned information.
Database policies, scoped connections, and tenant-aware data-access functions reduce the risk of accessing another customer's records.
The access and entitlements layer defines which features and usage allowances each tenant receives based on its plan, add-ons, and trials. An entitlement management system resolves these rules across services.
RBAC controls what a user or role can do, while entitlements define what the tenant's plan allows. An admin might have permission to launch an AI agent, but the tenant's plan could limit its monthly usage.
Centralized entitlement decisions prevent services from applying conflicting access rules, consumption limits, or credit allowances.
Usage metering tracks each tenant's consumption of API calls, model tokens, compute time, and agent actions. A usage metering pipeline attributes events to the correct tenant and uses idempotency to prevent duplicate counts.
Credit tracking adds financial rules to usage records. Grants carry amounts, expiry dates, and cost bases, while burn order determines which credits are consumed first. Hard limits block depleted balances, while soft limits can permit tracked overdrafts.
An append-only credit ledger records grants, deductions, expirations, and adjustments to support revenue recognition and reconciliation.
The enforcement layer is what determines whether a tenant can consume a resource before execution begins.
Each request can be evaluated against feature access, usage allowances, available credits, and limits assigned to users, agents, or departments.
AI usage control becomes relevant when these limits need to govern token consumption, credit spending, or concurrent agent workloads.
For operations with unknown final costs, the application can reserve credits before execution and settle against measured consumption.
The billing layer handles invoices, payments, taxes, and collection through providers such as Stripe and Zuora.
Billing processes financial activity after usage, while the enforcement layer controls access during product requests.
Keeping billing outside the request path prevents payment-provider delays from affecting every AI operation. Metering supplies consumption records, and entitlements determine what each tenant can access.
Multi-tenant architecture creates concerns around cross-tenant data exposure and resource contention. Both require controls wherever tenants access shared resources.
A valid user can still request a resource owned by another tenant. Authentication alone cannot prevent cross-tenant access.
The server must verify tenant ownership before returning records, accessing cached data, or performing an operation. Negative tests should cover cross-tenant resource IDs, background jobs, and internal APIs.
A customer launches hundreds of parallel AI workflows. The database remains isolated, but the jobs consume shared model capacity and delay requests from other tenants.
Rate limits and concurrency caps protect shared service capacity, while usage and credit enforcement control consumption against each tenant's allowances.
Tenants with sustained resource demands may need dedicated infrastructure through a hybrid isolation model.
The main difference between single-tenant and multi-tenant architecture is how infrastructure is allocated. Single-tenant architecture gives customers dedicated resources, while multi-tenant architecture shares some resources across customers.
Dedicated infrastructure fits strict isolation requirements and demanding workloads. Choosing between single-tenant and multi-tenant architecture also involves weighing infrastructure cost, resource contention, and your specific business requirements.
Multi-tenant architecture gets harder to manage when tenant limits, credit balances, and concurrent AI requests all depend on consistent state.
Stigg is the usage runtime for AI products, enforcing entitlements, credits, usage limits, and spend governance in the request path. It works alongside billing providers such as Stripe and Zuora.
Stigg fits into an existing multi-tenant stack through:
The Stigg documentation covers how to integrate entitlement checks, credit management, and the Sidecar with your existing infrastructure. If you’d rather map it onto your own stack, talk to a human and bring your trickiest tenant setup.
Multi-tenant architecture is a software design where multiple customers share application infrastructure while keeping their data and access isolated. Each customer, called a tenant, has separate permissions, configurations, and usage limits within the shared environment.
The three types of multi-tenant architecture are shared database with shared schema, shared database with separate schemas, and separate database per tenant. Each model offers different levels of data isolation, infrastructure cost, and operational complexity.
The main difference between single-tenant and multi-tenant architecture is how infrastructure is allocated. Single-tenant architecture gives each customer dedicated resources, while multi-tenant architecture shares resources across customers with software-enforced isolation.
You keep tenant data secure in multi-tenant architecture by enforcing tenant-specific access controls at every data boundary. Validate tenant identity, scope database queries to the authorized tenant, and test for cross-tenant access through APIs, caches, and background jobs.
You prevent the noisy-neighbor problem in multi-tenant architecture by controlling resource consumption per tenant. Rate limits, concurrency caps, and usage enforcement stop one customer's workload from exhausting shared capacity. Dedicated resources can help when a tenant has sustained demand.