Skip to content

aregtech/areg-sdk

Latest release GitHub commits Stars Fork Watchers Wiki Pages

⭐ If you find Areg SDK useful, please give us a star — it helps the community grow!


Most C++ projects don’t fail on algorithms — they fail on threads, IPC, and fragile wiring. Unlike traditional frameworks, Areg SDK automates communication, unifying async RPC, Pub/Sub, and service discovery. Its self-managed service mesh enables scalable, fault-tolerant systems across threads, processes, and devices — with no boilerplate, no fragile wiring.

Areg SDK combines a lightweight C++17 framework, multitarget router, and developer tools for distributed apps.


Project Status

CMake build MS Build CodeQL
C++ solution Operating systems CPU Architectures

Table of Contents

Important

Full technical guidance for building, using, and integrating Areg SDK is available in the documentation.


Why Areg SDK: Benefits and Comparison

Areg SDK is a Software Development Kit built around the Areg Framework — a runtime with built-in middleware that automates threading, service discovery, and inter-node messaging, so teams can build distributed systems without boilerplate or fragile wiring. Unlike gRPC, DDS, or ZeroMQ, it provides a self-managed mesh and a unified API across threads, processes, and devices.
Result: scalable, fault-tolerant systems that are faster, simpler, and safer.

Top 5 Benefits

  1. No manual threading
    Threads, components, and watchdogs are auto-created — preventing subtle concurrency bugs and saving time.

  2. Unified API
    Services are called the same way locally or remotely — always async, non-blocking, and consistent.

  3. Self-managed mesh
    Automatic service discovery and routing across threads, processes, and devices — no manual wiring.

  4. Resilient by design
    Components can join or leave dynamically; watchdogs restart failed threads for fault-tolerant systems.

  5. Built-in observability
    Integrated logging and scopes help per-method duration measurement to monitor and optimize efficiently.

💡 When to use: Linux & Windows, embedded and desktop C++ apps, scaling from prototype to multi-node.
⚠️ When not to use: RTOS (at the moment), web, or non-C++ apps — use web/RTOS-specific tools instead.

Compared to Alternatives

Feature Areg SDK Competitors (gRPC, DDS, ZeroMQ)
Ease of Use ✅ Automated setup ⚠️ Manual, boilerplate, complex
Automation ✅ Codegen, modeling, dispatch ⚠️ Manual setup, stubs only
Auto-Discovery ✅ Self-organizing service mesh ✅ DDS: built-in, ⚠️ gRPC/ZeroMQ: external
Fault-Tolerance ✅ Watchdog & auto-restart ✅ DDS: QoS, ⚠️ gRPC/ZeroMQ: Retries/Manual
Request-Reply ✅ Native Object RPC in service ✅ gRPC: RPC, ⚠️ DDS/ZeroMQ: Over topics/patterns
Pub/Sub ✅ Native, built-in in service ✅ DDS: Topics, ⚠️ Add-ons/Manual
Built-in Logging ✅ Integrated, dynamic + viewer ⚠️ Vendor-specific (DDS) or External
Dev Time Saved ✅ Faster, via automation ⚠️ Limited, external tooling

Decision Checklist

  • Do threading and synchronization issues slow your progress?
  • Does debugging across threads, processes, or components take excessive time?
  • Is setting up communication across processes or nodes complex and error-prone?
  • Do remote failures and reconnections create delays and extra work?
  • Would a unified communication model across threads, processes, and devices simplify development?

💡 If you answer Yes to 3+ questions, Areg SDK is likely a good fit.


Getting Started: Build and Integration

Prerequisites

  • C++17 compiler: GCC, Clang/LLVM, MSVC, or MinGW
  • CMake ≥ 3.20
  • Java ≥ 17 (required for code generation tools)

Supported OS: Linux, Windows
Supported Hardware: x86, x86_64, ARM, AArch64

See the CMake Configuration Guide for detailed setup, compiler options, and troubleshooting tips.

Build Areg SDK

Clone the repository and build the SDK in one go:

git clone https://github.com/aregtech/areg-sdk.git
cd areg-sdk
cmake -B build
cmake --build build -j 12

💡 Tip: Copy-paste these commands directly in Linux Terminal, Windows CMD, or PowerShell.

Run Minimal RPC Example

Run the pre-built 01_minimalrpc minimal RPC demo to verify the build located in sub-directory:

./product/build/<compiler>/<os>-<hw>-<build-type>-<lib-type>/bin/

This 📄 example source demonstrates Multithreaded RPC in a single process:

  • Service Consumer runs in one thread
  • Service Provider runs in another thread
  • Consumer calls the method of remote Provider asynchronously

Message Flow:

🟢 main() → 🏗 load model → 🔗 auto-connect → 📤 Consumer request → 🖨 Provider prints → ✅ application exits

Learning Path

  1. 01_minimalrpc – Minimal RPC between two components
  2. 02_minimalipc – IPC across processes, requires mtrouter
  3. 03_helloservice – Multithreaded RPC + IPC example
  4. More Examples – Advanced SDK features and usage patterns

⚠️ For IPC, ensure mtrouter is running → see mtrouter docs

Integration & Extensions

💡 Advanced builds (IDE setup, cross-compilation, disabling tests/examples) → consult Wiki


Core Modules and Architecture

Areg SDK combines the Areg Framework, Multitarget Router, logging utilities, and development tools.

Modules Overview

Module Role & Purpose
Areg Library (areg) Core framework + middleware. Automates Object RPC (ORPC), IPC, threading, routing, and fault recovery.
Code Generator (codegen.jar) Build-time tool. Generates code from service APIs to eliminate manual coding and automate RPC.
Multitarget Router (mtrouter) Required for IPC. Routes messages across processes and devices to form a service mesh.
Log Collector (logcollector) Optional developer tool. Aggregates logs from distributed apps for monitoring, debugging, and analysis.
Lusan (GUI Tool) Optional developer tool. Provides visual API design, log inspection, and performance visualization.
Examples Learning & validation. Sample projects that demonstrate Areg in action.

Architecture

Areg uses an interface-centric Object RPC (ORPC) model. Applications expose Service Providers and interact via Service Consumers using generated code and the Multitarget Router for inter-process communication. Services, as logical micro-servers independent of physical locations, enable a service-oriented architecture (SOA).

Interface-centric communication diagram

Areg supports both Client–Server (Request–Reply) and Publish–Subscribe (Pub/Sub) patterns, optimized for multithreading, multiprocessing, and distributed systems with low-latency requirements.

✅ Quick Summary

  • areg + codegen.jar — build services and projects
  • mtrouter — IPC and distributed communication
  • Other tools — logging and development utilities
  • Key strengths — automates service communication, manages threading & IPC, enables distributed apps

Use Cases: Distributed, RPC and IPC

IoT: Mist-to-Cloud

Edge devices often stream raw data to central servers, which can increase latency, network load, and privacy risks. With Areg, services run on devices, forming a mist network of micro-servers that process and aggregate data locally.

IoT Mist-to-Cloud network diagram

Benefit: Low-latency, autonomous edge mesh; sensitive data remains on-device; reduced cloud traffic.


Beyond Embedded

Many small devices lack scalable infrastructure. Areg transforms embedded applications into distributed modules that scale across remote nodes and platforms, orchestrating multithreaded and multiprocess C++ services.

Service types and message handling diagram
  • Local Services – multithreaded within a device
  • Public Services – accessible across processes and applications

Benefit: Seamlessly expose services to other apps and devices without modifying code.


Driverless Devices

Device drivers are often slow, complex, and platform-specific. Areg lets you expose hardware as portable, service-enabled components, making devices platform-independent.

Areg driverless service-enabled diagram

Benefit: Accelerates prototyping, testing, and development; enables early bug detection; devices are network-accessible.


Simulation & Testing

Validating distributed systems is expensive and hardware-dependent. Areg allows simulation of Data Layer services in external applications, providing realistic environments to test behavior, performance, and fault-tolerance. Services appear location-transparent to higher layers.

Software 4 Layer Architecture: Simulate Data Layer

Benefit: Transparent service location enables testing of higher-layer logic without real hardware dependencies.


Roadmap

Areg SDK continues to evolve for Desktop and Embedded, focusing on automation, reliability, and performance.

Planned work:

  • Multi-channel support for multiplexed communications
  • RTOS support (Zephyr OS) to bring Areg into real-time environments
  • Lusan app improvements: performance, stability, and usability (Areg SDK Tools)

Documentation


License

Areg SDK is released under the Apache License 2.0 — permissive and suitable for open-source and commercial use.

Commercial licensing & services: Dedicated support, training, and tailored licensing options are available for enterprise customers. Visit Aregtech or email info[at]aregtech[dot]com for details.


Call to Action

🚀 Join the Areg SDK community and help shape the future of distributed C++ apps:


Follow us:
X Follow LinkedIn Gitter