This article shows how a senior architect measured the exact heap memory allocated by individual HTTP and RPC requests in a SpringBoot 2.5.4 application using JMeter load testing and detailed GC logs, revealing that a minimal HTTP call consumes about 34 KB while an RPC call can use up to 1 MB, and discusses the performance implications of payload size and logging.
This article walks through switching a SpringBoot + MybatisPlus project from MySQL to PostgreSQL, detailing driver addition, JDBC changes, numerous SQL syntax pitfalls, and provides helper scripts for batch column type conversion and default timestamp settings.
This comprehensive course teaches developers how to design and implement a high‑throughput, scalable search engine for e‑commerce platforms using Elasticsearch and SpringBoot, covering architecture, data modeling, performance tuning, and advanced features such as autocomplete, fuzzy correction, price filtering, and sales reporting.
The article explains how over‑design can be avoided by using workflow orchestration and plugin extensions to isolate business logic, reduce if‑else sprawl, and improve extensibility, illustrated with the open‑source MemberClub project and its Java flow‑engine implementation.
This article introduces LiteFlow, a lightweight Java workflow engine, explains its key features, rule syntax, IDE plugin, integration steps with SpringBoot, component development, context handling, and provides practical code examples for building a complex order‑price calculation flow.
This article explains the concept and benefits of plugin-based development in Java, introduces common implementation approaches such as SPI, custom configuration, and Spring Boot's spring.factories, and provides step‑by‑step code examples and a real‑world case study to help developers build extensible backend systems.
This article explains how the @Validated annotation in SpringBoot can automatically enforce request parameter validation, reducing boilerplate code, supporting group validation, and improving code readability and maintainability for backend developers.
This article explains how the SpringBoot @Around annotation empowers developers to handle logging, security, validation and other cross‑cutting concerns in a concise, reusable way, reducing boilerplate code and improving maintainability across multiple modules.
This comprehensive guide explains the purpose, attributes, and usage of Spring MVC, DI, and conditional annotations—including @RequestMapping, @GetMapping, @Autowired, @Scope, @ConditionalOnClass, and more—providing clear examples and code snippets for each.
This article explains why over‑design hurts maintainability, demonstrates how a workflow engine and plugin extension can isolate business logic and enable scalable process chains, and provides step‑by‑step code examples and configuration guidance for SpringBoot projects.
This step‑by‑step guide explains how to set up Ctrip's open‑source Apollo configuration center, create projects and namespaces, integrate it with a SpringBoot application, and deploy the app on Kubernetes while demonstrating dynamic updates, rollbacks, clustering, and environment switching.
This guide explains how to adapt a distributed micro‑service architecture to run all SpringBoot services inside one external Tomcat instance by changing packaging to WAR, configuring server.xml, setting memory options, adjusting virtual addresses, handling logs, and registering services with Nacos for low‑memory environments.
This comprehensive guide walks you through Apollo's background, core model, four‑dimensional configuration management, client design, local caching, and deployment steps—including Maven setup, SpringBoot client implementation, Kubernetes Dockerization, and practical tests across environments, clusters, and namespaces.
This article explains a puzzling Spring Boot transaction rollback caused by MyBatis-Plus's saveBatch method, reproduces the error with nested @Transactional calls, analyzes why the rollback flag is set, and offers a practical workaround by replacing the framework batch operation with a custom mapper implementation.
This article explains multi‑tenancy as a software architecture pattern, describes why it reduces operational costs and improves resource utilization, and presents five concrete SpringBoot designs—including separate databases, shared databases with separate schemas, shared tables, shared‑table with tenant ID, and a hybrid model—along with implementation steps, code samples, pros and cons, and suitable scenarios.
This guide walks you through adding SFTP capabilities to a Spring Boot application, covering Maven dependencies, configuration properties, a reusable SFTP helper class, service and controller layers for file transfer, optional ZIP compression, and practical tips like retries, multithreading, and scheduling.
SpringBoot 3.0 removes the long‑standing spring.factories file due to performance, modularity, and GraalVM native image challenges, introduces a new imports‑file mechanism, and provides detailed migration steps, code examples, performance comparisons, and best practices for GraalVM integration.
This tutorial shows how to add OCR capabilities to a SpringBoot application using the Tess4j library, covering dependency setup, Tesseract engine initialization, RESTful endpoint implementation, training data choices, and practical tips for handling resources and deployment.
This article introduces the Retrofit Spring Boot Starter, a lightweight HTTP client framework for Spring Boot that simplifies HTTP request handling, supports custom OkHttpClient injection, annotation‑based interceptors, logging, retry, error decoding, circuit‑breaker integration, connection‑pool management, global interceptors, microservice calls, and flexible call adapters and converters.
This article explains how to replace the default embedded Tomcat container in Spring Boot with Undertow, details the configuration steps and Maven dependencies, compares performance and memory usage between the two servers, and concludes with a recommendation for high‑concurrency applications, while also promoting related AI resources and services.
This article demonstrates how to build a lightweight OCR service in Java using SpringBoot and the Tess4j library, covering dependency setup, Tesseract engine initialization, RESTful API creation, training data options, and deployment considerations.
This article explains how the Spring @Value annotation can automatically inject configuration values from property files, support default values and SpEL expressions, and streamline environment-specific settings in Spring Boot applications, while also providing practical code examples and usage tips.
This article explains how the @RateLimiter annotation in SpringBoot can replace manual, verbose rate‑limiting code with a concise declarative approach, covering basic usage, custom strategies, real‑world examples, and the benefits of reduced complexity and improved system stability.
This article walks through the full process of designing, configuring, and implementing a sharding solution for large loan and repayment tables using ShardingSphere, Spring Boot 3, MySQL, and MyBatis‑Plus, covering schema planning, data migration, DBA coordination, code examples, common pitfalls, and operational considerations.
This guide walks through the problem of server‑initiated push in a Spring Boot project, explains why WebSocket is needed over HTTP, and provides step‑by‑step Maven setup, configuration classes, controller code, a test HTML page, and troubleshooting tips for proper initialization.
Spring Boot's @Async annotation enables developers to replace manual thread and thread‑pool management with simple method annotations, providing automatic asynchronous execution, customizable thread pools, and flexible return types such as Future and CompletableFuture, thereby streamlining code, improving efficiency, and reducing complexity in backend services.
This article explains how SpringBoot's @PathVariable annotation automatically binds URL path parameters to method arguments, simplifying RESTful API development, reducing boilerplate code, and improving maintainability, with examples and advanced usage tips for developers.
Discover twelve practical SpringBoot performance optimization techniques—from connection pool tuning and JVM memory settings to caching, async processing, and full‑stack monitoring—each illustrated with code snippets and actionable guidance to prevent full‑table scans, OOM errors, and latency spikes in high‑traffic applications.
This article explains how SpringBoot’s @Cacheable annotation automates cache handling, reducing boilerplate code, improving performance, and simplifying maintenance, while also covering related annotations like @CacheEvict and @CachePut, with practical code examples for user and product data caching in real-world applications.
This article explains how the @Valid annotation in Spring Boot can automatically enforce bean validation, replace verbose manual checks, support custom validators, and greatly reduce boilerplate code when handling complex form inputs in backend applications.
This article explains why repetitive logger boilerplate in Spring Boot is a problem, introduces Lombok's @Slf4j annotation that auto‑generates a logger, shows basic and advanced usage with code examples, and outlines the benefits for real‑world backend projects.
This tutorial walks through creating a fire‑equipment inspection system where a mobile client reports anomalies and a backend pushes real‑time updates to a monitoring page using WebSocket, with a Vue front‑end and SpringBoot server implementation.
When handling complex forms in SpringBoot, developers often write repetitive code to extract each field, but the @ModelAttribute annotation automatically binds all form parameters to Java objects, reducing boilerplate, improving readability, and supporting custom binding scenarios.
This article analyses why Spring Boot startup can take dozens of seconds, breaks down the most time‑consuming phases such as prepareEnvironment and refreshContext, shows profiling code and screenshots, compares a simple MVC demo with a real‑world project, and identifies external client connections and configuration loading as the biggest bottlenecks.
This article explains how to efficiently handle exceptions in Spring Boot applications by using @ControllerAdvice and @ExceptionHandler annotations, providing step-by-step code examples for custom global exception classes, error response structures, and handling specific exceptions such as business, null pointer, and type conversion errors.
This article explains how SpringBoot’s @DateTimeFormat annotation automatically converts timestamps and date strings to Date, LocalDate, or LocalDateTime objects, eliminating manual parsing code, and provides practical examples ranging from simple date parameters to custom datetime patterns for more efficient backend development.
Spring Boot's @SessionAttributes annotation enables automatic session data handling, eliminating repetitive HttpSession code, simplifying development, improving maintainability, and supporting multi-attribute management and cleanup, as demonstrated through detailed examples and best practices for user login and shopping cart scenarios.
The article explains how the SpringBoot @PageableDefault annotation automatically provides default pagination parameters, reducing boilerplate code, improving readability, and offering flexible control for various query endpoints in Java backend development.
This article explains how SpringBoot's @RequestHeader annotation automatically binds HTTP request headers to controller method parameters, reducing boilerplate code, supporting default values and optional headers, and improving readability and development efficiency with clear code examples.
This guide demonstrates how to set up Docker‑based MySQL instances, configure ShardingSphere‑Proxy for database sharding and read‑write splitting, and integrate ShardingSphere‑JDBC with SpringBoot 2.x using YAML configurations and Maven dependencies, providing complete code snippets and default connection details.
This article introduces the six main types of interceptors in SpringBoot—Filter, HandlerInterceptor, AOP, RestTemplate, Feign, and WebFilter—explaining their typical use‑cases, implementation details, common pitfalls, and best‑practice ordering to help developers choose the right tool for each scenario.
This guide demonstrates how to protect a Spring Boot service from malicious requests by creating a custom interceptor that tracks URL‑IP request counts, uses Redis for distributed locking, and disables offending IPs after a configurable threshold, with full code examples and configuration steps.
The article explains how the SpringBoot @Timed annotation can automatically record method execution times, replacing verbose manual timing code, and demonstrates basic and advanced usages with custom metric names and tags to simplify performance monitoring in backend development.
The article explains how SpringBoot's @ResponseStatus annotation can automatically set HTTP response status codes for methods and custom exceptions, reducing boilerplate code, improving maintainability, and offering flexible error handling, with practical examples and best‑practice guidelines.
The article introduces the custom @ViewController annotation for Spring Boot, explains how it simplifies conditional view selection compared with manual if‑else logic, provides basic and advanced code examples, lists its advantages, and shows real‑world usage in an e‑commerce project.
This article explains how the @Encrypt annotation in SpringBoot can automatically handle encryption and decryption of sensitive API parameters, eliminating repetitive manual code, improving maintainability, and allowing custom encryption strategies for real‑world applications.
This guide explains how to enable SpringBoot scheduling, write cron expressions, configure fixedRate and fixedDelay intervals, and run scheduled tasks asynchronously, providing step‑by‑step instructions and a detailed table of cron field meanings for backend developers.
This article explains how the @ApiVersion annotation in SpringBoot can automatically manage multiple API versions, reducing manual URL changes, eliminating duplicated code, and improving maintainability, with practical code examples and a discussion of advanced usage scenarios.
This article investigates the reasons behind Spring Boot's slow startup by tracing the execution timeline, examining the prepareEnvironment and refreshContext phases, profiling bean creation, configuration loading, and external client initialization, and provides sample Java code for measuring and visualizing each step.
The article explains how the @Authenticated annotation in SpringBoot can replace repetitive manual authentication code, offering automatic request validation, role‑based checks, and streamlined error handling, with practical examples and a clear list of benefits for developers.
Learn how the @Timeout annotation in SpringBoot simplifies request timeout management by eliminating repetitive configuration code, offering automatic timeout control, customizable fallback methods, and improved maintainability, with practical examples and step-by-step guidance for integrating it into your APIs.
Spring Boot developers can eliminate complex CORS configurations by applying the @CrossOrigin annotation directly on controllers or methods, which simplifies cross‑origin request handling, supports custom origins, methods, and headers, and can be globally configured for consistent, secure API access across environments.
This article explains how the @RequestParam annotation in SpringBoot automatically binds request parameters—whether from forms, query strings, or URLs—to controller method arguments, reducing boilerplate code, improving readability, and enhancing development efficiency, with practical code examples and advanced usage tips.
This article demonstrates how to use SpringBoot 3.0.4 with AOP and a custom @DataSource annotation to dynamically switch between MySQL master and slave databases, ensuring high availability by automatically falling back to the master when a slave fails, and provides configuration and code examples for multiple data sources.
This article explains how Spring Boot's @Transactional annotation automates transaction management, reducing boilerplate code, improving development efficiency, and ensuring data consistency, while also covering its underlying AOP mechanism, configuration options, and practical code examples.
This article explains how SpringBoot's @RequestMapping and its derived annotations like @GetMapping, @PostMapping, @PutMapping, and @DeleteMapping can reduce repetitive routing code, improve readability, and accelerate development of RESTful APIs, illustrated with practical code examples and best‑practice tips.
This article explains how the @Validated annotation in Spring Boot can replace repetitive validation logic by supporting group validation, providing cleaner code, better maintainability, and higher development efficiency for Java backend developers.
The article explains how using SpringBoot's @RestController annotation can replace the verbose combination of @Controller and @ResponseBody, reducing configuration overhead, aligning with convention‑over‑configuration principles, and streamlining backend development for faster, cleaner API implementations.
This article explains how to extend an open‑source smart production management system with MCP support by creating SSE/HTTP endpoints, a token‑based MAP, and a McpService that scans, executes, and pushes results, and demonstrates client configuration using CherryStudio.
The article explains why over‑designing with workflow orchestration is harmful, introduces a flow‑engine and plugin‑extension approach to achieve clean code isolation and easy business extension, and provides concrete Java examples from the open‑source MemberClub project.
This article explains how to use the iTextPdf library in a Java SpringBoot project to create PDF invoice templates, fill fixed and dynamic product data, merge multiple PDFs, and output the final document, providing full Maven dependencies, code examples, and implementation steps.
This article explains why asynchronous programming improves concurrency in SpringBoot applications, describes how to enable @Async support, configure a custom ThreadPoolTaskExecutor, annotate methods for async execution, and outlines the underlying proxy mechanism that powers @Async.
This article explains how to dynamically modify the execution time of SpringBoot scheduled tasks by combining ScheduledTaskRegistrar with ThreadPoolTaskScheduler, decoupling business logic from triggers, and provides complete code examples for adding, updating, and removing tasks at runtime.
This article explains how to enable SpringBoot scheduling with @EnableScheduling and @Scheduled, describes the three scheduling modes (cron, fixedDelay, fixedRate), and provides a complete solution for dynamically updating, disabling, and re‑enabling Cron expressions at runtime using custom interfaces and configuration classes.
This article explains why Java introduced the Context ClassLoader to bypass the parent‑delegation model, how it enables SPI mechanisms such as JDBC drivers, and the specific class‑loading pitfalls encountered when running Spring Boot applications as executable JARs.
The article explains how the MemberClub open‑source project leverages a flow engine and plugin extension engine to achieve business code isolation and extensibility, illustrating the problems of if‑else branching in multi‑business systems, providing configuration examples, execution principles, and Java code snippets.
The article explains what CORS is and presents four main approaches—using simple and pre‑flight request headers, configuring Nginx as a reverse proxy, adding a SpringBoot CorsConfig or CorsFilter bean, and delegating CORS to an API gateway—so developers can resolve cross‑origin issues in SpringBoot applications.
The article explains how SpringBoot’s asynchronous request handling—using Callable, WebAsyncTask, and DeferredResult with a custom thread pool—can boost API throughput up to ten times compared to synchronous processing, while detailing the internal flow, configuration steps, and scenarios where async is beneficial.
This article details a step‑by‑step experiment using SpringBoot 2.5.4 and JMeter to quantify how much heap memory a single HTTP or RPC request consumes, analyzes GC logs, presents code snippets for the test endpoints, and discusses the impact of logging and payload size on memory usage.
This article walks through the complete process of implementing dynamic data source switching in a SpringBoot application, covering the core concepts of thread‑local context, abstract routing, custom annotations with AOP, configuration, code examples, and important considerations such as transaction management and performance.
This article walks through why repetitive CRUD code wastes development time, reviews existing generators like MyBatis‑Generator and MyBatis‑Plus, and then demonstrates step‑by‑step how to create a custom Java code generator using Freemarker, Maven, and SpringBoot, complete with template and demo code.
This article explains MyBatis's two‑level caching mechanism, detailing how first‑level session cache works, why it often fails in Spring Boot without transactions, how to enable and configure second‑level cache, and the potential pitfalls of cache inconsistency across mapper namespaces.
This tutorial explains how to use SpringBoot, AOP, and a custom @DataSource annotation to dynamically switch between MySQL master and slave databases—covering configuration, code implementation, multiple slave handling, and an Oracle example—to ensure high availability and flexible data source management.
This comprehensive guide explains the most common Spring MVC and Spring Boot annotations—including @RequestMapping, @GetMapping, @Autowired, @Component, @Scope, and conditional annotations—detailing their purposes, configuration attributes, and practical code examples to help Java backend developers write cleaner, more maintainable code.
This article details the end‑to‑end design, configuration, and code implementation of a sharding solution for loan and repayment tables, covering database schema changes, historical data migration, dynamic synchronization switches, transaction handling, and practical pitfalls when using Spring Boot 3 with ShardingSphere.
This article demonstrates how to implement MySQL master‑slave dynamic data source switching in a SpringBoot 3.0.4 project using AOP, custom annotations, and configuration files, ensuring automatic failover to the master when a slave becomes unavailable.
This article demonstrates how to simulate a high‑concurrency flash‑sale scenario with SpringBoot and MySQL, analyzes why naive lock‑and‑transaction code causes overselling, and presents six refined solutions—including early locking, AOP, pessimistic and optimistic database locks, blocking queues, and Disruptor queues—along with performance observations and a concise summary.
This article explains how SpringBoot uses Tomcat by default, shows how to replace it with Undertow by adding the appropriate dependency, and presents benchmark results demonstrating Undertow's superior throughput and lower memory consumption for high‑concurrency Java web applications.
This article explains the Model Context Protocol (MCP) for seamless LLM integration, describes its background, presents a sequence diagram of its architecture, and provides step‑by‑step Java SpringBoot code for SSE streaming, HTTP POST handling, and annotation‑based tool registration.
This tutorial demonstrates how to configure IntelliJ IDEA for remote one‑click deployment of a SpringBoot application with Docker, covering environment setup, SSH and Docker daemon configuration, Dockerfile creation, Maven build steps, firewall adjustments, and troubleshooting common deployment issues.
SpringBoot 3.0 eliminates the long‑standing spring.factories file due to startup performance penalties, lack of modular support, static configuration limits, and incompatibility with GraalVM native images, and replaces it with a set of imports files that provide clearer, faster, and more modular auto‑configuration registration.
This article investigates why MySQL discourages UUID or non‑sequential Snowflake IDs as primary keys, compares auto_increment, UUID, and random‑key tables through SpringBoot‑JdbcTemplate benchmarks, analyzes their index structures, and explains the performance trade‑offs and security considerations.
This article explains how to implement unified global exception handling in SpringBoot by using @ControllerAdvice with @ExceptionHandler, defining a base error interface, custom enums, exception classes, and a standardized response wrapper, while also providing test code examples and best‑practice recommendations.
This article explains how to use SpringBoot, AOP, and a custom @DataSource annotation to dynamically switch between MySQL master and slave databases, automatically falling back to the master when a slave fails, thereby achieving high availability for backend services.
This guide walks through creating a Docker Compose file that defines a custom network, assigns static IPs to Redis, MySQL, and a Java container, and shows how to configure SpringBoot to connect to these services using the assigned addresses.
This article provides a detailed walkthrough of Spring and Spring Boot's core concepts, explains the bean container refresh process, and enumerates all major extension interfaces—including ApplicationContextInitializer, BeanDefinitionRegistryPostProcessor, BeanFactoryPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, various *Aware interfaces, @PostConstruct, InitializingBean, FactoryBean, SmartInitializingSingleton, CommandLineRunner, DisposableBean, and ApplicationListener—accompanied by code samples and usage scenarios.
This tutorial demonstrates how to replace the traditional jar‑upload workflow with an IDEA‑integrated Docker solution, covering environment setup, SSH configuration, Docker daemon connection, SpringBoot code, Dockerfile creation, remote deployment settings, firewall opening, and common troubleshooting steps.
This article explores comprehensive strategies for capturing business operation logs in a Spring‑based system, comparing three solutions—from a simple AOP‑annotation approach, through an enhanced AOP + SpEL method, to a robust Binlog‑plus‑time‑window architecture—while weighing their advantages, drawbacks, and implementation details.
This guide walks you through setting up a SpringBoot application, configuring Logback, installing and configuring Loki, Promtail, and Grafana, and comparing the lightweight Loki stack with the traditional ELK solution for efficient log collection and visualization.
Benchmarking three MySQL tables—auto_increment, UUID, and random long keys—shows that sequential auto_increment inserts are fastest, random keys are slower, and UUIDs dramatically lag due to random I/O and fragmentation, so use auto_increment for most workloads and reserve UUIDs only for required global uniqueness.
This article demonstrates how to build a dynamic data source switching mechanism in Spring Boot by leveraging ThreadLocal for thread‑scoped context and AbstractRoutingDataSource for routing, covering manual implementation, annotation‑driven switching, and runtime addition of new data sources.
This article explains how Spring's declarative transaction management works, why the @Transactional annotation can unexpectedly become ineffective, and presents twelve typical scenarios—such as internal method calls, non‑public methods, final/static modifiers, proxy issues, and incorrect propagation settings—along with practical solutions to ensure reliable transaction handling.
The article introduces Redis Streams as a Kafka‑like messaging structure, explains its fundamental concepts and seven core commands (XADD, XRANGE, XREAD, XGROUP CREATE, XREADGROUP, XACK, XTRIM), demonstrates integration with Spring Boot, and evaluates its fit for lightweight, low‑backlog queue scenarios.
The article explains how to update a SpringBoot application without stopping the old process by detecting port usage, temporarily launching a new instance on an alternate port, then seamlessly switching the original port to the new instance, achieving near‑zero downtime.
This guide walks you through integrating SpringBoot with Prometheus and Grafana, covering dependency setup, YAML configuration, a test controller, Prometheus scrape jobs, and Grafana dashboard creation to achieve real‑time application monitoring and performance analysis.
This tutorial walks through installing MinIO and kkFileView via Docker, configuring a public bucket, and using SpringBoot to generate preview URLs that let you view images, Word, PDF, PPT, Markdown, Excel, and archive files directly in the browser.
This tutorial explains how to set up IntelliJ IDEA and Docker for one‑click remote deployment of a SpringBoot application, covering prerequisite installations, SSH configuration, Docker daemon basics, Dockerfile creation, and the step‑by‑step configuration within IDEA to streamline project deployment and log monitoring.
This tutorial explains how to configure IntelliJ IDEA and Docker for one‑click remote deployment of a SpringBoot application, contrasting the traditional jar‑file method with a Docker‑based workflow that streamlines building, uploading, and running the service while providing real‑time log access.
The Concept‑Download library lets SpringBoot developers replace verbose download code with a single @Download annotation that automatically handles classpath resources, local files, HTTP URLs, custom objects, compression and reactive streaming, simplifying batch and QR‑code ZIP exports.