Documentation > Architecture > System Overview

System Overview

Comprehensive overview of SysManage system architecture, components, and data flow patterns.

Architecture Overview

SysManage is built as a distributed system with a central server coordinating multiple lightweight agents across your infrastructure. The architecture emphasizes security, scalability, and reliability while maintaining simplicity for both deployment and operation.

High-Level Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        SysManage Server                        │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ Web UI      │  │ REST API     │  │ WebSocket Gateway       │ │
│  │ (React)     │  │ (FastAPI)    │  │ (Real-time Updates)     │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ Auth/RBAC   │  │ Business     │  │ Task Queue              │ │
│  │ Service     │  │ Logic Layer  │  │ (Background Jobs)       │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ Data Access │  │ Message      │  │ Certificate             │ │
│  │ Layer       │  │ Queue        │  │ Management              │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────────────────────────────────────────────────────┐ │
│  │                PostgreSQL Database                         │ │
│  └─────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
                                  │
                          mTLS Communication
                                  │
┌─────────────────────────────────────────────────────────────────┐
│                     SysManage Agents                           │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ Connection  │  │ Package      │  │ System Monitor          │ │
│  │ Manager     │  │ Manager      │  │ (Metrics Collection)    │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────────┐ │
│  │ Task        │  │ Security     │  │ Local SQLite DB         │ │
│  │ Executor    │  │ Manager      │  │ (State & Cache)         │ │
│  └─────────────┘  └──────────────┘  └─────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
                        

Core Components

🖥️ SysManage Server

The central coordination hub that manages all agents, processes requests, and maintains the global state of your infrastructure.

Key Features:

  • RESTful API for all operations
  • Real-time WebSocket communication
  • Role-based access control (RBAC)
  • Asynchronous task processing
  • Certificate authority for agent authentication

🤖 SysManage Agents

Lightweight agents that run on managed hosts to collect information, execute tasks, and maintain communication with the server.

Key Features:

  • Cross-platform support (Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD)
  • Secure mTLS communication
  • Package management integration
  • System metrics collection
  • Configurable privilege escalation

🌐 Web Interface

Modern React-based web application providing a comprehensive management interface for administrators and operators.

Key Features:

  • Responsive design for desktop and mobile
  • Real-time updates via WebSocket
  • Interactive dashboards and charts
  • Bulk operations and filtering
  • Internationalization support

🔌 REST API

Comprehensive API built with FastAPI providing programmatic access to all SysManage functionality.

Key Features:

  • OpenAPI 3.0 specification
  • JWT-based authentication
  • Rate limiting and throttling
  • Comprehensive error handling
  • Automated documentation

Data Flow Architecture

Agent-to-Server Communication

Agent                    Server                     Database
  │                        │                          │
  │ 1. mTLS Handshake     │                          │
  ├─────────────────────→ │                          │
  │                        │                          │
  │ 2. System Info        │ 3. Validate & Store     │
  ├─────────────────────→ ├────────────────────────→ │
  │                        │                          │
  │ 4. Package Inventory  │ 5. Update Database       │
  ├─────────────────────→ ├────────────────────────→ │
  │                        │                          │
  │ 6. Heartbeat/Status   │ 7. Log Activity          │
  ├─────────────────────→ ├────────────────────────→ │
  │                        │                          │
  │ ← 8. Commands/Tasks ← │ ← 9. Fetch Pending ← ← │
  │                        │                          │
  │ 10. Task Results →    │ 11. Update Status →     │
  ├─────────────────────→ ├────────────────────────→ │
                        

User Request Processing

Web UI/API              Server Layers               Agent
    │                       │                        │
    │ 1. User Request       │                        │
    ├─────────────────────→ │                        │
    │                       │                        │
    │                     ┌─┴─┐ 2. Authentication   │
    │                     │Auth│                     │
    │                     └─┬─┘                     │
    │                       │                        │
    │                     ┌─┴─┐ 3. Authorization    │
    │                     │RBAC│                     │
    │                     └─┬─┘                     │
    │                       │                        │
    │                     ┌─┴─┐ 4. Business Logic   │
    │                     │BLL│                     │
    │                     └─┬─┘                     │
    │                       │                        │
    │                     ┌─┴─┐ 5. Data Access      │
    │                     │DAL│                     │
    │                     └─┬─┘                     │
    │                       │                        │
    │                       │ 6. Queue Task         │
    │                       ├─────────────────────→ │
    │                       │                        │
    │ ← 7. Response ← ← ← │ 8. Async Execution    │
    │                       │                        │
    │ ← 9. Real-time ← ← ← │ ← 10. Results ← ← ← │
    │    Updates             │                        │
                        

Security Architecture

Certificate-Based Authentication

SysManage uses a robust mTLS (mutual TLS) authentication system:

  • Server Certificate Authority: Issues and manages agent certificates
  • Agent Certificates: Unique certificates for each agent with automatic rotation
  • Certificate Validation: Continuous validation of certificate status and revocation
  • Secure Enrollment: Automated certificate enrollment with approval workflows

Network Security

Transport Layer

  • TLS 1.3 for all communications
  • Certificate pinning for enhanced security
  • Perfect Forward Secrecy (PFS)

Application Layer

  • JWT tokens for web authentication
  • API rate limiting and throttling
  • Request validation and sanitization

Data Layer

  • Encrypted database connections
  • Sensitive data encryption at rest
  • Audit logging for all operations

Scalability Design

Horizontal Scaling

SysManage is designed to scale horizontally across multiple dimensions:

Server Scaling

  • Stateless Design: Servers maintain no session state, enabling easy horizontal scaling
  • Load Balancing: Support for standard load balancers with session affinity for WebSocket connections
  • Database Clustering: PostgreSQL clustering support for high availability
  • Shared Storage: Certificate and configuration storage can be shared across instances

Agent Scaling

  • Lightweight Footprint: Minimal resource usage per agent
  • Efficient Communication: Optimized protocols to minimize network overhead
  • Connection Pooling: Intelligent connection management and pooling
  • Regional Distribution: Support for geographically distributed deployments

Performance Characteristics

Agent Capacity

Single server instance can manage:

  • Small: 100-500 agents
  • Medium: 500-2,000 agents
  • Large: 2,000-10,000 agents (with optimization)

Response Times

  • API Responses: < 100ms typical
  • Agent Commands: < 5s delivery
  • Real-time Updates: < 1s propagation

Resource Usage

  • Server RAM: 2-8GB baseline
  • Agent RAM: 10-50MB per agent
  • Network: 1-10KB/s per agent

Deployment Patterns

Single Instance Deployment

Use Cases:

  • Small to medium environments (< 500 hosts)
  • Development and testing
  • Single-location deployments

Architecture:

┌─────────────────────┐
│   Load Balancer     │ (Optional)
│   (Nginx/HAProxy)   │
└─────────┬───────────┘
          │
┌─────────┴───────────┐
│   SysManage Server  │
│   ┌─────────────┐   │
│   │ Application │   │
│   └─────────────┘   │
│   ┌─────────────┐   │
│   │ PostgreSQL  │   │
│   └─────────────┘   │
└─────────────────────┘
                        

High Availability Deployment

Use Cases:

  • Production environments requiring 99.9%+ uptime
  • Large-scale deployments (> 1000 hosts)
  • Business-critical infrastructure management

Architecture:

┌─────────────────────┐
│   Load Balancer     │
│   (Active/Passive)  │
└─────────┬───────────┘
          │
┌─────────┴───────────┬─────────────────────┐
│   SysManage #1      │   SysManage #2      │
│   ┌─────────────┐   │   ┌─────────────┐   │
│   │ Application │   │   │ Application │   │
│   └─────────────┘   │   └─────────────┘   │
└─────────┬───────────┴─────────┬───────────┘
          │                     │
┌─────────┴─────────────────────┴───────────┐
│        PostgreSQL Cluster                 │
│   ┌─────────┐   ┌─────────┐   ┌─────────┐ │
│   │Primary  │   │Replica 1│   │Replica 2│ │
│   └─────────┘   └─────────┘   └─────────┘ │
└───────────────────────────────────────────┘
                        

Multi-Region Deployment

Use Cases:

  • Global organizations with distributed infrastructure
  • Compliance requirements for data locality
  • Disaster recovery across regions

Architecture:

Region 1 (Primary)           Region 2 (Secondary)
┌─────────────────────┐     ┌─────────────────────┐
│   SysManage Cluster│     │   SysManage Cluster│
│   ┌─────────────┐   │     │   ┌─────────────┐   │
│   │ Application │   │     │   │ Application │   │
│   └─────────────┘   │     │   └─────────────┘   │
│   ┌─────────────┐   │ ←──→│   ┌─────────────┐   │
│   │ PostgreSQL  │   │     │   │ PostgreSQL  │   │
│   └─────────────┘   │     │   └─────────────┘   │
└─────────────────────┘     └─────────────────────┘
         │                           │
         ▼                           ▼
┌─────────────────────┐     ┌─────────────────────┐
│   Regional Agents   │     │   Regional Agents   │
└─────────────────────┘     └─────────────────────┘
                        

Technology Stack

Backend Technologies

  • Python 3.11+: Core runtime environment
  • FastAPI: Modern, fast web framework
  • SQLAlchemy: ORM and database abstraction
  • PostgreSQL: Primary database system
  • Redis: Caching and session storage
  • Celery: Distributed task queue

Frontend Technologies

  • React 18: UI framework
  • TypeScript: Type-safe JavaScript
  • Vite: Build tool and development server
  • React Query: Data fetching and state management
  • Chakra UI: Component library
  • Chart.js: Data visualization

Communication & Security

  • WebSocket: Real-time communication
  • mTLS: Mutual TLS authentication
  • JWT: JSON Web Tokens for API auth
  • OpenSSL: Cryptographic operations
  • Protocol Buffers: Efficient serialization

DevOps & Deployment

  • Docker: Containerization
  • Kubernetes: Container orchestration
  • Nginx: Reverse proxy and load balancing
  • Prometheus: Metrics and monitoring
  • Grafana: Observability dashboards

Integration Points

External System Integration

Authentication Systems

  • LDAP/Active Directory
  • SAML 2.0 providers
  • OAuth 2.0/OpenID Connect
  • Multi-factor authentication

Monitoring & Alerting

  • Prometheus metrics export
  • Grafana dashboard integration
  • Email/SMS notifications
  • Webhook integrations

Automation & Orchestration

  • Ansible integration
  • Terraform providers
  • CI/CD pipeline hooks
  • Infrastructure as Code

Package Repositories

  • APT repositories (Debian/Ubuntu)
  • YUM/DNF repositories (RHEL/CentOS)
  • Homebrew (macOS)
  • Chocolatey (Windows)

Next Steps

To dive deeper into specific architectural aspects:

  1. Design Principles: Understand the core design philosophy
  2. Database Schema: Explore the data model
  3. REST API Design: Learn about the API architecture
  4. WebSocket Protocol: Real-time communication details
  5. Scaling Strategies: Plan for growth and scale