For the complete documentation index, see llms.txt. This page is also available as Markdown.

InMemory Options for Development and Testing

How-to · Applies to Brighter V10

InMemory Options Overview

Brighter V10 provides a comprehensive suite of in-memory implementations for key components, making it easy to develop and test applications without external dependencies. These in-memory options replace databases, message brokers, and schedulers with simple, lightweight alternatives that run entirely in process.

Key Benefits:

  • Zero dependencies: No databases, message brokers, or external services required

  • Fast execution: Perfect for unit and integration tests

  • Simple configuration: Minimal setup, get started immediately

  • Consistent APIs: Same interfaces as production components

  • Deterministic behavior: Predictable, repeatable test execution

Important: InMemory options are designed for development and testing. While robust, they are generally not recommended for production due to lack of persistence, distribution, and durability guarantees.

Available InMemory Components

Brighter V10 provides InMemory implementations for the following components:

Component
Purpose
Production Ready?

Message publishing and consumption

Limited use cases

Transactional messaging

Limited use cases

Message deduplication

Limited use cases

Delayed message scheduling

Limited use cases

Message archiving

No

Claim Check pattern

No

Test Configuration Patterns

When writing tests, you can use Brighter's Func<IServiceProvider, T> overloads and the Microsoft Options pattern to create isolated test configurations. This enables parallel test execution without serialization.

Using PostConfigure for Test Overrides

For more details on service provider overloads and the Options pattern, see Service Provider Function Overloads and Using the Options Pattern in the Basic Configuration documentation.

Complete Testing Example

Here's a complete example showing how to use multiple InMemory components together:

Environment-Specific Configuration

Use InMemory components for development/testing, production components elsewhere:

Comparison with Production Components

Feature
InMemory
Production (DB/Broker)

Persistence

None

Database/Disk

Distribution

Single process

Multi-instance

Durability

None

ACID guarantees

Performance

Very fast

Network/IO bound

Setup

Zero config

Requires infrastructure

Testing

Ideal

Complex setup

Production

Limited

Recommended

Migration to Production

When moving to production, replace InMemory components:

InMemory Component
Production Alternative

InMemory Transport

RabbitMQ, Kafka, AWS SQS, Azure Service Bus

InMemory Outbox

MS SQL, PostgreSQL, MySQL, DynamoDB, MongoDB

InMemory Inbox

MS SQL, PostgreSQL, MySQL, DynamoDB, MongoDB

InMemory Scheduler

Quartz, Hangfire, AWS Scheduler, Azure Service Bus Scheduler

InMemory Archive

Database-backed archive provider

No code changes required - just swap the registration in your DI container!

InMemory Options Summary

Brighter V10 provides comprehensive InMemory options for all major components:

Best For:

  • Unit and integration testing

  • Local development

  • Demos and POCs

  • CI/CD pipelines (fast, no external dependencies)

Not Recommended For:

  • Production systems requiring durability

  • Distributed/multi-instance applications

  • Long-running scheduled work

Use InMemory options to accelerate development and testing, then migrate to production components for deployed applications with durability and distribution requirements.

Further Reading

Last updated

Was this helpful?