"Be their eyes, Online."
SoakUpTheSun is a high-concurrency heterogeneous microservices platform based on Java + Go + Python. We have abandoned the traditional offline rescue model and built a purely online assistance system based on Go SFU Real-time Streaming + Redis Hot Pool Matching.
By integrating RocketMQ Asynchronous Decoupling, Lua Atomic Locks, and AI Visual Analysis technologies, we allow visually impaired users to connect with global volunteers in milliseconds with just a tap on the screen, transcending geographical limitations.
Currently, this is a learning-oriented project. You can learn solutions for common scenarios such as flash sales (seckill), mass distribution, cache breakdown, cache penetration, instant messaging (IM), matching algorithms, and self-deployed AI model usage.
Due to space limitations, detailed implementation diagrams and functional charts for each feature cannot be fully displayed here. Please contact the email at the end of this document, and I will send you the complete architecture diagrams.
The system adopts a heterogeneous microservices architecture with a fully asynchronous core link design.
Diagram Explanation: The system is divided into the Java Business Middle Platform, the Go Streaming Layer, and the Python AI Computing Layer. Core interactions are scheduled via the Redis Hot Pool, utilizing RocketMQ for traffic peak shaving.
-
β‘οΈ Millisecond-Level Hot Pool Matching Utilizes
Redis Setto maintain a real-time pool of online volunteers. Unlike traditional database queries, we only match users who activelyactivatetheir status. Combined with an Elasticsearch fallback strategy, this ensures a connection success rate of > 99%. -
π₯ Self-Developed Go SFU Streaming Service A deeply customized SFU server based on the Pion framework, supporting WebRTC signaling interaction and RTP packet forwarding. Optimized for weak network environments, keeping end-to-end latency within 200ms.
-
π‘οΈ High-Concurrency Short Link Defense System Integrates Bloom Filter and Redis Token Bucket. Performs O(1) extreme-speed deduplication before generating 6-digit short codes, effectively preventing ID collisions and malicious traversal attacks.
-
π Asynchronous Slicing Import for Massive Data Adopts a TaskQueue + Async Thread Pool solution to handle Excel imports of 100,000+ rows. Uses Mybatis-Plus for batch insertion and dual-writing to ES, avoiding long transactions that could lock the database.
-
π° Redis Lua Atomic Inventory Flash Sale In public welfare prize redemption scenarios, "inventory query" and "inventory deduction" are encapsulated into a single Lua script, executed atomically in the Redis single-threaded model to completely eliminate overselling.
| Domain | Technology Selection | Core Function |
|---|---|---|
| Service Governance | Spring Cloud Alibaba | Nacos (Registration/Config), OpenFeign (RPC) |
| Audio/Video | Go (Golang) + Pion | WebRTC Signaling Exchange, RTP Media Forwarding |
| AI Computing | Python + OpenCV | Computer Vision Analysis (OCR/Object Detection) |
| Persistence | MySQL 8.0 | Business Data Storage |
| Cache/Lock | Redis (Redisson) | Distributed Lock, Hot Pool (Set), Bloom Filter, Lua Script |
| Search | Elasticsearch 7.x | Multidimensional Volunteer Matching (Painless Script), Inverted Index |
| Message Queue | RocketMQ | Image Analysis Peak Shaving, Async Decoupling, Excel Task Distribution |
| Task Scheduling | XXL-Job | Distributed Scheduled Tasks (Point Settlement) |
| Object Storage | Tencent COS | Massive Storage for Images/Video Files |
Scenario: In emergency call mode, multiple visually impaired users might match with the same online volunteer simultaneously; or during a prize flash sale, inventory might drop below zero. Solution:
- Atomic Guarantee: Abandoning Java-level locks, we encapsulate "query state" and "lock state" into Redis Lua scripts, leveraging Redis's single-threaded nature for atomic execution.
- Distributed Lock Fallback: After successful Lua execution, a Redisson Watchdog mechanism is introduced to prevent lock anomalies caused by business logic timeouts, ensuring strong data consistency.
Scenario: Video room links are only 6 characters long, making them vulnerable to brute-force traversal or ID collisions. Solution:
- Extreme Speed Deduplication: Introduce Bloom Filter to perform O(1) memory-level deduplication before generating short codes, blocking 99% of invalid database queries.
- Traffic Cleaning: Combined with the Redis Token Bucket Algorithm to limit request rates per IP, preventing malicious scanning.
Scenario: The platform generates millions of review logs daily. Loading all of them into memory for point calculation would cause frequent Full GC or even OOM in the JVM. Solution:
- Streaming Processing: Abandon
LIMIT offsetand design a Cursor Pagination mechanism based on primary key IDs, ensuring query performance does not degrade as data volume increases. - Memory Aggregation: Use Java 8 Stream API to perform small-batch aggregation calculations at the application layer, merging 2000 database updates into a single batch submission, significantly reducing I/O overhead.
SoakUpTheSun/
βββ π clientService/ # [Frontend] Vue.js Client
β βββ public/ # Static Resources (Markdown CSS, Fonts)
β βββ src/
β β βββ api/ # Axios Interface Encapsulation (user.js)
β β βββ assets/ # Assets (styles, images)
β β βββ libs/ # Global Tools (Map, WebSocket Plugins)
β β βββ store/ # Vuex State Management (User, MessageDispatcher)
β β βββ utils/ # Core Utilities (auth.js, request.js)
β β βββ views/ # Page Views (ChatRoom, JoinRoom, UserHome)
β βββ vue.config.js # Frontend Proxy & Build Config
β
βββ π sfu/ # [Streaming] Self-developed Go SFU Server (WebRTC)
β βββ internal/
β β βββ api/room/ # Room Management API (Join, Close, Save)
β β βββ cache/ # Redis Cache Operation Wrapper
β β βββ config/ # System Config (JWT, MySQL, Log)
β β βββ ws/ # WebSocket Signaling (Core Handshake Logic)
β β βββ app/ # Application Startup Lifecycle Management
β βββ utils/ # Toolkit (Base58, JWT, Encrypt)
β βββ config.yaml # Media Ports & ICE Configuration
β βββ main.go # Go Program Entry
β
βββ π volunteer/ # [Backend] Volunteer Core Business Module (The Core)
β βββ src/main/java/org/hgc/suts/volunteer/
β β βββ common/
β β β βββ manager/ # Redis Manager
β β β βββ scheduledTask/ # XXL-Job Scheduled Task (Point Settlement)
β β βββ controller/ # Web Interface Layer (Facade Pattern)
β β βββ facade/ # Facade Pattern Encapsulating Complex Business
β β βββ mq/ # RocketMQ Message Driver
β β β βββ consumer/ # Consumers (EasyExcel Listener, Task Execution)
β β β β βββ easyExcel/ # β‘οΈ Async Slicing Import (ReadExcelDistributionListener)
β β β βββ event/ # Domain Event Objects
β β β βββ producer/ # Message Producers
β β βββ service/
β β βββ impl/ # Business Logic Implementation
β β β βββ VolunteerMatchServiceImpl.java # π Hybrid Dual-Track Matching Strategy
β β β βββ VolunteerPrizesServiceImpl.java # Prize Redemption Logic
β βββ src/main/resources/
β βββ lua/ # β‘οΈ Redis Atomic Script Library
β β βββ redeem_volunteer_prizes_stock_synchronize.lua # Inventory Deduction
β β βββ volunteer_active_match.lua # Hot Pool Matching
β βββ scripts/
β βββ volunteer_match.painless # π ES Dynamic Weight Scoring Script
β
βββ π picture/ # [Backend] Image Processing & AI Integration Service
β βββ src/main/java/org/hgc/suts/picture/
β β βββ common/tensentCos/ # Tencent Cloud COS Object Storage Wrapper
β β βββ mq/consumer/ # Listeners for Image Upload/Video Frame Analysis
β β βββ ws/ # AI Real-time Analysis WebSocket Channel
β
βββ π user/ # [Backend] User Authentication & Authorization Center
β βββ src/main/java/org/hgc/suts/user/
β β βββ common/biz/user/ # UserContext Context & Interceptors
β β βββ remote/ # OpenFeign Remote Call Clients
β
βββ π shortlink/ # [Backend] Short Link Generation Service
β βββ src/main/java/org/hgc/suts/shortlink/
β βββ config/ # π‘οΈ Bloom Filter Configuration (RBloomFilter)
β βββ service/impl/ # Short Code Generation & 302 Redirect Logic
β
βββ π docs/ # Project Documentation Resources
βββ pom.xml # Maven Parent Project Dependency Management- JDK 17+ / Go 1.25+
- MySQL 8.0 / Redis 5.0+ / RocketMQ 5+
- Nacos 2.0+
1. Infrastructure Startup
docker-compose up -d mysql redis rocketmq nacos elasticsearch
cd clientService && npm install && npm run serve
---SoakUpTheSun is a technology-driven public welfare project. If you are interested in Accessibility Design or High Availability Architecture, feel free to submit a PR.
- Author: XXieYiqiang
- Email: [email protected]
If you like this project, please give it a star! βοΈ
