Skip to content

Comments

feat: make redb storage optional with feature-flagged dual-mode architecture#69

Open
seriouscoderone wants to merge 1 commit intoTHCLab:masterfrom
seriouscoderone:feat/optional-redb-storage
Open

feat: make redb storage optional with feature-flagged dual-mode architecture#69
seriouscoderone wants to merge 1 commit intoTHCLab:masterfrom
seriouscoderone:feat/optional-redb-storage

Conversation

@seriouscoderone
Copy link

Summary

  • Gate redb behind a storage-redb feature flag (default ON) in keri-core and teliox, enabling the core protocol logic to compile and run without redb
  • Split EventStorage constructors: generic new() (no mailbox), new_redb() (RedbDatabase-specific), and new_with_mailbox() (dependency injection)
  • Genericize teliox escrow structs (MissingIssuerEscrow, OutOfOrderEscrow, MissingRegistryEscrow) over K: EventDatabase for KEL storage
  • Add in-memory MemoryDatabase implementing all database traits for validation and testing
  • Move rkyv_adapter from database::redb::rkyv_adapter to database::rkyv_adapter (not redb-specific)

This enables future alternative storage backends (e.g., DynamoDB for serverless deployments) to slot in by implementing the EventDatabase, LogDatabase, EscrowCreator, and TelEventDatabase traits.

Test plan

  • cargo test --all-features — all 118 tests pass
  • cargo check --package keri-core --no-default-features --features query — compiles without redb
  • cargo check --package teliox --no-default-features — compiles without redb
  • test_memory_db_process_icp — in-memory backend processes KERI inception events correctly

🤖 Generated with Claude Code

…tecture

Gate redb behind `storage-redb` feature flag (default ON) in keri-core and
teliox so the core protocol logic can compile and run without redb. This
enables future alternative storage backends (e.g., DynamoDB for serverless).

Key changes:
- Split EventStorage constructors: generic `new()` (no mailbox) vs
  `new_redb()` (RedbDatabase with mailbox) vs `new_with_mailbox()` (inject)
- Make mailbox_data an Option<MailboxData> to support non-redb backends
- Remove Any bound from EventValidator
- Gate TelLogDatabase, teliox EscrowDatabase, and escrow module behind
  storage-redb feature
- Genericize teliox escrow structs over K: EventDatabase for KEL storage
- Add in-memory MemoryDatabase implementing all database traits for
  validation and testing
- Move rkyv_adapter to database::rkyv_adapter (not under database::redb)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blelump
Copy link
Member

blelump commented Feb 19, 2026

Awesome contribution @seriouscoderone !

The PR mentions Add in-memory MemoryDatabase implementing all database traits for validation and testing but I am unsure if there's any?

@seriouscoderone
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants