This directory contains complete multi-tier application examples showcasing platform-java's unified orchestration across VMs, containers, Java applications, and native binaries.
Classic web application with database VM, application server, and web frontend.
Architecture:
┌─────────────────┐
│ NGINX (Container) │ ← Web Tier (Reverse Proxy)
└─────────────────┘
↓
┌─────────────────┐
│ Spring Boot (Java) │ ← Application Tier (Business Logic)
└─────────────────┘
↓
┌─────────────────┐
│ PostgreSQL (VM) │ ← Data Tier (Database)
└─────────────────┘
Workload Types:
- Database: PostgreSQL VM (libvirt/KVM)
- App Server: Spring Boot Java app (in-JVM isolation)
- Web Server: NGINX container (Docker/Podman)
Key Features:
- Cross-workload dependencies
- Automatic startup ordering
- Unified monitoring
- Resource quotas per tier
Modern microservices deployment with service mesh, API gateway, and multiple services.
Architecture:
┌─────────────┐
│ API Gateway │ ← Entry Point (Container)
└─────────────┘
↓
┌────┴────┬────────────┬──────────┐
↓ ↓ ↓ ↓
┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐
│Auth │ │User │ │Order │ │Product│
│(Java)│ │(Java)│ │(VM) │ │(Cont.)│
└──────┘ └──────┘ └──────┘ └──────┘
↓ ↓ ↓
┌──────────────────────┐
│ Redis (Container) │ ← Cache Layer
└──────────────────────┘
Workload Types:
- API Gateway: Kong container
- Auth Service: Java microservice
- User Service: Java microservice
- Order Service: Node.js VM
- Product Service: Python container
- Cache: Redis container
Key Features:
- Service discovery
- Inter-service dependencies
- Shared message bus
- Distributed tracing
ETL pipeline with data ingestion, processing, and analytics.
Architecture:
┌───────────┐
│ Ingestion │ ← Data Sources (Native Binary)
└───────────┘
↓
┌───────────┐
│ Processing │ ← Spark Job (VM)
└───────────┘
↓
┌───────────┐
│ Storage │ ← TimescaleDB (Container)
└───────────┘
↓
┌───────────┐
│ Analytics │ ← Java Analytics App
└───────────┘
Workload Types:
- Ingestion: Kafka native binary
- Processing: Apache Spark on VM
- Storage: TimescaleDB container
- Analytics: Java application
Key Features:
- Pipeline orchestration
- Data flow dependencies
- Resource-intensive workloads
- Scheduled execution
Application spanning on-premises VirtOS and cloud providers.
Architecture:
On-Premises (VirtOS) Cloud (AWS/Azure/GCP)
┌─────────────────┐ ┌─────────────────┐
│ Legacy DB (VM) │ ←──────→ │ API Service │
└─────────────────┘ │ (Cloud Function)│
└─────────────────┘
┌─────────────────┐ ┌─────────────────┐
│ Web App (Java) │ ←──────→ │ S3 Storage │
└─────────────────┘ └─────────────────┘
Workload Types:
- On-Premises: VirtOS running platform-java
- Legacy database: VM with existing Oracle/SQL Server
- Web application: Java Spring Boot
- Cloud: Managed services
- API endpoints
- Object storage
- Message queues
Key Features:
- Hybrid deployment
- VirtOS federation
- Secure connectivity
- Cost optimization
cd three-tier-webapp
# Deploy all tiers (platform-java handles dependency order)
platform-java deploy database-tier.yaml
platform-java deploy app-tier.yaml
platform-java deploy web-tier.yaml
# Start the stack (platform-java starts in dependency order)
platform-java start postgres-db # Database starts first
platform-java start spring-app # App waits for database
platform-java start nginx-web # Web waits for app
# Check status
platform-java status
# View metrics for all tiers
platform-java metrics postgres-db
platform-java metrics spring-app
platform-java metrics nginx-web
# Access the application
curl http://localhost:8080cd microservices
# Deploy all services at once
for yaml in *.yaml; do
platform-java deploy $yaml
done
# Start all services (platform-java handles dependencies)
platform-java start-all
# View service mesh
platform-java status
# Test API
curl http://localhost:8000/api/v1/productsEach example includes:
- One descriptor per workload
- Clearly defined dependencies
- Resource quotas
- Health checks
- Architecture diagram
- Deployment instructions
- Testing procedures
- Troubleshooting guide
deploy.sh- Deploy the entire stackstart.sh- Start all workloads in orderstop.sh- Stop all workloadstest.sh- Run integration testscleanup.sh- Remove all workloads
platform-java allows dependencies across all workload types:
# Example: Java app depends on VM database and container cache
applicationId: my-java-app
mainClass: com.example.MyApp
dependencies:
- postgres-vm # VM (KVM/QEMU via libvirt)
- redis-container # Container (Docker/Podman)
- auth-service # Another Java appStartup Order:
- postgres-vm (VM starts first)
- redis-container (Container starts second)
- auth-service (Java app starts third)
- my-java-app (Starts last, after all dependencies ready)
Each tier can have different resource limits:
# Database VM - High resources
resources:
cpu: 8
memory: 32768 # 32GB
# App Server - Medium resources
resources:
cpu: 4
memory: 8192 # 8GB
# Web Server - Low resources
resources:
cpu: 2
memory: 2048 # 2GBAll tiers export metrics to Prometheus:
# Aggregate metrics across all tiers
curl http://localhost:9090/metrics | grep platform-java
# Metrics include:
# - platform-java_vm_cpu_time_seconds{vm="postgres-db"}
# - platform-java_container_cpu_usage{container="nginx-web"}
# - platform-java_app_heap_mb{app="spring-app"}# Enable messaging in all workloads
properties:
platform-java.messaging.enabled: "true"
# Publish events from any workload type
# - VMs can publish to Java apps
# - Containers can subscribe to VM events
# - Java apps can coordinate with native binaries# Register services from any workload
properties:
platform-java.service.register: "true"
platform-java.service.name: "user-service"
platform-java.service.port: "8080"
# Discover services from any other workload
# - Java apps can find VMs
# - Containers can discover Java services
# - VMs can lookup other VMsEach example includes integration tests:
# Run tests for an example
cd three-tier-webapp
./test.sh
# Tests verify:
# - All workloads start successfully
# - Dependencies are respected
# - Cross-workload communication works
# - Health checks pass
# - Application functionalityplatform-java startup-orderplatform-java logs <workload-id>platform-java metrics <workload-id>platform-java dependencies <workload-id>- platform-java Documentation
- VM Management
- Container Deployment
- Application Dependencies
- Resource Enforcement
Have an interesting multi-tier example? Contributions welcome!
- Create example directory
- Add descriptors and documentation
- Include deployment and test scripts
- Submit pull request
Examples should demonstrate:
- Multiple workload types
- Real-world architecture
- Production-ready configuration
- Clear documentation