Skip to content

Storage: MongoDB Adapter #6

@ggondim

Description

@ggondim

Summary

Implement the StorageAdapter interface with MongoDB as the default persistence backend.

Tasks

  • Implement all StorageAdapter methods using native mongodb package
  • Collections: channels, recipients, threads, turns, routes, tokens
  • Indexes:
    • threads: by threadId (unique), by channelId + nativeThreadId, by channelId + targetId
    • turns: by turnId (unique), by threadId + timestamp
    • routes: by criteria fields for efficient matching
    • tokens: by token value (unique), TTL index on expiresAt
  • Connection pooling and graceful shutdown
  • Migration/seed utilities for initial setup
  • Integration tests against a real MongoDB instance (Docker)

Acceptance Criteria

  • All StorageAdapter methods work correctly against MongoDB
  • TTL index on tokens auto-expires documents
  • Indexes support efficient queries for common access patterns
  • Tests pass against MongoDB in Docker (docker compose up)
  • Graceful connection cleanup on shutdown

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions