Deployment Configuration
ConfigMap
Configuration is managed through a ConfigMap:Environment Variables
| Variable | Value | Description |
|---|---|---|
DATABASE_URL | postgres://root:[email protected]:80/exchange-db | PostgreSQL connection URL |
REDIS_URL | redis://exchange-redis-service.default.svc.cluster.local:80 | Redis connection URL |
Service Details
- Replicas: 1
- Image: jogeshwar01/exchange-engine:ed9f044dc79ee713da9518648524e0c68a70ddf7
- Service Type: None (background processor)
Dependencies
The engine service depends on:- PostgreSQL: For persistent order and trade storage
- Redis: For order book caching and pub/sub messaging
- exchange-postgres-service: Database service endpoint
- exchange-redis-service: Cache service endpoint
Functionality
The exchange engine is responsible for:- Order Matching: Matching buy and sell orders based on price-time priority
- Trade Execution: Creating trades when orders match
- Order Book Management: Maintaining real-time order book state
- Event Publishing: Publishing trade events to Redis for real-time updates
Architecture Notes
The engine runs as a background service without a direct HTTP interface. It:- Consumes order messages from Redis
- Updates order book state in memory
- Persists trades to PostgreSQL
- Publishes trade events back to Redis for downstream consumers

