How hgs-study/distributed-lock-practice works
Project Type: This is a specialized backend application demonstrating distributed locking mechanisms using Redis and Redisson in a Spring Boot environment.
Main Components
a. Application Layer:
• Spring Boot Application Container
• Stock Service Component
• Stock Domain Component
• Configuration Components (Redis Config)
b. Infrastructure Layer:
• Redis Server (for distributed locking)
• Database (for stock persistence)
Key Relationships to Highlight
a. Client Interaction Flow:
• Multiple Client Requests (100 threads as mentioned in README)
• Connection to Application Layer
b. Locking Mechanism:
• Redisson Client → Redis Server
• Lock Acquisition/Release Flow
Detailed Flow Representation
1. Multiple clients attempting stock purchase
2. Requests going through StockService
3. Redisson distributed lock acquisition
4. Stock update operation
5. Lock release
Important Architectural Aspects to Emphasize
a. Concurrent Access Handling:
• How multiple threads (100 as per test) interact
• Demonstrate lock queuing mechanism
b. Lock Management:
• Redisson lock acquisition flow
• Lock timeout and retry mechanism
Technical Details
• Spring Boot Application
• Redisson Client Configuration
• Redis Connection Properties
• Stock Entity Structure
Additional Notes
• Notes about concurrent access patterns
• Critical sections protected by distributed locks
• Success/failure scenarios
The role of Redis in maintaining distributed lock consistency
Remember to:
• Use consistent notation
• Version information
• Relevant metrics or performance indicators
• Document any assumptions or limitations