Why Dromara RuoYi-Vue-Plus Stands Out for Distributed Multi‑Tenant Backend Development
Dromara RuoYi-Vue-Plus is an open‑source, MIT‑licensed backend framework built on Spring Boot 3.4 that targets distributed clusters and multi‑tenant scenarios, offering upgraded features, extensive comparisons to other stacks, and a rich ecosystem of tools, documentation, and community support.
Overview
Dromara RuoYi-Vue-Plus is an open‑source backend management framework targeting distributed clusters and multi‑tenant scenarios. It rewrites the original RuoYi‑Vue, runs on Spring Boot 3.4 , and supports both JDK 17 and JDK 21. The current release is 5.4.1 and the project is licensed under MIT, allowing commercial use with attribution.
Version & Technical Base
Framework: Spring Boot 3.4, Spring Cloud 2023.x, Java 17/21.
ORM: MyBatis‑Plus 3.5+, providing enhanced CRUD, pagination and permission plugins.
Database Pools: HikariCP (default), configured via spring.datasource.hikari for high performance.
Repository:
git clone https://gitee.com/dromara/RuoYi-Vue-Plus.gitCore Feature Walk‑through
Data Pagination RuoYi‑Vue‑Plus uses the MyBatis‑Plus pagination interceptor and adds a wrapper object that accepts pagination parameters in three ways (query string, request body, or custom DTO). It also supports front‑end multi‑column sorting and complex order‑by expressions. By contrast, PageHelper only handles a single query, accepts parameters solely from PageHelper.startPage() , and provides a single sort field.
Data Permission The @DataPermission annotation triggers a MyBatis‑Plus plugin that automatically rewrites the SQL to inject tenant‑ or role‑based filters. Developers only annotate the mapper interface; no AOP weaving is required. Other frameworks typically combine @Permission + AOP, producing fragmented SQL that must be manually merged.
Data Masking & Encryption Two independent annotations are provided: @Mask works with Jackson during serialization to hide sensitive fields (ID card, phone, address, email, bank card). The mask strategy is configurable per module. @Encrypt pairs with a MyBatis interceptor to encrypt data on write and decrypt on read. Supported algorithms include BASE64, AES, RSA, SM2, and SM4.
Interface Transmission Encryption Each HTTP request body is encrypted with a dynamically generated AES key; the AES key itself is encrypted with RSA and sent in a request header. Because the key changes per request, brute‑force decryption becomes infeasible.
Multi‑DataSource Framework RuoYi‑Vue‑Plus integrates dynamic-datasource . A typical application.yml snippet:
spring:
datasource:
dynamic:
primary: master
datasource:
master:
url: jdbc:mysql://host1:3306/db_master
username: root
password: pwd
slave:
url: jdbc:postgresql://host2:5432/db_slave
username: admin
password: pwd
# Switch datasource by SpEL expression from request header
seata: trueDevelopers can add new data sources from the front‑end UI, and the framework resolves the target datasource using SpEL expressions such as #request.getHeader('X-DS') . Traditional Druid configuration requires manual bean definitions and lacks runtime switching.
Multi‑DataSource Transaction The same dynamic-datasource library propagates Spring transactions across heterogeneous databases, guaranteeing atomic rollback even when a transaction spans MySQL and PostgreSQL. Competing solutions often lack cross‑database transaction support.
Snowflake Primary Key All tables default to a bigint primary key generated by a Snowflake algorithm (timestamp‑based, 41‑bit time, 10‑bit machine ID, 12‑bit sequence). This yields ordered, globally unique IDs and eliminates primary‑key collisions in sharding or multi‑tenant environments. Auto‑increment IDs cannot guarantee uniqueness across multiple data sources.
WebSocket & SSE Both protocols are wrapped by Spring and extended with token authentication and distributed session synchronization via Redisson. This overcomes the single‑machine limitation of vanilla WebSocket implementations.
Distributed Idempotency The framework adopts Meituan’s GTIS anti‑repeat design: a Redis‑backed token is generated per request, stored with a short TTL, and validated before processing. This prevents duplicate submissions without custom code.
Distributed Lock & Task Scheduling Locking uses Lock4j (built on Redisson). Scheduling relies on SnailJob , which provides native distributed execution, multi‑DB support, sharding retry, and DAG task flow. Quartz, by contrast, depends on database row locks, suffers performance penalties, and requires extensive cluster configuration.
File & Cloud Storage MinIO serves as the distributed object store; configuration is performed via application.yml with bucket, endpoint, access key and secret key. The same client also supports any S3‑compatible provider (e.g., Alibaba OSS, Tencent COS) by switching the endpoint URL.
SMS & Email Integration Both services are abstracted by sms4j and mail-api . Adding a new provider only requires a YAML entry with the provider’s credentials; the framework auto‑selects the appropriate implementation at runtime.
API Documentation SpringDoc OpenAPI 2.x reads Javadoc comments directly, eliminating the need for Swagger annotations. The generated UI is accessible at /swagger-ui.html without extra configuration.
Validation Validation uses the standard javax.validation API with custom constraint annotations that support internationalized messages via messages_zh_CN.properties and messages_en_US.properties .
Excel Processing FastExcel (fork of Alibaba EasyExcel) is extended with plugins for auto‑merge cells, layout control, and dictionary translation. A typical export call:
ExcelExportUtil.export("UserList", UserDto.class, dataList);Workflow Engine The built‑in workflow module supports approval, delegation, sign‑off, and multi‑stage routing. Each step is defined in a JSON DSL, and the engine persists state in the configured datasource.
Utility Framework Hutool and Lombok provide over 200 utility classes and annotation‑driven getters/setters, covering roughly 90 % of common development needs.
Monitoring & Tracing SpringBoot‑Admin (based on Spring Boot Actuator) offers real‑time health checks, JVM metrics, and online log viewing. Apache SkyWalking is integrated for distributed tracing, visualizing request flow across microservices.
Code Generator Running mvn -Pcodegen -DtableName=user generate-sources reads the database schema and produces CRUD controllers, service layers, MyBatis‑Plus mapper XML, and Vue pages. The generator reduces manual coding effort by approximately 80 % and supports multi‑datasource projects.
Docker Orchestration A docker-compose.yml file provisions MySQL, Redis, MinIO, and the application container with a single command docker compose up -d . This eliminates environment‑setup friction for developers.
Business Extensions for Multi‑Tenant & Enterprise Use
The framework adds tenant isolation at the datasource level, row‑level data permission, and distributed rate limiting (Redisson). It also supports domestic databases such as DM and Kingbase via the dynamic datasource abstraction.
Technology Stack Highlights
Tool Integration: Hutool, Lombok, Validation (i18n), FastExcel.
Security Enhancements: Dynamic AES + RSA request encryption, SQL monitoring with p6spy, distributed rate limiting via Redisson.
Compatibility: Heterogeneous master‑slave databases, multi‑datasource transaction rollback, and native support for Chinese RDBMS (DM, Kingbase).
Usage & Support
Documentation and quick‑start guides are hosted at https://plus-doc.dromara.org. An online demo demonstrates multi‑tenant login, role‑based menus, and the full feature set. Front‑end implementations based on vben5 and soybean are maintained by the community.
Project Repository
https://gitee.com/dromara/RuoYi-Vue-Plus
Java Web Project
Focused on Java backend technologies, trending internet tech, and the latest industry developments. The platform serves over 200,000 Java developers, inviting you to learn and exchange ideas together. Check the menu for Java learning resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
