DEV Community

JongHwa
JongHwa

Posted on

Part 3: Final Architecture & Lessons Learned

Intro

The Opener Market project is finally coming to an end. In this final post, I will review the overall system architecture and share the key lessons learned from building a high-concurrency e-commerce platform.


1. The Big Picture: System Architecture

Our system is divided into three main domains, each solving a specific high-traffic problem:

  • Coupon Domain: Uses Redis Lua Scripts for atomic stock control and a Write-Back pattern to ensure data consistency without slowing down the user.
  • Order Domain: Implements Database Locking (Pessimistic/Optimistic) to prevent over-selling and ensure transaction integrity.
  • Search Domain: Powered by QueryDSL for type-safe dynamic queries and optimized with composite indexes for sub-second latency.


2. Performance Milestones

  • Search Latency: Reduced from 1.8s to 0.5s (72% improvement).
  • Throughput: Successfully handled high-concurrency coupon issuance using Redis memory instead of DB locks.
  • Consistency: Guaranteed atomic transactions across Balance, Stock, and Points.

3. Key Lessons

  1. Memory-First Strategy: For high-traffic events, the Database should be the last resort. Redis is essential for protecting the core system.
  2. Asynchronous Processing: Decoupling the user response from heavy tasks (like DB persistence) is the secret to a smooth UX.
  3. Data Integrity vs. Speed: In e-commerce, speed is important, but accuracy is everything. Always use @Transactional and proper locking strategies.

Final Thoughts

Building Opener Market was a deep dive into the world of scalable backend systems. This project taught me how to balance complex requirements with performance optimization.

Top comments (0)