Skip to content

Concepts

🎯 Goal: Build a deep mental model of how the platform works and why it’s designed this way

This section provides in-depth explanations of the Banyan platform’s architecture, design patterns, and underlying principles. Understanding these concepts will help you make better design decisions and troubleshoot effectively.

Understanding concepts in the right order accelerates learning. Follow this dependency graph:

Foundation Concepts (Read First)
────────────────────────────────────────────────────────────────────
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
β”‚ LAYER 1: Core Philosophy (30 minutes) β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Zero Infrastructure Design β”‚ β”‚
β”‚ β”‚ "Why Banyan exists" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Message Bus Architecture β”‚ β”‚
β”‚ β”‚ "How services communicate" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
Core Patterns (Read Second)
────────────────────────────────────────────────────────────────────
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
β”‚ LAYER 2: Essential Patterns (60 minutes) β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ CQRS Pattern β”‚ β”‚
β”‚ β”‚ "Separating reads from writes" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β–Ό β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Handler Discovery β”‚ β”‚ Domain Modeling β”‚ β”‚
β”‚ β”‚ "Auto-registration"β”‚ β”‚ "Business logic" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
Advanced Patterns (Read Third)
────────────────────────────────────────────────────────────────────
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
β”‚ LAYER 3: Advanced Patterns (90 minutes) β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Event Sourcing β”‚ β”‚
β”‚ β”‚ "State as events" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β–Ό β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Two-Layer Auth β”‚ β”‚ Saga Pattern β”‚ β”‚
β”‚ β”‚ "Security model" β”‚ β”‚ "Distributed TX" β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
Infrastructure (Read As Needed)
────────────────────────────────────────────────────────────────────
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
β”‚ LAYER 4: Operational Concerns (60 minutes) β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Telemetry β”‚ β”‚ Scalability β”‚ β”‚ Event Store β”‚ β”‚
β”‚ β”‚ & Tracing β”‚ β”‚ Patterns β”‚ β”‚ Design β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Message Bus β”‚ β”‚ Deployment β”‚ β”‚ Caching β”‚ β”‚
β”‚ β”‚ Reliability β”‚ β”‚ Strategy β”‚ β”‚ Strategy β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Goal: Understand enough to build services effectively

  1. Zero Infrastructure Design (15 min)

    • Why the platform exists
    • What problems it solves
  2. Message Bus Architecture (15 min)

    • How services communicate
    • Why no direct HTTP calls
  3. CQRS Pattern (15 min)

    • Command vs Query separation
    • Why it matters
  4. Handler Discovery (15 min)

    • Convention over configuration
    • How handlers are auto-registered

Goal: Understand architectural decisions and trade-offs

Phase 1: Foundation (30 min)

  1. Zero Infrastructure Design
  2. Message Bus Architecture
  3. Service Discovery
  4. API Gateway

Phase 2: Core Patterns (60 min) 5. CQRS Pattern 6. Domain Modeling 7. Handler Discovery 8. Event Sourcing

Phase 3: Advanced Patterns (60 min) 9. Two-Layer Authorization 10. Saga Pattern 11. Read Model Projections

Phase 4: Infrastructure (30 min) 12. Telemetry and Observability 13. Message Bus Reliability 14. Event Store Design

Goal: Understand internals to extend platform capabilities

Read all concepts in dependency order, then:

⏱️ 60 minutes total | 🟑 Intermediate

Core architectural components and how they interact:

ConceptTimeDifficultyPrerequisites
Message Bus Architecture15 min🟒 BeginnerNone
Service Discovery15 min🟑 IntermediateMessage Bus
API Gateway15 min🟑 IntermediateService Discovery
Zero Infrastructure Design15 min🟒 BeginnerNone
Distributed Tracing15 min🟑 IntermediateAPI Gateway

What you’ll understand:

  • βœ… Why services communicate exclusively via message bus
  • βœ… How API Gateway translates HTTP/GraphQL to messages
  • βœ… How services discover and call each other
  • βœ… How distributed tracing works across services
  • βœ… Why there’s no infrastructure code in services

⏱️ 90 minutes total | 🟑 Intermediate

Design patterns and best practices used throughout the platform:

ConceptTimeDifficultyPrerequisites
CQRS Pattern20 min🟑 IntermediateMessage Bus
Event Sourcing30 minπŸ”΄ AdvancedCQRS
Domain Modeling15 min🟒 BeginnerCQRS
Two-Layer Authorization15 min🟑 IntermediateDomain Modeling
Saga Pattern30 minπŸ”΄ AdvancedEvent Sourcing
Handler Discovery15 min🟒 BeginnerCQRS

What you’ll understand:

  • βœ… Why commands and queries are separated
  • βœ… How state is stored as event sequences
  • βœ… How to express business logic without infrastructure
  • βœ… How permissions and policies work together
  • βœ… How distributed transactions are coordinated
  • βœ… How handlers are auto-discovered

⏱️ 60 minutes total | πŸ”΄ Advanced

Platform infrastructure and operational concerns:

ConceptTimeDifficultyPrerequisites
Telemetry and Observability15 min🟑 IntermediateDistributed Tracing
Service Deployment10 min🟑 IntermediateZero Infrastructure
Scalability15 minπŸ”΄ AdvancedMessage Bus
Message Bus Reliability10 min🟑 IntermediateMessage Bus
Event Store15 minπŸ”΄ AdvancedEvent Sourcing
Caching Strategy10 min🟑 IntermediateCQRS

What you’ll understand:

  • βœ… How metrics, logs, and traces are collected
  • βœ… How services are deployed and scaled
  • βœ… How horizontal scaling works
  • βœ… How message delivery is guaranteed
  • βœ… How events are persisted in PostgreSQL
  • βœ… How query results are cached in Redis

How services communicate β†’ Message Bus Architecture (15 min) β†’ Service Discovery (15 min)

How to separate concerns β†’ CQRS Pattern (20 min) β†’ Domain Modeling (15 min)

How to handle state β†’ Event Sourcing (30 min) β†’ Event Store (15 min)

How security works β†’ Two-Layer Authorization (15 min) β†’ API Gateway (15 min)

How to debug issues β†’ Distributed Tracing (15 min) β†’ Telemetry and Observability (15 min)

How to scale services β†’ Scalability (15 min) β†’ Message Bus Reliability (10 min)

How distributed transactions work β†’ Saga Pattern (30 min) β†’ Event Sourcing (30 min)

Each concept document follows this structure:

1. Overview
└─ What this concept is
└─ Why it matters
2. The Problem
└─ What problem does this solve?
└─ Traditional approaches
3. The Solution
└─ How Banyan solves it
└─ Key design decisions
4. How It Works
└─ Detailed explanation
└─ Diagrams and examples
5. Benefits and Trade-offs
└─ Advantages
└─ Limitations
└─ When to use
6. Implementation Details
└─ Technical specifics
└─ Code examples
7. Related Concepts
└─ Prerequisites
└─ Next steps

πŸ’‘ Best Practice: Read β€œOverview” and β€œThe Problem” sections first to understand context before diving into implementation details.

Focus: Understand patterns for building services

30 minutes: Essential reading
β”œβ”€ Zero Infrastructure Design
β”œβ”€ CQRS Pattern
└─ Handler Discovery
60 minutes: Deep dive
β”œβ”€ Event Sourcing
β”œβ”€ Domain Modeling
└─ Two-Layer Authorization

Focus: Understand how frontend interacts with platform

45 minutes: Essential reading
β”œβ”€ API Gateway
β”œβ”€ Message Bus Architecture
β”œβ”€ CQRS Pattern
└─ Service Discovery
30 minutes: Real-time features
β”œβ”€ Event Sourcing
└─ WebSocket Subscriptions

Focus: Understand internals for extension and operations

3 hours: Comprehensive reading
β”œβ”€ All Architecture concepts (60min)
β”œβ”€ All Patterns concepts (90min)
└─ All Infrastructure concepts (60min)

Focus: Understand deployment and operations

60 minutes: Operations focus
β”œβ”€ Service Deployment
β”œβ”€ Scalability
β”œβ”€ Telemetry and Observability
β”œβ”€ Message Bus Reliability
└─ Distributed Tracing

βœ… Recommended: Complete Getting Started first

Having hands-on experience makes concepts more concrete and easier to understand.

  • See it in action: Examples demonstrate concepts
  • Look up details: Reference provides API specifics
  • Clarify confusion: Troubleshooting addresses common misunderstandings
  • Apply knowledge: Tutorials let you practice
  • Solve problems: Guides show how to implement patterns
  • Build services: Use concepts to make better design decisions
If you’re wondering…Read this concept…
Why no HTTP between services?Message Bus Architecture
Why separate commands and queries?CQRS Pattern
How do events become state?Event Sourcing
How does auto-discovery work?Handler Discovery
How do permissions work?Two-Layer Authorization
How do I debug across services?Distributed Tracing
How do distributed transactions work?Saga Pattern
How does caching work?Caching Strategy
How does the platform scale?Scalability
Why no infrastructure code?Zero Infrastructure Design

Start learning β†’ Zero Infrastructure Design (15 minutes, 🟒 Beginner)