Design and Implementation of a Middleware Platform for Managing Heterogeneous Cloud-Edge Deployments
Middleware_Platform_for_Cloud_Edge_Computing/
├── agents/ # Go agent implementation
│ ├── main.go # Main agent logic
│ ├── go.mod # Go module definition (Go 1.21)
│ └── Dockerfile # Multi-stage Docker build for agent
├── backend/ # Node.js backend service
│ ├── index.js # Express server entry point
│ ├── package.json # Node.js dependencies
│ └── node_modules/ # Installed dependencies
├── config/ # Kubernetes deployment configurations
│ ├── agent-daemonset.yaml # DaemonSet for agent deployment
│ └── .kube/ # Kubernetes config files
├── shell/ # Deployment and setup scripts
│ ├── cloud-setup.sh # Cloud node setup script
│ ├── edge-setup.sh # Edge node setup script
│ ├── deploy-agents.sh # Agent deployment script
│ ├── verify.sh # Verification script
│ └── resource-discovery.sh # Resource discovery script
├── docs/ # Documentation
│ └── openapi.yaml # API specification
├── ml/ # Machine learning models (future)
├── dashboard/ # Frontend dashboard (future)
├── services/ # Microservices (future)
├── .github/ # GitHub Actions CI/CD
│ └── workflows/ # CI/CD pipeline definitions
├── kind-config.yaml # Kind cluster configuration
├── docker-compose.yml # Docker Compose for local development
├── Makefile # Build and deployment automation
├── .gitignore # Git ignore rules
└── README.md # This file
agents/: Contains the Go-based agent that runs on each cloud/edge node. The agent is responsible for resource monitoring, service discovery, and communication with the backend.
# 1. Start Docker services (if using docker-compose)
make docker-up
# 2. Setup cloud infrastructure (Kubernetes with Kind)
make cloud
# 3. Setup edge infrastructure (K3s with K3d)
make edge
# 4. Start backend and MongoDB locally (required for agents)
make services-start
# 5. Deploy monitoring agents to cloud nodes
make cloud-agent
# 6. Install monitoring stack (Prometheus + Grafana)
make monitoring
# 7. Verify infrastructure
# make verifyLocal Services:
-
MongoDB:
localhost:27017(Docker container) -
Backend API:
localhost:3000(Node.js process) -
Prometheus:
localhost:9090(after monitoring setup) -
Grafana:
localhost:3000(admin/admin123) -
Agent Access:
http://192.168.9.100:3000(via host IP) -
backend/: Node.js Express server that provides the central backend service for the middleware platform, handling service registration, scheduling, and API endpoints. Can be run locally or in containers. -
config/: Kubernetes manifests and configuration files for deploying the platform components in a Kubernetes cluster. -
shell/: Automation scripts for setting up cloud/edge nodes, deploying agents, and managing the platform infrastructure. Includes local service startup scripts. -
docs/: Project documentation including API specifications and technical guides. -
ml/: Reserved for future machine learning models for load prediction and placement optimization. -
services/: Reserved for future microservices that will run on the platform. -
.github/: GitHub Actions workflows for continuous integration and deployment.
-
Resource Discovery Service
- Collects and maintains metadata on edge/cloud nodes (CPU, memory, bandwidth).
- Periodically updated via heartbeat or polling.
-
Service Registration & Scheduling
- Users register services: Manual / policy-based automatic deployment
- ✨ Train DL model for load prediction and placement optimization (recommend service nodes)
- Dataset: Google Borg trace / Alibaba Cluster Trace
-
Unified API Interface
Exposes consistent APIs to developers, abstracting away the underlying heterogeneity of cloud and edge.
-
Communication Coordinator
Inter-node messaging. Service invocation & data consistency.
-
Monitoring & Logging Module
Collects runtime metrics, service statuses, and logs from cloud/edge node. (Visible)
- Security (Future work)
| Layer | Tech Stack |
|---|---|
| Middleware Communication | gRPC, REST API |
| Service Deployment | Docker, Kubernetes (K3s for edge) (nodes simulation ) |
| Service Registry & Backend | Node.js, Express, MongoDB |
| Frontend Dashboard | React.js, Chart.js |
| Monitoring | Prometheus |
| DL Model (Optional) | PyTorch or TensorFlow (for load prediction or placement optimization) |
Use
Dockerto simulate nodesUse
Kubernetesto label nodes as "cloud" or "edge"
-
Each node = a Docker container
-
Each container runs the same or different microservice instance
-
A different CPU/memory limits to mimic heterogeneity
Simulate services to run on the nodes
- REST APIs (Flask / FastAPI)
- gRPC Servers
| Feature | Kubernetes Implementation | Project’s Implementation & Innovation |
|---|---|---|
| Node Configuration | Manual K3s / KubeEdge setup; node labels configured by hand |
Automatic resource discovery, dynamic labeling, adapted for low-resource edge devices |
| Scheduling | Static scheduling based on resource requests and affinity/anti-affinity rules |
Deep-learning–driven predictive scheduling, dynamically optimizes placement on fluctuating edge nodes |
| Communication | Cloud-centric network model; edge support requires KubeEdge | gRPC/REST optimized for edge communication with built-in consistency mechanisms |
| Monitoring | Prometheus/Grafana must be configured manually; limited edge visibility |
Integrated edge monitoring with real-time dashboards exposing edge metrics |
| Developer Experience | Complex toolchain (kubectl, YAML); steep learning curve | Unified API and visual dashboard streamline operations |