Alpha Version: You are viewing the ALPHA documentation. This is an experimental version and may contain breaking changes.
Skip to main content

Local Provider

The reventless-local package implements all Reventless adapter interfaces using in-memory data structures. It is designed for local development and testing — no cloud infrastructure, no deployment, no costs.

Key Features​

  • Shared Event Bus — LocalBus provides event fan-out (PubSub) and command dispatch using Effect's PubSub and Queue primitives
  • Synchronous Processing — events flow through the entire system within a single process, making tests deterministic
  • Test Runner — TestRunner.setup() activates Pulumi mock mode so components can be instantiated in Jest
  • Built-in GraphQL Server — starts automatically on port 4000 after all plugins are constructed
  • Built-in MCP Server — provides AI-native access to commands and read models

Architecture​

Unlike the AWS provider which creates separate Lambda functions connected by SQS and SNS, the Local provider runs everything in a single Node.js process:

Platform.Make()
├── LocalBus (shared event + command bus)
├── Aggregate Builders → EventLogStorage_InMemory + LocalCommandTopicChannel + ...
├── ReadModel Builders → QueryDbStorage_InMemory + LocalEventCollectorChannel + ...
├── DCB Builders → DcbEventLogStorage_InMemory + ...
├── GraphQL Server (port 4000)
└── MCP Server

The bus acts as the glue: aggregates publish events to the bus, and read models subscribe to the bus for event delivery. Command handlers are registered on the bus and invoked directly.

Service Mappings​

ComponentLocal ImplementationData Structure
EventLogEventLogStorage_InMemoryDict<string, array<JSON.t>> via STM TRef
CommandTopicLocalCommandTopicChannelBus command dispatch (direct handler call)
EventTopicLocalEventTopicPublisherBus PubSub fan-out
EventCollectorLocalEventCollectorChannelBus event subscription
QueryDbQueryDbStorage_InMemoryDict<string, JSON.t> via STM TRef
TaskLocalTaskBucketDict<string, string> via STM TRef
CommandGeneratorLocalCommandGeneratorResolversDirect function binding
CounterLocalCounterHandlerDict<string, int> via STM TRef
HeartbeatLocalHeartbeatRunnersetInterval timer
QueryEngineLocalQueryEngineIn-memory scan + filter over QueryDb
ScheduledPublisherLocalScheduledPublishersetInterval timer + Bus dispatch
SideEffectHandlerLocalSideEffectHandlerBus event subscription with handler callback
DcbEventLogDcbEventLogStorage_InMemoryarray<event> with tag-based filtering

Differences from AWS​

AspectLocalAWS
PersistenceNone — data lost on process exitDynamoDB, S3
Event deliverySynchronous (2-3 microtask ticks)Asynchronous (SQS/SNS)
ConcurrencySingle-threadedMulti-Lambda concurrent execution
InfrastructureNonePulumi-managed AWS resources
CostFreePay-per-use AWS pricing
OrderingGuaranteed (single process)FIFO queues provide per-aggregate ordering

Next Steps​