Skip to main content

Infrastructure Level 1 - Application Architecture

This level shows the high-level deployment architecture of the BookWorm application, focusing on the major infrastructure components and their relationships.

Architecture Diagram

Component Overview

API Gateway

  • Technology: YARP (Yet Another Reverse Proxy)
  • Purpose: Single entry point for all client requests
  • Features: Request routing, load balancing, SSL termination
  • Services: Routes to Catalog, Chat, Basket, Ordering, Rating APIs

Identity Provider

  • Technology: Keycloak
  • Purpose: Centralized authentication and authorization
  • Features: JWT token issuance, custom theming, realm management
  • Database: External PostgreSQL database for user data

Microservices Layer

Eight independent services handling specific business domains:

ServicePurposeDatabaseKey Dependencies
CatalogProduct managementPostgreSQLQdrant, Redis, Azure Blob
ChatReal-time messagingPostgreSQLAzure OpenAI, MCP Tools
BasketShopping cartRedisCatalog API
OrderingOrder processingPostgreSQLBasket, Catalog
RatingReviews & ratingsPostgreSQLChat API
FinancePayment processingPostgreSQLKafka
NotificationEmail/SMSPostgreSQLMailPit, Kafka
SchedulerBackground jobsPostgreSQLTickerQ dashboard

Data Layer

  • PostgreSQL: Primary relational database (9 databases)
  • Redis: Caching and session storage (FusionCache L2)
  • Qdrant: Vector database for AI-powered search
  • Kafka: Message broker for async communication (WolverineFx)
  • Azure Blob: File and media storage

AI Services

  • Azure OpenAI: GPT-4o-mini for conversational AI, text-embedding-3-large for semantic search
  • Semantic Kernel: Orchestration layer for AI pipelines
  • Microsoft Agents AI: Multi-agent orchestration (A2A protocol)

Monitoring & Tools

  • Health Checks UI: Service health monitoring
  • Scalar: Interactive API documentation
  • K6: Performance testing (development only)
  • MCP Tools: Model Context Protocol integration

Deployment Characteristics

Scalability

  • Horizontal: Services can be scaled independently
  • Vertical: Resource allocation per service
  • Auto-scaling: Azure Container Apps automatic scaling

Reliability

  • Service Dependencies: Managed through wait conditions
  • Health Checks: All services expose health endpoints
  • Circuit Breakers: Resilience patterns implemented
  • Data Persistence: Volume mounts for stateful services

Security

  • Authentication: Keycloak JWT tokens
  • Authorization: Role-based access control
  • Secrets: Azure Key Vault integration
  • Network: Service-to-service communication secured