Record Keeping Agent

RecordKeeping Agent on ECS/Fargate

  • Runtime Environment: Amazon ECS with Fargate (serverless containers)

  • Container Configuration:

    • Task definition: 2 vCPU, 4GB memory with configured task roles

    • Auto-scaling based on queue depth and CPU utilization (target: 70%)

    • Health checks with 30-second intervals and 3 retry attempts

  • Deployment Pattern: Blue/green deployment with CloudWatch alarms for rollback

  • Technical Stack:

    • Spring Boot microservice with reactive programming model

    • Redis-backed distributed locking for transaction consistency

    • Circuit breaker pattern implementation for downstream service resilience

    • Multi-threading with configurable thread pools for parallel processing

2. Message Control Points (MCPs)

  • Implementation: AWS Step Functions with state machine definition

  • Responsibilities:

    • Protocol translation between internal and external systems

    • Request routing with content-based and header-based routing rules

    • Schema validation with JSON Schema enforcement

    • Error handling with explicit compensation transitions

  • Integration Pattern: Enterprise Integration Patterns (Scatter-Gather for multi-target distribution)

3. DynamoDB Wallet Inventory

  • Data Model:

  • Access Patterns: High read, moderate write with eventual consistency

  • Indexing: GSI on blockchain_type and wallet_status for filtered queries

  • TTL Configuration: None (permanent records)

4. DynamoDB User-Wallet Mapping

  • Data Model:

  • Access Patterns: High read during authentication flows

  • Indexing: GSI on wallet_id for reverse lookups

  • Consistency: Strongly consistent reads for critical operations

5. Wallet Creator with Cross-mint Integration

  • Implementation: Containerized service for cross-blockchain wallet generation

  • Protocol Support: Multi-protocol supporting EVM-compatible and non-EVM blockchains

  • Security: HSM integration for private key management

  • Integration: REST API with OAuth2 authentication

Technical Workflow

  1. Record Creation Process

    • Incoming transaction/wallet events trigger the RecordKeeping Agent

    • Events classified by type and routed to appropriate processing pipeline

    • Distributed locking ensures atomic operations across distributed components

    • Transaction idempotency maintained via deduplication keys

  2. Data Persistence Flow

    • Agent processes events into standardized record format

    • MCP handles protocol translation for each target system

    • Parallel writes to DynamoDB tables with configurable consistency levels

    • Optimistic concurrency control with conditional writes

  3. Wallet Creation Process

    • Wallet creation requests routed through dedicated MCP

    • Cross-mint service creates blockchain-specific wallets

    • Response processed and wallet metadata persisted to Wallet Inventory

    • User-Wallet mappings created with appropriate permission model

Performance Optimizations

  • Connection Pooling: Configured HTTP and database connection pools

  • Batch Processing: DynamoDB batch operations for bulk record updates

  • Read-Through Cache: ElastiCache for frequently accessed wallet data

  • Write Optimization: Write sharding for high-volume wallet inventory updates

Monitoring & Reliability

  • Observability: CloudWatch custom metrics with dimension-based filtering

  • Tracing: AWS X-Ray with annotation for transaction boundary tracing

  • Logging: Centralized logging with correlation IDs and structured JSON format

  • Alerting: SNS topics for critical operation failures with escalation paths

  • Redundancy: Multi-AZ deployment with failover automation

Compliance & Audit

  • Transaction Logging: Immutable record of all wallet operations for audit

  • Data Validation: Schema enforcement at API and database layers

  • Encryption: Data-at-rest encryption with KMS-managed keys

  • Compliance Hooks: Configurable policy enforcement points for regulatory requirements

Last updated