Skip to content
Ambiten Runtime

Context-aware MongoDB execution for modern application runtimes.

Establish execution context once. Carry it through the runtime.

Ambiten turns MongoDB data access into a runtime foundation for tenant-aware, transaction-aware, and observable application execution.

Ambiten is a framework-agnostic MongoDB runtime for applications that need more than document access. Tenant identity, request metadata, transaction sessions, database scope, middleware behavior, provider resolution, and instrumentation metadata can move through a defined execution model instead of being manually threaded through every application layer.

Execution-scoped Tenant, request, database, session, and runtime metadata can remain available throughout an Ambiten execution.
Transaction-aware Participating model operations can inherit the active MongoDB session from an enclosing transaction boundary.
Adapter-driven The same runtime model can serve Express, Fastify, NestJS, GraphQL, Lambda, workers, and explicit execution flows.
One Runtime Flow

An execution enters once. Ambiten carries its runtime state toward persistence.

In many MongoDB applications, the difficult part is not the database call itself. The difficult part is preserving the execution state around that call: which tenant is active, which request or job initiated the work, which database should be used, whether a transaction session exists, which middleware participates, and what runtime metadata should be available to instrumentation.

Ambiten gives those concerns a defined execution path instead of leaving them as repeated plumbing across controllers, services, resolvers, background jobs, and model calls.

Execution BoundaryAmbitenContextAmbitenModelEffective ModelContextSchema / MiddlewareInfrastructureMongoDB
Supported Runtimes

Choose the adapter that matches where your app runs.

Director Observability

Execution-level operational insight for the systems Ambiten powers.

Director is the planned operational intelligence layer for Ambiten. It is designed to build on structured runtime telemetry and turn execution signals into views around tenant activity, execution scope, transaction outcomes, runtime budgets, latency patterns, and operational behavior.

Director is currently presented as a product preview. Ambiten Core provides the execution model and runtime metadata; instrumentation exposes the signals; Director is designed to correlate and present those signals in a form teams can investigate and act on.

Runtime SignalsWhat Director is designed to surface
Tenant activity Compare query volume, latency, runtime budgets, and operational patterns across tenant workloads.
Scope visibility Surface operations without expected tenant or execution identity so teams can distinguish intentional system work from unexpected runtime behavior.
Transaction diagnostics Observe transaction outcomes, abort patterns, durations, and runtime failure signals where corresponding telemetry is available.
execution telemetryquery instrumentationruntime insight
Runtime observability

Execution-aware logging for context-driven systems.

Ambiten Logger is not a console wrapper. It is a runtime-aware observability layer designed to preserve execution context across requests, transactions, adapters, workers, and distributed application flows.

RequestAmbitenContextTransactionInstrumentationLoggerTransports

Context-aware by design

Logs can automatically inherit request IDs, tenant identity, database targets, collection names, and runtime metadata from the active Ambiten context.

Structured runtime telemetry

Every log is treated as structured execution data, making it easier to search, correlate, route, and analyze across production observability systems.

Resilient transport pipeline

Console, rolling files, async batching, HTTP, Elasticsearch, and Loki transports can be composed with retry and circuit breaker protection.

Why Ambiten Exists

MongoDB applications become harder to reason about when execution state lives everywhere.

Most teams can write CRUD operations. The harder problem appears as the application grows: tenant identity moves through too many layers, transactions depend on nested calls receiving the right session, database scope is reconstructed in different places, and instrumentation loses the execution information needed to explain what happened.

Ambiten addresses that problem by giving execution state a defined runtime path. Models remain focused on persistence operations while context, middleware, provider infrastructure, transaction sessions, and runtime metadata participate around them through explicit responsibilities.

Runtime Experience
      
      await AmbitenContext.withTransaction(async () => {
        const user = await UserModel.create({
          name: 'Amina',
          email: 'amina@team.io'
        });
        await AuditLogModel.create({
          action: 'USER_CREATED',
          userId: user._id
        });
      });
      
    

Participating Ambiten model operations can inherit the active transaction session through the execution context. Tenant identity, request metadata, and other execution state can also be inherited when they have been established by the surrounding runtime.

Product Delivery

Keep feature code focused on application intent.

Ambiten reduces the amount of execution state that application code must manually carry through every workflow. Context belongs to the runtime, persistence state belongs to the model operation, and infrastructure resolution stays behind defined provider boundaries.

Platform Discipline

Give runtime responsibilities explicit owners.

Context propagation, transaction participation, tenant-aware infrastructure, middleware, lifecycle behavior, and instrumentation each have defined places in the runtime instead of depending entirely on conventions repeated across application code.

Runtime Portability

Use one persistence model across different execution environments.

Ambiten's adapter model allows the same application and persistence layer to participate behind REST APIs, GraphQL resolvers, NestJS services, Lambda handlers, background workers, and explicit runtime boundaries.

Capability Surface

What Ambiten adds around ordinary MongoDB data access.

Ambiten is not only concerned with how documents are created, read, updated, or deleted. Its value is in the execution model around those operations: context propagation, model binding, provider resolution, transaction participation, framework integration, tenant-aware infrastructure, and operational metadata.

Execution-scoped state Tenant, request, database, session, and runtime metadata can remain available across asynchronous execution through AmbitenContext.
Progressive adoption Start directly with AmbitenClient, then add models, context, adapters, multi-tenancy, and transaction boundaries as application requirements grow.
Adapter portability Establish the same runtime model across Express, Fastify, NestJS, GraphQL, Lambda, workers, and explicit execution flows.
Transaction participation Participating operations can inherit the active MongoDB session when executed inside a compatible transaction boundary.
Provider-based resolution Models retain their collection boundary while provider infrastructure resolves the database, MongoDB client, and active session required by the operation.
Operational visibility Instrumentation can consume tenant, request, operation, and runtime metadata without requiring every application layer to reconstruct it.

Context-aware execution infrastructure for multi-tenant systems.