This article analyzes why Netty and ZooKeeper form the foundation of RPC frameworks, covering IO model evolution, communication and coordination layers, core components, common pitfalls, and a 10-part series roadmap to build a mini RPC system.
The article clarifies the often‑confused concepts of synchronous, asynchronous, blocking, and non‑blocking operations by introducing two independent dimensions, illustrating each with real‑world analogies, mapping them to BIO/NIO/AIO models, and offering practical guidance for choosing the right approach in different scenarios.
This article walks through eight Java file‑writing approaches—from the modern Files.writeString() API to low‑level FileChannel and asynchronous channels—detailing their parameters, performance characteristics, and ideal use cases such as large files, high‑throughput logging, and cross‑platform line handling.
An interviewer's question about the difference between epoll and select reveals a tangled web of OS‑level IO mechanisms; this article unpacks user‑space vs kernel‑space, DMA, zero‑copy, buffering, and maps the five Java IO models (BIO, NIO, AIO, etc.) to their underlying system calls.
This article explains how to use Java's built‑in WatchService API to monitor file‑system changes in real time, covering service creation, directory registration, event handling, key lifecycle, polling methods, a complete runnable example, and an advanced version that leverages virtual threads for efficient concurrency.
This article explains the core differences of Java's three I/O models—BIO, NIO, and AIO—through analogies, code examples, and a benchmark of 1,000 concurrent connections, then provides practical guidance on selecting the right model for various workloads.
The article explains the three major high‑concurrency I/O models—Blocking I/O, Non‑blocking I/O, and Asynchronous I/O—detailing their principles, advantages, drawbacks, and provides practical guidance on selecting the appropriate model based on workload characteristics and team constraints.
This article compares Java's three I/O communication models—BIO, NIO, and AIO—detailing their characteristics, performance trade‑offs, programming complexities, and suitable scenarios, then examines the limitations of native AIO and how the smart‑socket library enhances it with optimized threading, memory management, stability improvements, and a simplified API.
This article concludes the "From Zero Hand‑write Mini Netty" series, walking through the evolution from a simple single‑thread NIO program to a multi‑threaded, pluggable Mini‑Netty framework with heartbeat, decoding, and responsibility‑chain processing, and outlines future plans for a full‑featured Netty chat application.
This article explains how Spring Cloud Gateway leverages a non‑blocking NIO model, Reactor's reactive programming, cluster horizontal scaling, token‑bucket rate limiting, and Resilience4j circuit breaking to sustain million‑level concurrent traffic while maintaining low latency and high throughput.
This article explains how to design server‑side read/write idle detection and heartbeat mechanisms in a Mini‑Netty framework, covering the theory of heartbeats, idle event handling, a priority‑queue scheduler, and complete starter code with Java NIO examples.
This article explains how to overcome the single‑threaded bottleneck of Java NIO by introducing a Boss‑Worker architecture, detailing the design of multiple Selectors, thread binding, client implementation, performance considerations, and provides complete open‑source code examples.
This article explains what network programming is, why it matters beyond HTTP, compares BIO and NIO models, dives into Java NIO's design with selectors, channels, and ByteBuffer methods, provides full server/client code examples, and shows how Netty simplifies high‑performance networking.
This article explains the fundamentals of Java NIO, showing how to use Channels and ByteBuffer to efficiently read, write, and manipulate large files, including memory‑mapped files and RandomAccessFile alternatives, with clear code examples and step‑by‑step guidance.
This article explains the fundamentals of Java I/O streams, showing how to efficiently read, write, copy, delete, move, and inspect both text and binary files using NIO, Buffered streams, and modern APIs, while providing ready‑to‑use code examples.
This article explains the root causes of Java NIO empty polling, its impact on CPU usage, and presents Netty's multi‑layer detection, threshold‑based auto‑rebuild, and selector reconstruction techniques, along with configuration tips and future optimization directions for high‑concurrency backend systems.
Learn five Java file copy techniques—from basic streams to NIO Files.copy, FileChannel, and RandomAccessFile—detailing their implementations, performance differences, and ideal use cases for small, large, and massive files, helping you choose the most efficient method for your project.
This article explains the fundamentals of I/O in Unix and Java, covering the distinction between user and kernel space, the five Unix I/O models, the evolution from select/poll to epoll/kqueue, and how modern network frameworks like Reactor and Proactor leverage these mechanisms for high‑performance networking.
This article explains how Java's System.gc triggers full or concurrent garbage collection in NIO scenarios, detailing the JVM's handling of out‑of‑memory errors during memory‑mapped file operations and direct buffer allocations, and examines the behavior across various garbage collectors such as Serial, Parallel, G1, ZGC, and Shenandoah.
This article examines the internal read/write mechanisms of Java's FileChannel and MappedByteBuffer on Linux kernel 5.4, compares their performance through detailed source analysis and benchmarks, and explains why MappedByteBuffer often outperforms FileChannel for small I/O but can be overtaken for larger transfers due to page‑fault and dirty‑page handling.
Although IO multiplexing can boost performance, most Java applications continue to use connection pools like c3p0 or Tomcat because JDBC is blocking, DB protocols require multiple sessions, and integrating NIO drivers into existing web containers adds significant complexity and ecosystem constraints.
This article explains why a Java page took five seconds to load, identifies three bottlenecks involving large BLOB fields and file I/O, and walks through four optimization steps—including lazy loading, buffered streams, memory‑mapped files, and sendFile zero‑copy—that reduce the load time to under one second.
The presentation by NIO senior technology planning expert Chen Jiong explores the development trends of intelligent electric vehicles, showcases how large AI models empower various automotive scenarios, and shares NIO's practical implementations, offering insights on industry-focused solutions, problem‑driven application, and unified architecture design.
The article chronicles the Rainbow Bridge proxy’s shift from a blocking BIO JDBC driver to a custom Netty‑based NIO driver with an event‑loop‑affine connection pool, detailing optimizations such as codec skipping and lock‑free queues that yield up to 67% higher throughput, 37% lower load, and a 98% reduction in thread usage.
This article explains the evolution of I/O multiplexing in Java, covering the birth of multiplexing, the introduction of NIO with Selector, and detailed comparisons of select, poll, and epoll mechanisms, including their APIs, internal workings, and performance considerations for high‑concurrency network programming.
This article provides a comprehensive overview of Java I/O models—including blocking (BIO), non‑blocking (NIO), asynchronous (AIO)—explains their differences, demonstrates file and network programming with code examples, and introduces Netty as a high‑performance framework for building scalable server applications.
This article presents NIO's smart energy service platform, focusing on the NIO Power swap‑station business and detailing how time‑series forecasting is applied to predict demand, addressing complex seasonality, holiday drift, growth and competition, and describing the underlying machine‑learning and deep‑learning models and system architecture.
The article explains that database connection pools remain based on blocking I/O because JDBC was designed for BIO, managing session state per connection, and the ecosystem lacks a unified non‑blocking driver, making IO multiplexing technically possible but practically complex and rarely needed.
Although IO multiplexing can improve performance, Java applications typically use traditional connection pools like c3p0 or Tomcat because JDBC is built on blocking I/O, DB sessions require separate connections, and integrating NIO would complicate program architecture, making connection pools the pragmatic, mature solution.
Jetty’s ManagedSelector wraps the native NIO selector and, together with its ExecutionStrategy abstractions, merges I/O detection and handling in a single thread or adaptive pool, using strategies such as ProduceConsume, ProduceExecuteConsume, ExecuteProduceConsume, and EatWhatYouKill to maximize cache reuse and minimize context‑switch overhead in high‑concurrency applications.
This article walks through the evolution of Java I/O models—from blocking BIO to non‑blocking NIO and multiplexed epoll—explains core concepts such as blocking, non‑blocking, synchronous and asynchronous operations, and demonstrates practical code for handling thousands of concurrent connections efficiently.
This article introduces Java I/O streams, explains how to efficiently read large files using buffered streams and NIO, details the core components of Java NIO (Channel, Buffer, Selector), and covers object serialization, the role of serialVersionUID, and alternative serialization frameworks.
Netty is a high‑performance, asynchronous, event‑driven NIO framework widely used in Java backend systems such as Dubbo and RocketMQ, and this article explains its fundamentals, key characteristics, architectural layers, high‑performance design, core components, and typical application scenarios across internet, gaming, and big‑data domains.
This article explains the three main Java I/O models—BIO (blocking), NIO (non‑blocking), and AIO (asynchronous)—detailing their characteristics, differences in blocking behavior, core components like Buffer, Channel, and Selector, and shows how they are applied in popular frameworks such as Netty, Mina, and Dubbo.
This article explains the concepts of synchronous vs asynchronous and blocking vs non‑blocking I/O, then details the characteristics, advantages, and drawbacks of Java’s three I/O models—BIO, NIO, and AIO—providing guidance on when to use each approach in backend development.
This article explains the concepts of synchronous vs asynchronous and blocking vs non‑blocking I/O, then compares Java's BIO, NIO, and AIO models, describing their mechanisms, advantages, drawbacks, and suitable usage scenarios for server‑side development.
This article demystifies the true reasons behind Redis's speed by exploring low‑level I/O mechanisms—from basic BIO to NIO and the Reactor model—explaining socket creation, connection handling, blocking behavior, and how Java’s non‑blocking APIs and system calls work together to achieve high‑throughput networking.
The article explains why Java applications typically use traditional database connection pools instead of IO multiplexing, covering JDBC’s blocking design, session management, ecosystem maturity, and the complexity of integrating non‑blocking I/O with existing frameworks, while noting that a non‑blocking implementation is technically feasible.
This technical presentation details NIO's evolution of OLAP solutions—from Druid and TiDB to Doris—explaining the selection criteria, Doris's advantages as a unified OLAP warehouse, its role in the CDP platform, practical deployment experiences, and lessons learned from real‑world usage.
This article explains the concept of zero‑copy, its implementation in Java I/O, NIO, Netty, and popular messaging systems, and shows how techniques like mmap+write and Sendfile eliminate unnecessary data copying to dramatically improve throughput and latency.
This article explains the principle of zero‑copy, its role in improving I/O performance, and demonstrates how Java NIO, mmap, sendfile, channel‑to‑channel transfer, Netty composite buffers and other techniques achieve zero‑copy in backend systems.
This article deeply explores the Linux kernel's handling of JDK NIO file reads and writes, detailing the role of page cache, radix trees, buffered versus direct I/O, prefetch algorithms, dirty‑page write‑back mechanisms, and the key sysctl parameters that control performance and data safety.
This article deeply explores JDK NIO's file reading and writing mechanisms, revealing how Buffered and Direct IO interact with Linux's page cache, the kernel's radix tree, prefetch algorithms, and dirty page management, while providing practical code examples and performance insights for developers.
This article compares traditional Java IO, JDK NIO, and the Netty framework, explaining their thread models, selector mechanisms, and performance trade‑offs, while providing complete server‑client code examples that demonstrate how Netty simplifies high‑performance network programming.
This article provides a comprehensive technical overview of Apache Tomcat, covering its role as a Java EE servlet container, internal components such as Server, Service, Connector, and Container, lifecycle management, startup sequence, deployment configuration, JSP engine, connector types, NIO processing, Comet, and asynchronous servlet handling.
This article introduces Netty, explains Java's BIO/NIO/AIO models, compares reactor threading architectures, details Netty's internal thread and handler pipeline design, and provides a complete example of building a high‑performance HTTP server with Netty.
The article explains that although IO multiplexing can improve performance, database access in Java typically relies on JDBC and connection pools, which are built on blocking I/O, making it difficult to combine DB connections with IO multiplexing without major architectural changes.
The article explains Java's I/O ecosystem, covering synchronous blocking BIO, synchronous non‑blocking NIO, and asynchronous non‑blocking AIO, their classifications, practical code examples, and when to choose byte streams versus character streams.
This article explains why traditional database connection pools rely on blocking I/O and connection pooling instead of leveraging IO multiplexing, covering JDBC limitations, protocol constraints, ecosystem factors, and the trade‑offs between performance and code complexity.
This article walks through building a simple Netty HTTP server, explaining how thread groups, channel options, handlers, and the bind operation work together to start a server, and highlights key implementation details such as selector creation and performance‑focused choices.
The article explains why traditional Java database connection pools rely on blocking I/O instead of IO multiplexing, covering JDBC's design, session management, resource constraints, and the practical challenges of adopting non‑blocking approaches in mainstream backend systems.
This article provides a comprehensive overview of Java NIO network programming, explaining BIO, NIO, and AIO models, the core components Channel, Buffer, and Selector, and how Netty leverages the Reactor pattern with multi‑threaded boss and worker groups for high‑performance asynchronous I/O.
This article provides a comprehensive overview of Java network programming fundamentals, including socket basics, IO models (BIO, NIO, AIO), NIO core components such as Channel, Buffer, and Selector, and detailed example code for building NIO client‑server applications.
This article explores the practical impact of asynchronous HTTP requests in Java NIO‑based performance testing, detailing server setup with Moco, baseline measurements, various async implementations, and the trade‑offs between raw speed gains and CPU consumption.
This article explains how Java NIO's non‑blocking I/O can accelerate HTTP interface testing by offloading response handling to separate threads, presents a simple request‑time model, and provides concrete async HttpClient code examples with logging and JSON parsing.
This article explains Java NIO buffers, covering how to create them, their four core properties (mark, position, limit, capacity), essential methods like allocate, allocateDirect, flip, rewind, clear, and demonstrates usage with comprehensive code examples and diagrams.
This article explains Java NIO buffers, covering how to create them with allocate() and allocateDirect(), describing their four core properties (position, limit, capacity, mark), and detailing essential methods such as put(), get(), flip(), rewind(), clear(), mark(), reset(), hasRemaining() and remaining() with code examples.
This article analyzes the limitations of Trip.com’s blocking‑IO servlet architecture for its email push service, proposes a reactive, non‑blocking redesign using EventLoop and NIO, details the thread‑model and code changes, and demonstrates performance gains through benchmark comparisons.
Zero-copy techniques eliminate unnecessary data copying between user and kernel space, dramatically improving I/O performance; this article explains core I/O concepts, explores Java implementations like MappedByteBuffer, DirectByteBuffer, channel-to-channel transfers, and demonstrates Netty’s composite buffers, plus examples from Kafka and RocketMQ.
This article explains the core differences between Java NIO and traditional IO, introduces the concepts of channels and buffers, describes buffer state management, provides a complete NIO selector code example, and compares the NIO workflow with Netty's model.
This article provides a comprehensive overview of Java NIO, explaining the differences between BIO and NIO, the concepts of synchronous/asynchronous and blocking/non‑blocking I/O, and detailing the usage and implementation of Buffers, Channels, and Selectors with code examples.
This article traces the real system‑call flow of Java’s I/O models—BIO, NIO, Netty and AIO—on CentOS 7.5, compares their performance, lists advantages and disadvantages, and shows how each model interacts with the Linux kernel via strace.
This article explains the concepts of blocking (BIO), non‑blocking (NIO) and asynchronous (AIO) I/O in Java, introduces the principle of I/O multiplexing, provides a complete Java example with server and client code, and compares system calls like select, poll, and epoll.
This article explains the concepts of blocking and non‑blocking I/O, I/O multiplexing mechanisms such as select, poll and epoll, and the differences between synchronous and asynchronous I/O, then demonstrates Java implementations of BIO, NIO and AIO with sample code.
This article explains how Netty, an asynchronous event‑driven Java NIO framework, simplifies building high‑performance, maintainable network servers and clients by handling I/O, threading, and protocol concerns, and it covers its thread models, zero‑copy techniques, common interview questions, and real‑world use cases such as Dubbo and RocketMQ.
This article explains how Netty, an asynchronous event‑driven network framework built on Java NIO, simplifies the creation of high‑performance, scalable web servers and client components by handling I/O streams, connection management, threading, zero‑copy transfers, and offering flexible reactor thread models for various application scenarios.
This article explains the concept of zero‑copy, its performance benefits, and how Java NIO, memory‑mapped buffers, direct buffers, channel‑to‑channel transfers, and Netty’s composite buffers implement zero‑copy to reduce data copying between kernel and user space.
This article provides a comprehensive guide to Java NIO, covering its core components—Channel, Buffer, and Selector—explaining the differences from traditional IO, demonstrating file, socket, and server implementations with detailed code samples, and illustrating advanced features such as memory‑mapped files, scatter/gather, and pipe communication.
This article explains Java NIO fundamentals—including Channels, Buffers, and Selectors—compares them with traditional IO, and provides multiple runnable code examples such as FileChannel, SocketChannel, Selector loops, memory‑mapped files, scatter/gather, transferTo/From, Pipe and DatagramChannel to illustrate non‑blocking and high‑performance I/O.
This article demonstrates how to improve Java file compression performance by replacing unbuffered FileInputStream with BufferedInputStream, then leveraging NIO Channels, transferTo, memory‑mapped files, and Pipe, showing step‑by‑step code examples and timing results that reduce processing time from 30 seconds to about 1 second.
This article introduces the fundamentals of network I/O for the DBLE database system, covering the TCP/IP protocol stack, the MySQL application‑layer protocol, and the performance differences between BIO and NIO approaches, laying the groundwork for deeper source‑code analysis.
Zero-copy techniques eliminate unnecessary data copying between user and kernel space, dramatically improving I/O performance; this article explains core concepts, Java NIO’s MappedByteBuffer and DirectByteBuffer, channel-to-channel transfers, Netty’s composite buffers, and how frameworks like Kafka and RocketMQ leverage zero-copy.
This article explains how to improve the performance of Java code that compresses multiple images into a zip archive by replacing unbuffered streams with buffered I/O, then using NIO channels, direct buffers, memory‑mapped files, and pipes, achieving a reduction from 30 seconds to about 1 second.
This article demonstrates how to dramatically reduce the time required to compress multiple large images in Java by progressively applying buffered streams, NIO channels, direct buffers, memory‑mapped files and pipe techniques, measuring each optimization and explaining the underlying I/O mechanisms.
This article explains Tomcat's Connector architecture, compares BIO, NIO and APR protocols, details key parameters such as acceptCount, maxConnections, maxThreads, and shows how to configure and monitor thread pools and connection limits for optimal server performance.
This article walks through a real‑world Java file‑compression task, shows why a naïve implementation takes 30 seconds for a 20 MB batch, and demonstrates five progressive optimizations—BufferedInputStream, NIO Channel, memory‑mapped files, Pipe, and code snippets—that cut the time down to about one second while explaining the underlying I/O mechanisms.
Java NIO's Channel API offers bidirectional, asynchronous read/write operations using Buffers, with implementations such as FileChannel, DatagramChannel, SocketChannel, and ServerSocketChannel, and the article provides a practical FileChannel example illustrating buffer handling and the essential buf.flip() step.
This article explains how to optimize Tomcat by adjusting connector settings, switching between BIO, NIO, and AIO modes, and fine‑tuning JVM options such as heap size, garbage‑collector flags, and thread parameters to improve server performance and stability.
This article analyzes the challenges of large‑scale mobile and IoT push services, presents a real‑world Netty case study, and provides detailed design guidelines—including file‑descriptor tuning, heartbeat handling, buffer management, memory pooling, and JVM/TCP tuning—to build stable, high‑performance backend push systems.
The article uses a simple bank workflow with ten staff members to illustrate the differences in throughput between BIO (blocking I/O), NIO (non‑blocking I/O), and asynchronous processing, showing how task decomposition and specialized threads dramatically improve performance in backend systems.
This article provides a comprehensive guide to Java I/O, covering traditional BIO streams, the differences between BIO, NIO and AIO, detailed explanations of byte and character streams, buffers, channels, selectors, and practical examples such as file copying and a simple client‑server chat implementation.
This tutorial walks through creating a Netty-based socket server and client in Java, covering project setup, event loop groups, channel initializers, codec pipelines, custom handlers, and the activation flow that enables bidirectional message exchange.
This article uses a bank workflow analogy to compare blocking I/O (BIO), non‑blocking I/O (NIO), and asynchronous processing, showing how task decomposition and specialized threads dramatically increase system throughput while illustrating the trade‑offs of each approach.
This article explains the evolution of Java I/O—from blocking BIO to non‑blocking NIO and asynchronous AIO—covers the Reactor pattern and its single‑thread, multi‑thread, and master‑slave models, and details Netty’s thread groups, channel pipeline, and async non‑blocking communication.
This article explains the zero‑copy technique in Java, covering basic I/O concepts, buffer management, mmap + write and Sendfile methods, and how frameworks like NIO, Netty, Kafka, and RocketMQ use these mechanisms to eliminate data copies and improve performance.
This article explains the principles of zero‑copy I/O, covering buffer concepts, virtual memory, mmap + write and sendfile methods, and demonstrates Java implementations using MappedByteBuffer, DirectByteBuffer, channel‑to‑channel transfers, as well as Netty’s CompositeChannelBuffer for efficient data handling.
This article explains the fundamentals of zero‑copy I/O, covering buffer and virtual memory concepts, Java NIO mechanisms such as MappedByteBuffer and DirectByteBuffer, channel‑to‑channel transfers, and how Netty implements zero‑copy with composite buffers, providing code examples and diagrams for each technique.
This article explains the zero‑copy principle, describes core I/O concepts such as buffers and virtual memory, and details Java implementations including mmap + write, Sendfile, MappedByteBuffer, DirectByteBuffer, channel‑to‑channel transfer, and Netty’s composite buffers for high‑performance data transfer.
This article explores the fundamentals of high‑performance I/O design in Java, comparing BIO and NIO throughput, analyzing thread‑based and event‑driven architectures, and detailing the Reactor pattern with code examples and performance considerations for scalable web services.
This article explains the fundamental differences between Java NIO and traditional IO, introduces channels and buffers, describes NIO's internal mechanisms, provides a complete code example, and compares NIO's workflow with Netty's model for high‑performance backend development.
This article explains the core differences between Java NIO and traditional IO, introduces the concepts of channels and buffers, details buffer state management, and provides sample NIO code along with a comparison to Netty's processing model.
This tutorial explains how to use Java NIO's FileChannel to acquire exclusive and shared file locks, covering lock types, required channel modes, code examples for FileOutputStream, RandomAccessFile, and FileInputStream, and discusses platform-specific considerations and common exceptions.
Kafka’s high‑throughput network architecture—built on NIO, a Reactor thread model, and a TCP‑based protocol—evolves from a simple synchronous processor design to a decoupled handler‑pool system, offering valuable lessons for designing scalable backend communication layers in big‑data applications.
This article explains how Netty initializes and starts a server by detailing the creation of EventLoopGroups, the configuration of ServerBootstrap, the execution of channel(), handler(), childHandler(), and doBind() methods, and the handling of JDK selector bugs, illustrated with code and diagrams.
This article provides a comprehensive introduction to Netty, covering its core concepts, architecture, threading model, zero‑copy mechanisms, serialization options, comparison with JDK NIO and Tomcat, and practical usage scenarios for building high‑performance asynchronous network applications in Java.
This article explains how Netty, an asynchronous event‑driven framework built on Java NIO, powers high‑throughput RPC systems by detailing its core components, data handling with ByteBuf, and practical client‑server examples, offering developers a clear roadmap for building efficient distributed services.
Tomcat 9.0.26 suffers a high‑concurrency deadlock caused by a lock‑order inversion among NIO poller and executor threads, dropping TPS to zero and creating thousands of CLOSE_WAIT sockets; downgrading to Tomcat 8 or applying the 9.0.31+ patch that moves the close operation into a finally block restores performance to around 15 K TPS.
This article demonstrates how to dramatically speed up Java file compression of multiple images by replacing naive FileInputStream reads with BufferedInputStream, then leveraging NIO Channels with transferTo, memory‑mapped files, and finally Pipe‑based streaming, showing performance improvements from 30 seconds down to about 1 second.
This article summarizes the major JDK 11‑13 updates, including switch expression simplifications, multi‑line text block literals, dynamic AppCDS archives, ZGC memory‑release enhancements, a modernized socket API, new FileSystems methods, bulk NIO ByteBuffer operations, the Reiwa era in java.time, Unicode 12.1 support, and several deprecated features that have been removed.