Memory Adapter

April 10, 2025

Deprecated Feature

@c15t/backend v1 did not deliver the flexibility we wanted and fell short of our standards. It is now deprecated as we work on a full rewrite, with v2 entering canary soon. This does not affect consent.io deployments, which remain stable.

Installation

The Memory adapter is included in the core package and requires no additional dependencies:

Configuration

The Memory adapter accepts minimal configuration:

Usage Examples

Basic CRUD Operations

Best Practices

  • Use for development only - The memory adapter is not suitable for production use as data is lost on restart
  • Test with realistic data volumes - Pre-populate with a representative data set to test performance
  • Reset between tests - Create a new instance for each test to ensure a clean environment

Limitations

  • No persistence across application restarts
  • Not suitable for production environments
  • Limited query capabilities compared to SQL-based adapters
  • No support for complex joins or transactions

When to Use

  • During development and prototyping
  • For automated testing
  • For demos and examples
  • When you need a lightweight, zero-configuration database