Memory Adapter
The Memory adapter stores all data in-memory, making it perfect for development, testing, and prototyping. Data is lost when the application restarts.
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
Related Resources
Edit on GitHub
Last updated: April 10, 2025