Skip to content

Concept Documentation - Created Files Summary

Concept Documentation - Created Files Summary

Section titled “Concept Documentation - Created Files Summary”

Created 17 comprehensive concept documentation files covering architecture, patterns, and infrastructure for the banyan-core platform.

Key Concepts:

  • Zero infrastructure code principle
  • One-line service startup with BaseService.start()
  • Message bus-only communication
  • Type-safe contracts with compile-time validation
  • Two-layer authorization (permissions + policies)
  • Platform benefits vs trade-offs

Cross-References:

  • Links to all other architecture docs
  • Links to pattern docs (CQRS, Event Sourcing, Saga)
  • Links to getting started guides

Key Concepts:

  • RabbitMQ as sole communication channel
  • Automatic correlation ID propagation via AsyncLocalStorage
  • Three exchange patterns (Command/Query/Event)
  • Type-safe contracts preventing runtime errors
  • Request-response, fire-and-forget, and subscription patterns
  • Message bus vs direct HTTP comparison

Cross-References:

  • Platform overview for context
  • Service discovery for contract registry
  • API Gateway for protocol translation
  • Event sourcing for event distribution

Key Concepts:

  • PostgreSQL event store with shared tables
  • Immutable event log as source of truth
  • Automatic read model projections
  • Optimistic concurrency control
  • Snapshot optimization for large aggregates
  • Event replay and temporal queries

Cross-References:

  • Event sourcing pattern for implementation
  • Read model pattern for projections
  • Aggregate pattern for domain modeling
  • Domain event pattern for event design

Key Concepts:

  • Message-based health monitoring (no HTTP)
  • Automatic contract registration on startup
  • PostgreSQL + Redis contract storage
  • Health-aware routing
  • Zero developer configuration required
  • 60-second health check interval

Cross-References:

  • Platform overview for overall architecture
  • Message bus architecture for communication
  • API Gateway for dynamic route generation

Key Concepts:

  • Protocol translation (HTTP/GraphQL/WebSocket → Message Bus)
  • Dynamic route generation from contracts
  • Permission-based authorization (Layer 1)
  • Correlation ID management
  • Health-aware routing
  • Same service code supports all protocols

Cross-References:

  • Message bus architecture for communication layer
  • Two-layer authorization for security model
  • Service discovery for contract loading

Key Concepts:

  • Layer 1: Permission-based at API Gateway (who can call what)
  • Layer 2: Policy-based at handlers (business rules)
  • Protocol-independent permission enforcement
  • Explicit contract decorators for permissions
  • Defense-in-depth security

Cross-References:

  • Platform overview for context
  • API Gateway for Layer 1 implementation
  • Contract system for permission declarations

7. correlation-and-tracing.md (from Batch 2)

Section titled “7. correlation-and-tracing.md (from Batch 2)”

Key Concepts:

  • Distributed tracing with Jaeger
  • AsyncLocalStorage for automatic propagation
  • Correlation ID lifecycle
  • Zero instrumentation code required

Key Concepts:

  • Command (write) vs Query (read) separation
  • Independent optimization strategies
  • Folder convention (/commands/ and /queries/)
  • Query caching with TTL
  • Clear intent through naming
  • Benefits for scalability and performance

Implementation:

  • CommandHandler and QueryHandler decorators
  • Separate data models (aggregates vs read models)
  • Cache configuration in query decorators

Cross-References:

  • Event sourcing pattern (often combined)
  • Read model pattern (query optimization)
  • Platform overview

Key Concepts:

  • Events as source of truth
  • Immutable event log
  • State derived from event replay
  • Complete audit trail
  • Time travel queries
  • Event replay for new projections

Implementation:

  • AggregateRoot base class
  • @ApplyEvent decorators
  • EventSourcedRepository
  • Snapshot management

Cross-References:

  • Event sourcing architecture
  • Aggregate pattern
  • Read model pattern
  • Domain event pattern

Key Concepts:

  • Distributed transaction coordination
  • Compensating transactions for rollback
  • Eventual consistency
  • Explicit rollback logic
  • Saga orchestration

Implementation:

  • @Saga decorator
  • @SagaStep with compensation functions
  • SagaOrchestrator
  • Saga state persistence

Cross-References:

  • Platform overview
  • Message bus architecture
  • Event sourcing pattern

Key Concepts:

  • Consistency boundaries
  • Aggregate root as single entry point
  • Business rule enforcement
  • Event generation
  • Small aggregate design

Implementation:

  • @AggregateRoot decorator
  • @ApplyEvent for event handlers
  • Reference by ID pattern

Cross-References:

  • Event sourcing pattern
  • Domain event pattern

Key Concepts:

  • Denormalized projections
  • Query optimization
  • Automatic updates from events
  • Multiple views from single event stream

Implementation:

  • @ReadModel decorator
  • @MapFromEvent for event handlers
  • Schema definition
  • Catchup processing

Cross-References:

  • Event sourcing pattern
  • CQRS pattern

Key Concepts:

  • Events represent facts
  • Past-tense naming
  • Immutability
  • Complete payload data
  • Business language

Implementation:

  • DomainEvent base class
  • Event publishing
  • Event handlers

Cross-References:

  • Event sourcing pattern
  • Message bus architecture

Key Concepts:

  • RabbitMQ 3.13 configuration
  • Three exchange patterns
  • Reliability features (retries, DLQ, circuit breaker)
  • Connection pooling
  • Monitoring via Management UI

Configuration:

  • Development (Docker Compose)
  • Production (HA cluster)
  • Message TTLs and patterns

Cross-References:

  • Message bus architecture

Key Concepts:

  • PostgreSQL 16 event store
  • Shared tables (events, snapshots, projection_positions)
  • Optimistic concurrency
  • Snapshot optimization
  • Connection pooling

Schema:

  • events table with JSONB storage
  • Indexes for performance
  • Unique constraint for concurrency

Cross-References:

  • Event sourcing architecture
  • Event sourcing pattern

Key Concepts:

  • Redis 7 for caching
  • Query result caching
  • Contract caching
  • Session data
  • TTL management

Configuration:

  • Development setup
  • Cache key patterns
  • Hit rate monitoring

Cross-References:

  • CQRS pattern

Key Concepts:

  • Jaeger 2.9 for distributed tracing
  • Prometheus + Grafana for metrics
  • Service Performance Monitoring
  • Automatic correlation propagation
  • Zero instrumentation code

Components:

  • Jaeger UI access
  • Grafana dashboards
  • Elasticsearch backend
  • Custom metrics

Cross-References:

  • Message bus architecture

Key Concepts:

  • Docker-based deployment
  • Development with docker-compose
  • Production container configuration
  • Horizontal scaling
  • Resource limits
  • Health checks

Configuration:

  • Environment variables
  • Service scaling
  • Container orchestration

Cross-References:

  • Platform overview
Platform Overview (entry point)
├── Message Bus Architecture
│ ├── Service Discovery
│ ├── API Gateway
│ └── Infrastructure: Message Bus
├── Event Sourcing Architecture
│ ├── Event Sourcing Pattern
│ ├── Aggregate Pattern
│ ├── Read Model Pattern
│ ├── Domain Event Pattern
│ └── Infrastructure: Event Store
├── Two-Layer Authorization
│ └── API Gateway
└── CQRS Pattern
├── Event Sourcing Pattern
├── Read Model Pattern
└── Infrastructure: Caching
Saga Pattern
└── Message Bus Architecture
Infrastructure Docs
├── Message Bus → Message Bus Architecture
├── Event Store → Event Sourcing Architecture
├── Caching → CQRS Pattern
├── Telemetry → Message Bus Architecture
└── Deployment → Platform Overview

All 17 documents include:

  • ✅ YAML frontmatter with complete metadata
  • ✅ Title, description, category, tags
  • ✅ Difficulty level and prerequisites
  • ✅ Related concepts cross-references
  • ✅ Core Idea summary (one sentence)
  • ✅ Overview section
  • ✅ The Problem section (real-world scenario)
  • ✅ The Solution section (how platform solves it)
  • ✅ Implementation in the Platform (code examples)
  • ✅ Benefits and Trade-offs
  • ✅ When to Use / Avoid guidance
  • ✅ Real-World Examples (2+ concrete scenarios)
  • ✅ Related Concepts section
  • ✅ Common Patterns
  • ✅ Best Practices (numbered list)
  • ✅ Further Reading (internal and external)
  • ✅ Glossary (key terms)

Content verified against:

  • ✅ docker-compose.yml for infrastructure configuration
  • ✅ platform/packages/ for package implementations
  • ✅ platform/services/ for service architecture
  • ✅ README files for package features
  • ✅ BaseService.ts for one-line startup
  • ✅ Message bus client for correlation propagation
  • ✅ Event sourcing for PostgreSQL schema
  • ✅ Service discovery for health monitoring

After reading concept docs, users should:

  1. Understand WHY platform built this way (architecture)
  2. Understand HOW patterns work (patterns)
  3. Understand WHAT infrastructure provides (infrastructure)
  4. Ready to read practical guides (03-guides/)
  5. Ready to reference APIs (04-reference/)
  6. Ready to troubleshoot (05-troubleshooting/)

Architecture: /home/joshwhitlock/Documents/GitHub/banyan-core/docs-new/02-concepts/architecture/

  • platform-overview.md
  • message-bus-architecture.md
  • event-sourcing-architecture.md
  • service-discovery.md
  • api-gateway.md
  • two-layer-authorization.md
  • correlation-and-tracing.md (bonus from Batch 2)

Patterns: /home/joshwhitlock/Documents/GitHub/banyan-core/docs-new/02-concepts/patterns/

  • cqrs-pattern.md
  • event-sourcing-pattern.md
  • saga-pattern.md
  • aggregate-pattern.md
  • read-model-pattern.md
  • domain-event-pattern.md

Infrastructure: /home/joshwhitlock/Documents/GitHub/banyan-core/docs-new/02-concepts/infrastructure/

  • message-bus.md
  • event-store.md
  • caching.md
  • telemetry.md
  • deployment.md

Total: 18 files (17 requested + 1 bonus from Batch 2)