How absmach/magistrala works
Main System Components
a) Client Layer:
• Multiple protocol endpoints (HTTP, MQTT, WebSocket, CoAP)
• Device connections and user interfaces
• Multi-tenant architecture
b) Gateway Layer:
• NGINX reverse proxy
• VerneMQ MQTT broker
• Protocol adapters
c) Core Services Layer:
• Bootstrap service (device provisioning)
• Authentication & Authorization (with Vault integration)
• Rules Engine (RE)
• Notification services (SMTP, SMPP)
d) Data Layer:
• PostgreSQL database
• TimescaleDB
• Redis cache
• NATS message broker
Specific Implementation Details
Key architectural elements:
• Authentication Flow
• mTLS certification path
• Access control (ABAC/RBAC)
• Message Flow
• Writers (postgres-writer, timescale-writer)
• Readers (postgres-reader, timescale-reader)
• Event sourcing pattern
• Monitoring Stack
• Prometheus metrics
• OpenTelemetry tracing
• Logging infrastructure
Specific Implementation Notes
• The event-driven architecture using NATS
• The separation between readers and writers
• The security layer with Vault integration
• The scalability pattern with separate reader/writer services
Additional Elements
Include:
• Version compatibility information
• Deployment boundaries (if using microservices)
• Integration points for external systems
┌─────────────────────────────────┐
• Client Layer (Devices/Users) │
• ┤
• Gateway Layer (NGINX/VerneMQ) │
• ┤
• Core Services │
• ┤
• Data Layer │
• ┘
Critical Paths to Highlight
Emphasize:
• Device provisioning flow
• Message publication path
• Authentication/Authorization flow
• Rules engine processing path