This article explains how to leverage Spring Application Events to decouple business logic, demonstrates creating custom events, listeners, and publishers, shows both synchronous and asynchronous handling with @EventListener and @Async, and provides complete code samples and test results.
This article examines a high‑traffic video‑watching scenario, explains why synchronous database writes become a bottleneck, and presents four practical asynchronous solutions—thread‑pool, local memory with scheduled tasks, message‑queue, and Agent‑plus‑MQ—detailing their implementation steps, advantages, and trade‑offs.
This article explains how to turn Java asynchronous invocations into synchronous ones by demonstrating five approaches—wait/notify, condition locks, Future, CountDownLatch, and CyclicBarrier—each illustrated with complete code examples and detailed execution flow.
This article details how the Sohu video PUGC team refactored a legacy video‑object‑creation API by introducing a reactive, asynchronous, non‑blocking architecture built on RxJava, Vert.x WebClient and a custom Dubbo reactive client, achieving clearer business flow and a 43% latency reduction.
The article outlines the growing challenges of a high‑traffic shopping cart caused by numerous RPC dependencies, proposes a full asynchronous redesign—including parallel RPC calls, batch pagination, and JSF CompletableFuture usage—addresses retry, monitoring, and timeout issues, and reports a 30% latency reduction.
This article examines a high‑traffic video‑watching scenario, identifies database write bottlenecks, and presents four asynchronous solutions—thread‑pool, in‑memory queue with scheduled tasks, message‑queue, and Agent‑plus‑MQ—detailing their implementation steps, trade‑offs, and best‑practice guidelines.
This article defines software performance as executor + (process + IO + computation), explains when performance should be considered, and presents a comprehensive framework of executor, I/O‑type, and generic optimizations—including concurrency, sharding, caching, compression, async, batching, and algorithmic improvements—supported by cross‑domain case studies.
This article presents seven practical Spring Boot performance optimization methods—including asynchronous execution, increasing embedded Tomcat connection limits, component scanning, switching to Undertow, using BufferedWriter, DeferredResult, and AsyncHandlerInterceptor—each illustrated with code samples and explanations for improving Java backend applications.
This article explains how to handle time‑consuming Excel uploads by using a template‑method design, wrapping the process with an AOP aspect, and executing the actual upload asynchronously in a thread pool, while recording logs and error details for later inspection.
This article explains how to use Spring ApplicationEvent to decouple business logic, showing step‑by‑step code for defining custom events, creating listeners with both ApplicationListener and @EventListener, publishing events synchronously and asynchronously, enabling async processing, and verifying behavior with unit tests.
This article explains how Spring Application Events can decouple complex business logic, demonstrates creating custom events, listeners, and publishers, shows both synchronous and asynchronous handling with @EventListener and @Async, and provides complete code examples and test results for a Spring Boot application.
This article explains how to use Spring's Application Event mechanism for both synchronous and asynchronous processing, covering custom event creation, listener definition, publisher usage, unit testing, and enabling async execution with @EnableAsync and @Async annotations, illustrated with code examples and diagrams.
FutureTask acts as a proxy for asynchronous tasks in Java, providing result retrieval with optional timeout, completion checks, cancellation, and repeat execution, while managing task state, outcomes, and exceptions; the article illustrates usage, internal fields, and common pitfalls such as missed exceptions and indefinite blocking.
This article demonstrates how to leverage Spring Application Events to decouple business logic, showing step‑by‑step examples of defining custom events, listeners, publishing events synchronously, and enabling asynchronous handling with @EnableAsync and @Async annotations, complete with code snippets and test results.
This article explains the concepts of synchronous and asynchronous execution, blocking and non‑blocking operations, user and kernel space, process switching, file descriptors, cache I/O, and compares various Linux I/O models such as blocking, non‑blocking, multiplexing, signal‑driven and asynchronous I/O, including the differences among select, poll and epoll.
This article demonstrates how to create custom Spring events, define listeners, publish events, and enable asynchronous handling with @EnableAsync and @Async annotations, providing complete code examples and test results for both synchronous and asynchronous scenarios in a Spring Cloud Alibaba micro‑service environment.
This guide explains how to set up Celery, a distributed asynchronous task framework, to use Redis both as the message broker and result backend, covering project structure, configuration code, task definition, execution, state monitoring, and common control operations.
This article explains multiple Spring Boot asynchronous execution techniques—such as @Async, CompletableFuture, WebAsyncTask, DeferredResult, and AsyncHandlerInterceptor—provides complete Java code examples, and discusses performance optimizations like increasing Tomcat connection limits, switching to Undertow, using ComponentScan, and buffered I/O.
The article explains multiple methods for implementing asynchronous execution in Spring Boot, covering @Async annotation, Java 8 CompletableFuture, Callable, WebAsyncTask, DeferredResult, Tomcat connection tuning, container switching to Undertow, and async interception, all illustrated with complete code examples.
xxl-job uses Netty HTTP for communication, employing dynamic proxy patterns, full asynchronous processing, and thread‑blocking mechanisms to efficiently dispatch tasks from the scheduler to executors, with detailed code examples illustrating request IDs, future responses, and synchronized result retrieval.
Over the past two years Alibaba’s DX native dynamic framework has been re‑engineered by moving virtual‑node parsing, layout and drawing to background threads, adding an asynchronous drawing system, a unified rich‑text component, and off‑screen resource management, boosting low‑end device frame rates from ~30 FPS to over 55 FPS and cutting media‑CPU usage by 65 % while paving the way for richer interactive UI features.
The article explains that CompletableFuture offers paired asynchronous methods—one using the default ForkJoinPool and another accepting a custom executor—and argues that providing an explicit thread pool avoids shared‑pool contention, loss of tracing information, ThreadLocal leakage, and class‑loader issues in Java backend applications.
The article explains how C++20 coroutines and the emerging execution framework are used to redesign a single‑threaded game‑server architecture, detailing custom async wrappers, integration with asio and libunifex, job‑type scheduling, example coroutine code, current limitations, and a roadmap toward a simpler, sender/receiver‑based async library.
This article explains how xxl-job implements its communication layer with Netty HTTP, outlines the overall workflow, and highlights key design choices such as dynamic proxy abstraction, full asynchronous processing, and request‑ID based thread synchronization, accompanied by detailed Java code examples.
Explore a curated set of frontend development articles covering the evolution of asynchronous JavaScript with Promises and async/await, best practices for code reviews, handling race conditions in React, establishing comprehensive frontend standards, the quirks of JavaScript's with statement, and advanced webpack splitChunks and manifest optimization techniques.
This article explains how to design and implement a flexible, strategy‑pattern‑based state machine for e‑commerce after‑sale services, covering action abstraction, synchronous vs asynchronous execution, compensation via delayed MQ, and execution delay techniques to improve reliability and performance.
This article explains how Java 8's CompletableFuture enables low‑overhead asynchronous composition, walks through its core methods, shows practical code examples for parallel data fetching, error handling, and task combination, and reveals implementation details from the source code.
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.
The article explains how Java 8’s CompletableFuture enables efficient asynchronous programming—illustrated by Meituan’s order service refactor—by replacing slow synchronous RPC calls with composable, lazy, back‑pressure‑aware futures, offering thread‑pool best practices, robust exception handling, utility helpers, and achieving up to a 45 % latency reduction and fewer servers.
This guide walks through three ways to create gRPC Java clients—newBlockingStub, newStub, and newFutureStub—showing their code, usage patterns, and performance characteristics, while also providing a simple server implementation for testing.
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 explains multiple ways to implement asynchronous processing in Spring Boot, covering @Async annotation, CompletableFuture, supplyAsync, runAsync, WebAsyncTask, DeferredResult, custom interceptors, and server configuration tweaks such as Tomcat connection limits and switching to Undertow.
This article explains how to implement asynchronous processing in Spring Boot using @Async annotations, JDK 8 CompletableFuture, Callable, WebAsyncTask, DeferredResult, and AsyncHandlerInterceptor, providing detailed code examples and configuration tips to improve performance and scalability of backend services.
After upgrading a core component, a previously synchronous domain event in Spring became asynchronous, causing runtime errors; this article explains the underlying mechanism, shows the relevant source code of SimpleApplicationEventMulticaster, and clarifies how the presence or absence of a configured thread pool determines whether events are processed synchronously or asynchronously.
This article explains the limitations of traditional blocking I/O, introduces Java NIO with selectors, compares the two models using a kindergarten analogy, critiques raw JDK NIO, and demonstrates how Netty simplifies and optimizes network development with concise server and client code examples while promoting a comprehensive Netty learning book.
The article explains why CompletableFuture was introduced in JDK 1.8, describes its core features such as thenCompose, thenCombine, thenAccept, thenRun and thenApply, demonstrates usage with Netty's ChannelFuture and detailed source‑code walkthroughs including asyncSupplyStage, AsyncSupply, uniAcceptStage and postComplete, and provides practical code examples and execution results.
This article provides an in‑depth analysis of Java’s CompletableFuture introduced in JDK 8, explaining its motivations, core methods, internal mechanisms such as asyncSupplyStage, thenAcceptAsync, and postComplete, and includes practical code examples to illustrate asynchronous task handling and dependency management.
This article explains Java 8's CompletableFuture, covering its purpose, core features such as thenCompose, thenCombine, thenAccept, thenRun, and thenApply, demonstrates practical code examples, and provides a detailed analysis of the underlying source‑code implementation for asynchronous callbacks.
This article traces the evolution of JavaScript asynchronous handling from callbacks to Promise and Async/Await, explains their internal mechanics with code examples, compares implementations, highlights limitations, and discusses how future frontend engineering may address these challenges.
The article explains common timeout points in synchronous, asynchronous, and message‑queue communication between services, and provides client‑side and server‑side strategies—including request tracing, retry policies, idempotency, fast‑fail handling, and max‑effort notifications—to mitigate these problems in backend systems.
This article explains how to replace synchronous price‑lookup APIs with Java 8's CompletableFuture, compares synchronous and asynchronous performance, introduces the most useful CompletableFuture creation and composition methods, shows practical code examples, and discusses when to prefer it over traditional Future or thread‑pool approaches.
This article introduces Java's CompletableFuture, compares it with the older Future API, demonstrates how to create, combine, and handle asynchronous tasks with code examples, and highlights best practices and pitfalls for effective concurrent programming.
To reduce response time when invoking multiple independent APIs, this article demonstrates how to refactor sequential Java calls into asynchronous executions using thread pools and CompletableFuture, providing complete code examples and performance comparisons.
This article demonstrates how to employ SLF4J's MDC to attach a request identifier to log entries, enabling efficient filtering of all logs belonging to a single request even across asynchronous threads and thread pools, and shows an advanced decorator‑based solution for proper MDC propagation.
This article explains how to create a fixed-size Java thread pool, attach a daemon thread that monitors the main thread, and use Phaser for synchronization, providing complete Groovy and Java examples with detailed code and console output.
This article provides a detailed overview of Celery, covering its architecture, common use cases, installation steps, project structure, task definition, periodic tasks, worker management, distributed deployment, advanced monitoring, custom task handling, task routing, and monitoring with Flower, all illustrated with practical code examples.
This article explains the motivation behind creating the C++ coroutine framework "owl" for the cross‑platform WeChat client, compares callback, promise, and coroutine approaches with code examples, and details its design choices such as stackful coroutines, single‑thread scheduling, structured concurrency, and performance characteristics.
This article explains the difference between synchronous and asynchronous method calls in Java, demonstrates a simple Spring Boot Task class with three time‑consuming methods, shows how to convert them to asynchronous execution using @Async and @EnableAsync, and illustrates how to coordinate completion with Future objects.
This course introduces AJAX (Asynchronous JavaScript and XML), explaining how it enables browsers to fetch data without page refresh by sending asynchronous requests, and clarifies that AJAX is a technique combining existing web standards rather than a new programming language.
This article explains the four main I/O models—blocking, non‑blocking, multiplexed (event‑driven) and asynchronous—detailing their mechanisms, kernel interactions, performance implications, and how they differ in handling data readiness for network programming.
This article explains the difference between synchronous and asynchronous calls, demonstrates a Java Spring Boot example that converts blocking methods into concurrent @Async tasks, and shows how to use Future for callback handling to measure total execution time.
The article walks through C++20 coroutines—from basic suspension mechanics and the roles of coroutine_handle, promise_type, and awaitable methods—to constructing a lightweight game scheduler that manages task lifetimes, await modes, and RPC integration, and demonstrates how this approach mirrors Python’s yield‑based skill system while offering clearer, high‑performance native code.
The article explains why fixed sleep calls are inefficient for asynchronous operations, introduces polling as a flexible alternative, provides Python code examples with the polling library, discusses advantages and disadvantages, and presents decorator and generic‑function abstractions for reusable polling logic.
The article explains gRPC fundamentals, illustrating service definition in .proto files, synchronous and asynchronous client and server implementations with CompletionQueue and CallData state machines, streaming RPC patterns, HTTP/2 protocol details, metadata handling, and the structure of generated stub and service code.
This article explains the four main I/O models—synchronous blocking, synchronous non‑blocking, I/O multiplexing (Reactor), and asynchronous I/O (Proactor)—illustrates their characteristics with examples, and encourages readers to share the content after gaining a clearer understanding of these fundamental backend concepts.
The article describes the architecture and optimization techniques of Qunar's inventory search service, covering background business flow, challenges of high‑traffic multi‑channel integration, and detailed solutions such as product cataloging, channel cache utilization, request replay, cache isolation, unified cache management, cold‑hot segregation, and full‑process asynchronous handling to improve cache hit rate, update efficiency, and overall throughput.
This article explains Python's asyncio asynchronous I/O model, how to define and run coroutines, use callbacks, manage multiple concurrent tasks with gather, compare run_until_complete with run_forever, and properly close the event loop, providing clear code examples throughout.
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.
This article presents a comprehensive overview of the open‑source Workflow framework by Sogou, highlighting its high‑performance asynchronous architecture, rich feature set, practical C++ code examples for building servers and clients, and detailed explanations of its task‑flow and timer implementations for backend developers.
This article explains the drawbacks of traditional synchronous architectures, outlines why adopting message queues improves latency, coupling, and peak‑handling, and then details common MQ problems such as duplicate messages, data inconsistency, loss, ordering, backlog, and increased complexity along with concrete mitigation strategies.
This article explains the evolution of JavaScript asynchronous programming, details the Promise/A+ specification, provides step‑by‑step custom Promise implementations with full code examples, covers additional Promise methods, and offers interview questions and best‑practice tips for frontend developers.
This article explains how Nginx runs as a daemon with a master process and multiple worker processes, why it prefers a multi‑process asynchronous non‑blocking architecture over threads, and details the key internal data structures such as connections, requests, arrays, queues, lists, strings, memory pools, hash tables, and red‑black trees that enable its high‑performance HTTP handling.
RxJava brings reactive, event‑driven programming to Java by using Observables and Observers, offering operators, schedulers for thread control, and asynchronous, non‑blocking execution that avoids callback hell, improves performance, and fits UI events, I/O, RPC, and complex service orchestration, as demonstrated by Alibaba’s Xianyu.
This article explains the concepts of synchronous and asynchronous programming in Python, compares their architectures, discusses how async frameworks and greenlet‑based libraries work, and clarifies when asynchronous code can outperform synchronous code, especially under high I/O‑bound load.
This article details Ximalaya's evolution from a Tomcat‑based gateway to a Netty‑driven, fully asynchronous architecture, covering design challenges, performance bottlenecks, traffic management features, monitoring, and future HTTP/2 plans that enabled handling over 200 billion daily calls with high QPS.
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 internal service communication patterns, covering request/response and asynchronous messaging, their implementations, message formats, RPC and REST principles, service discovery methods, channel types, and key considerations for choosing a message‑queue component.
The article explains how moving from monolithic applications to microservice‑based systems changes communication from in‑process method calls to RPC, asynchronous messaging, and REST, highlighting design principles such as smart endpoints, dumb pipes, and the importance of avoiding synchronous dependencies for resilient distributed systems.
This article introduces Java's CompletableFuture and CompletionStage APIs, explains their contracts, and provides twenty concise code examples that demonstrate creating completed futures, running async stages, applying functions synchronously and asynchronously, handling exceptions, combining futures, using custom executors, and orchestrating multiple stages with allOf/anyOf.
This article explains JavaScript's single‑threaded nature, the task queue, macro‑ and micro‑tasks, the event loop, and compares callbacks, Promises, Generators, and async/await with code examples and practical pros and cons for front‑end developers.
The article outlines eBay’s practical scalability principles—including functional partitioning, horizontal sharding, avoiding distributed transactions, aggressive asynchronous decoupling, moving work to async pipelines, virtualization, and intelligent caching—demonstrating how large‑scale web systems can be designed for linear growth and high availability.
This article details the design evolution, architectural choices, performance tuning, monitoring, and future plans of Ximalaya's high‑traffic HTTP gateway, covering its migration from Tomcat NIO to a fully asynchronous Netty implementation and the associated engineering challenges and solutions.
This article describes how Ximalaya’s high‑traffic HTTP gateway evolved from a Tomcat NIO + AsyncServlet design to a Netty‑based fully asynchronous architecture, detailing the challenges of blocking I/O, memory copying, GC pressure, and how layered redesign, lock‑free connection pools, comprehensive monitoring, and performance optimizations enabled stable handling of over 200 billion daily calls with peak QPS exceeding 40 k per machine.
This article details Ximalaya's evolution from a Tomcat‑based gateway to a fully asynchronous Netty implementation, covering architectural redesign, performance bottlenecks, traffic management features, connection‑pool handling, timeout mechanisms, monitoring, and future plans for HTTP/2 and cloud‑native stability.
The article explains that migrating legacy monolithic systems to the cloud is far from a simple lift‑and‑shift, highlighting the pitfalls of inflexible on‑premise infrastructure, the importance of horizontal scaling, stateless application design, micro‑service decomposition, and asynchronous communication to fully leverage cloud elasticity and cost efficiency.
This article details the design evolution, architectural redesign, and performance‑tuning techniques of Ximalaya's gateway—from an initial Tomcat NIO implementation to a fully asynchronous Netty‑based solution—covering traffic management, timeout handling, monitoring, and future HTTP/2 migration.
The article explores how enterprises can reduce tight coupling in microservice architectures by converting synchronous calls to asynchronous messaging, adopting message‑oriented middleware, applying event‑driven analysis, and leveraging CQRS patterns, while also offering practical refactoring tactics for overly coupled services.
This article investigates the often‑confused concepts of asynchronous request and asynchronous call in Spring Boot, explains how they differ in purpose and behavior, shows how to locate reliable definitions through English sources, and demonstrates the distinction with code examples.
This article explains how Nginx runs as a daemon with a master process and multiple worker processes, details its asynchronous non‑blocking I/O model, connection and request handling, keep‑alive and pipeline mechanisms, and describes the key internal data structures such as connections, requests, arrays, queues, lists, strings, memory pools, hash tables, and red‑black trees.
This article explains what RabbitMQ is, describes common scenarios such as decoupling services, improving asynchronous processing efficiency, and handling traffic spikes, and outlines the benefits and drawbacks of integrating a message queue into system architecture.
This article explains Redis's replication mechanism in detail, covering the step-by-step copy process, data synchronization via PSYNC, full and partial synchronization workflows, heartbeat management, and asynchronous replication, while highlighting key commands, offsets, run IDs, and performance considerations.
This article explains how to achieve asynchronous processing in PHP by using non‑blocking socket connections, ajax calls, popen, curl, and fsockopen, providing code examples and discussing their advantages and limitations for backend development.
The article explains JavaScript’s single‑threaded execution stack and how the event loop—using an event queue, micro‑tasks, and macro‑tasks—coordinates asynchronous operations in browsers and Node.js, detailing libuv’s stages and showing how this model enables non‑blocking, concurrent programming.
This guide explains what a message queue is, why it’s used in asynchronous architectures, walks through installing RabbitMQ on Linux and macOS, and demonstrates core patterns such as simple queues, work queues, publish/subscribe, routing, topics, and RPC with complete Python code examples.
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.
The PHP Event extension wraps the libevent library to provide an object‑oriented API for building event‑driven, non‑blocking HTTP servers and clients, timers, and signal handling, with example code and links to documentation and related extensions.
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.
The article presents a design for an asynchronous component that is monitorable, fault‑tolerant, and integrates with zero overhead, compares Akka, RxJava, and a custom JUC‑based implementation, and selects the latter—using extended Callables and a CountDownLatch—to track business units, handle timeouts, and provide fallback behavior.
The article analyzes common coupling problems in microservice architectures and presents practical decoupling techniques—including asynchronous messaging, event‑driven design, local caching, data landing, and CQRS—while also offering refactoring guidelines for tightly coupled services.
This article explains Nginx’s highly modular architecture, its multi‑process and asynchronous non‑blocking request handling, the event‑driven model, and the master/worker design, providing a comprehensive foundation for developers who want to understand or explore Nginx’s source code.
This article explains Vue's $nextTick by first detailing JavaScript's single‑threaded event loop, then showing how Vue batches DOM updates using macro‑ and micro‑tasks, and finally walks through a custom implementation with code examples and common pitfalls.
This article introduces Java 8's CompletionStage API and its CompletableFuture implementation, explains the contract of CompletionStage, and demonstrates a wide range of synchronous and asynchronous operations—including creation, chaining, exception handling, combinators, and real‑world usage—through concise code examples.
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.
Faced with tens of thousands of dirty records and no bulk‑delete API, the author iteratively optimized a deletion script—starting with simple serial requests, then adding asynchronous HTTP calls, and finally employing multithreading—to achieve rapid, reliable removal of hundreds of entries per second.
This guide explains how to use Spring Boot's ActiveMQ starter to configure, code, and test both queue (point‑to‑point) and topic (publish‑subscribe) messaging, covering JMS fundamentals, project setup, bean definitions, listener annotations, and dual‑mode container factories.
This article explains how to build a high‑availability service layer for large‑scale web systems by vertically splitting business domains, adopting stateless design, configuring timeouts, using asynchronous messaging, ensuring idempotent operations, and applying service degradation techniques to maintain stability during traffic spikes.