Architecture
EGOS Cloud is built on modern web technologies with a focus on real-time communication and extensibility.
System Design
Message-Driven Architecture
All communication in EGOS uses a message-driven pattern:
- Events flow from devices to the cloud
- Commands flow from the cloud to devices
- State is synchronized across all components
Note
This architecture enables loose coupling between components and supports offline operation of controllers.
Component Hierarchy
Game ├── Components (physical devices) │ ├── Buttons │ ├── LEDs │ └── Sensors ├── Variables (game state) │ ├── Counters │ ├── Flags │ └── Timers └── Logic Flows ├── Triggers ├── Conditions └── Actions
Key Patterns
Message Envelope
All MQTT messages use a standardized envelope:
{
"header": {
"messageId": "uuid-here",
"timestamp": "2024-01-15T10:30:00Z",
"messageType": "INPUT_EVENT",
"priority": "NORMAL",
"source": "controller-1/module-buttons/button-1"
},
"payload": {
"pressed": true
}
}
Circuit Breaker
Device communication includes fault tolerance:
- Automatic retry with exponential backoff
- Circuit breaker for failing devices
- Health monitoring and alerts
Priority Queues
Messages are processed based on priority:
| Priority | Use Case | Target Latency |
|---|---|---|
| CRITICAL | Safety/emergency | <10ms |
| HIGH | User interaction | <50ms |
| NORMAL | State updates | <100ms |
| LOW | Analytics/logging | Best effort |
Scalability
EGOS Cloud supports horizontal and vertical scaling:
- Multiple controllers per cloud instance
- Dozens of modules per controller
- Hot-plug device support
- State persistence across restarts
Pro Tip
For large installations, consider running multiple controller instances with load balancing.