SkillAgentSearch skills...

Ionet

A Java distributed server framework based on Aeron and Netty, featuring a lock-free, asynchronous, and event-driven architectural design. Suitable for game servers, IoT, high-frequency financial trading, and high-frequency market data pushing. 基于 Aeron、Netty 的 java 分布式服务器框架,无锁异步化、事件驱动架构设计。适用于游戏服务器、物联网、高频金融交易、高频行情推送。

Install / Use

/learn @iohao/Ionet
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

ionet

Language: English | 中文

Documentation

  • https://iohao.github.io/ionet/en
  • https://iohao.github.io/ionet/en/docs/intro
<p> <a target="_blank" href="https://www.oracle.com/java/technologies/downloads/#java25"><img src="https://img.shields.io/badge/JDK-25-success.svg" alt="JDK 25"/></a> <a target="_blank" href="https://www.gnu.org/licenses/agpl-3.0.txt"><img src="https://img.shields.io/:license-AGPL3.0-blue.svg" alt="AGPL3.0"/></a> </p>
  • Lightweight, Lock-free, Asynchronous, and Event-Driven Architecture: Supports nanosecond-level distributed network communication without relying on any third-party middleware.
  • Ultra-Low Latency: Achieved through lock-free, shared-memory-based ring buffers, completely eliminating kernel context switching and lock contention.
  • Resource Efficient: Small package size, fast startup, low memory footprint, highly economical, no configuration files needed, and provides elegant routing access permission control.
  • Multi-Connection Support: Can simultaneously support various connection methods: WS (WebSocket), UDP, TCP, etc. The framework includes full-link call logging and tracing features.
  • Flexible Data Protocol: Allows developers to easily switch and extend different data protocols (Protobuf, JSON) using a single set of business code.
  • Near-Native Performance: The business framework can execute an average of 11.52 million business logic operations per second in a single thread.
  • Reduced Maintenance Costs: Code-as-live-debugging-documentation, JSR380 validation, Assertion + Exception mechanism.
  • Developer Friendly: The framework features intelligent same-process affinity; business code can be located and jumped to during development.
  • Deployment Flexibility and Diversity: The architecture can be both independent and integrated.
  • Write Once, Connect Everywhere: Can generate interactive code for clients.
  • Cross-Process/Cross-Machine Communication: Logic services can communicate with each other across processes and machines.
  • Dynamic Binding: Supports dynamic binding of players to business logic services.
  • Framework Compatibility: Can be integrated and coexist with any other framework.
  • WebMVC Developer Friendly
  • No Strong Spring Dependency
  • Zero Learning Cost
  • JavaSE

Introduction

Are you looking to develop a distributed network communication server that is high-performance, stable, easy-to-use, built-in load balanced, avoids class explosion design, supports cross-process and cross-machine communication, and features stateful multi-processing?

If so, we recommend ionet, a distributed network programming framework written in Java.

ionet is an open-source, lightweight distributed network programming framework based on Aeron, capable of achieving nanosecond-level end-to-end latency.

The framework's internal message transport layer utilizes the Aeron + SBE combination, achieving true zero-copy, zero-ringback, zero-reflection, zero-GC, zero runtime parsing, and virtually zero encoding/decoding overhead. It is implemented via lock-free, shared-memory-based ring buffers, completely eliminating kernel context switching and lock contention, which is key to achieving extremely low latency. With extreme CPU efficiency, it allows message processing speed to nearly reach the limits of the underlying hardware.

<br/>

Applicable Scenarios

  • Online Game Servers
  • Internet of Things (IoT)
  • High-Frequency Market Data Push
  • Real-Time Gaming/Betting: Online Game Engines
  • Telecommunications: Systems requiring high-performance data processing.
  • Any internal service communication with extreme latency requirements
  • Real-Time Stream Data Processing (e.g., video streams, sensor data)
  • High-Frequency Financial Trading, Market Data Distribution, Order Processing (extremely high low-latency requirement)

Usage Example

The example provides two methods:

  • loginVerify: Login business method.
  • hello: Business method.
// Action
@ActionController(HallCmd.cmd)
public class HallAction {
    @ActionMethod(HallCmd.loginVerify)
    UserMessage loginVerify(String jwt, FlowContext flowContext) {
        long userId = Math.abs(jwt.hashCode());

        flowContext.bindingUserId(userId);

        UserMessage userMessage = new UserMessage();
        userMessage.id = userId;
        userMessage.nickname = jwt;
        return userMessage;
    }
    
    @ActionMethod(HallCmd.hello)
    String hello(FlowContext flowContext) {
        return "hello " + flowContext.getUserId();
    }       
}

// Data Message
@ProtobufClass
public class UserMessage {
    public long id;
    public String nickname;
}

// Routing
public interface HallCmd {
    int cmd = 1;
    
    int loginVerify = 1;
    int hello = 2;
}

ionet is an open-source, lightweight distributed network programming framework that can achieve sub-microsecond or even nanosecond-level end-to-end latency. With extreme CPU efficiency, it pushes message processing speed to the hardware limit.

The framework also excels in packaging, memory footprint, and startup speed. The packaged JAR file is approximately 15MB, applications typically complete startup within 0.x seconds, and memory consumption is minimal.

In terms of ecosystem integration, the framework can be easily integrated with Spring (in just 4 lines of code). Beyond Spring, it can also be integrated with any other framework, such as Vert.x, Quarkus, Solon, etc., to leverage their respective ecosystems.

The learning curve is very low—it can be described as zero learning cost. Even developers without prior network programming experience can easily get started. Developers only need to master standard Java methods or WebMVC-related knowledge to develop business logic using the framework.

Regarding coding style, the framework offers a MVC-like coding style (non-intrusive Java Beans), a design that effectively avoids class explosion. Furthermore, the framework provides developers with synchronous, asynchronous, and asynchronous callback methods for mutual access between logic services. This results in very elegant code and supports full-link call logging and tracing.

For client integration, the framework offers a "write once, connect everywhere" capability and provides auxiliary code generation features for clients, significantly reducing the client developer's workload. This means you only need to write Java code once to generate unified interaction interfaces for projects like Godot, UE, Unity, CocosCreator, Laya, React, Vue, Angular, and more. The framework provides SDK support for multiple languages and corresponding code generation for C#, TypeScript, GDScript, C++, and Lua, with support for extensions.

Architecturally, the framework solves the N*N problem created by traditional frameworks (Comparison with Traditional Architectures). Traditional architectures require numerous third-party middleware components (like Redis, MQ, ZooKeeper, etc.) to expand machines and maintain overall architectural operation. Generally, if scaling requires introducing installable middleware, your architecture or framework is likely not "lightweight."

For its lightweight nature, the framework supports distributed network communication without relying on any third-party middleware; it only requires a Java environment to run. This simplifies usage and reduces deployment costs and maintenance difficulty for enterprises. When using ionet, you only need one dependency to get the entire framework, without needing to install other services like Nginx, Redis, MQ, MySQL, ZooKeeper, Protobuf protocol compilation tools, etc.

In terms of Architecture Flexibility, the architecture consists of External Services and Logic Services, which can be independent or integrated. This means the framework can adapt to any type of game, as simply adjusting the deployment method can meet the needs of different game types. Making these adjustments within the framework is very simple and will not have adverse effects on existing code.

The architecture supports dynamic scaling; both External Services and Logic Services can be dynamically added or removed. This allows us to easily cope with future increases or decreases in user volume. Additionally, the architecture supports non-disruptive user updates thanks to its distributed design. For instance, if Logic Service Type A needs new features, we can launch A-3, A-4, etc., which already support the new features, and then gradually take the old A-1 and A-2 offline, achieving a non-disruptive update.

In the distributed aspect, the framework's Logic Services use distributed design principles, dividing the servers into different layers such as External Services and Logic Services, with clear responsibilities and interfaces for each layer. This improves code readability and maintainability and facilitates horizontal scaling.

Regarding the distributed development experience, developing distributed applications typically requires launching multiple processes. This can make debugging and troubleshooting very difficult, reducing developer efficiency and increasing workload—a problem many frameworks cannot solve. But ionet does! ionet supports a multi-service, single-process startup mode, which simplifies development and debugging of distributed systems for developers.

For Ecosystem Planning, our Logic Services support running independently. Once started, they can provide functional extension and enhancement for users and other Logic S

View on GitHub
GitHub Stars113
CategoryDesign
Updated12m ago
Forks15

Languages

Java

Security Score

100/100

Audited on Mar 24, 2026

No findings