Ice Architecture Overview

Understanding the Server + Client + Shared Storage architecture pattern

Overall Architecture

Ice adopts a zero external dependency minimalist architecture, implementing configuration storage and synchronization through the file system.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Shared Storage (ice-data/)                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  apps/  โ”‚  โ”‚ bases/  โ”‚  โ”‚ confs/  โ”‚  โ”‚  versions/  โ”‚    โ”‚
โ”‚  โ”‚  Apps   โ”‚  โ”‚  Rules  โ”‚  โ”‚  Nodes  โ”‚  โ”‚  Increments โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ–ฒ Write config                      โ–ฒ Read config
        โ”‚                                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Ice Server  โ”‚                   โ”‚   Ice Client  โ”‚
โ”‚  (Management) โ”‚                   โ”‚  (Execution)  โ”‚
โ”‚               โ”‚                   โ”‚               โ”‚
โ”‚ โ€ข Web UI      โ”‚                   โ”‚ โ€ข Poll versionโ”‚
โ”‚ โ€ข Rule config โ”‚                   โ”‚ โ€ข Load updatesโ”‚
โ”‚ โ€ข Publishing  โ”‚                   โ”‚ โ€ข Execute rulesโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Architecture Features

FeatureDescription
๐Ÿšซ No DatabaseNo MySQL required, configs stored as JSON files
๐Ÿšซ No MiddlewareNo ZooKeeper, Redis, etc.
๐Ÿšซ No Long ConnectionsNo NIO/Netty, Client polls files for updates
โœ… File System SyncServer and Client share the same storage directory
โœ… Docker FriendlyDeploy with a single command

Core Components

Ice Server - Rule Management Platform

Role: Visual rule configuration management center

Core Capabilities:

  • Web-based visual rule configuration interface
  • Store all rule configurations as JSON files
  • Support rule version management and history rollback
  • Generate incremental updates for Client consumption
  • Multi-application (App) isolation management

Ice Client - Rule Execution Engine

Role: Rule execution core for business applications

Core Capabilities:

  • Load rule configurations from file system to memory
  • Poll version file to detect configuration changes
  • Provide high-performance rule execution interface
  • Support multiple node types and orchestration modes
  • Pure in-memory computation, millisecond response

Shared Storage - Configuration Sync Bridge

Role: Configuration synchronization medium between Server and Client

Storage Structure:

ice-data/
โ”œโ”€โ”€ apps/                    # Application configs
โ”‚   โ”œโ”€โ”€ _id.txt             # ID generator
โ”‚   โ””โ”€โ”€ {app}.json          # App information
โ”œโ”€โ”€ clients/                 # Client information
โ”‚   โ””โ”€โ”€ {app}/
โ”‚       โ”œโ”€โ”€ {address}.json  # Heartbeat file
โ”‚       โ””โ”€โ”€ _latest.json    # Latest client
โ””โ”€โ”€ {app}/                   # App rules
    โ”œโ”€โ”€ version.txt         # Version number
    โ”œโ”€โ”€ bases/              # Base configs
    โ”œโ”€โ”€ confs/              # Conf configs
    โ”œโ”€โ”€ versions/           # Incremental updates
    โ””โ”€โ”€ history/            # Publish history

Configuration Sync Flow

1. Server Publishing

User modifies rules in Web UI
        โ†“
Clicks "Publish" button
        โ†“
Server updates bases/ and confs/ files
        โ†“
Generates incremental file to versions/
        โ†“
Updates version.txt version number

2. Client Polling

Client periodically checks version.txt (default 5 seconds)
        โ†“
Detects new version number
        โ†“
Reads incremental update files from versions/
        โ†“
Hot-reloads rule configuration in memory

3. Heartbeat Mechanism

Client periodically writes heartbeat file to clients/
        โ†“
Server reads heartbeat files to detect Client status
        โ†“
Clients that haven't updated are marked as offline

Deployment Methods

Single Machine Deployment

Simplest deployment with Server and Client on the same machine:

# Start Server
docker run -d --name ice-server \
  -p 8121:8121 \
  -v ./ice-data:/app/ice-data \
  waitmoon/ice-server:latest

# Client configures same path
ice:
  storage:
    path: ./ice-data

Docker Compose Deployment

version: '3.8'
services:
  ice-server:
    image: waitmoon/ice-server:latest
    ports:
      - "8121:8121"
    volumes:
      - ./ice-data:/app/ice-data

  your-app:
    build: .
    volumes:
      - ./ice-data:/app/ice-data  # Shared storage
    depends_on:
      - ice-server

Distributed Deployment

Multiple Server/Client instances sharing storage:

services:
  ice-server-1:
    image: waitmoon/ice-server:latest
    volumes:
      - /shared/ice-data:/app/ice-data  # NFS/Cloud

  ice-server-2:
    image: waitmoon/ice-server:latest
    volumes:
      - /shared/ice-data:/app/ice-data

  client-1:
    volumes:
      - /shared/ice-data:/app/ice-data

  client-2:
    volumes:
      - /shared/ice-data:/app/ice-data

Recommended Shared Storage Solutions:

  • NFS: Network File System, suitable for intranet
  • Cloud Drives: AWS EFS, Azure Files, Google Filestore, etc.
  • Distributed File Systems: GlusterFS, CephFS, etc.

Performance Characteristics

FeatureDescription
Zero Network OverheadConfig sync via file system, no network latency
Pure In-Memory ExecutionRule execution entirely in memory, millisecond response
Incremental UpdatesOnly load changed configurations, reduce resource usage
Lock-Free DesignNode execution independent, naturally supports high concurrency

Next Steps