Tagged articles
stock management
15 articles · Page 1 of 1
This guide explains how to add purchase quantity limits to a PHP‑based online store by designing a stock field in the database, updating product detail, cart, and order pages, using Ajax for dynamic updates, and ensuring inventory consistency throughout the checkout process.
AJAXe-commercequantity limit
0 likes · 4 min read

This article details the design of a reusable, configurable lottery platform for a youth‑focused social app, covering business background, pain points, a modular data model, micro‑service architecture, stock pre‑allocation with optimistic and distributed locks, real‑time risk detection, over‑issue prevention, probability calculation, and future AI‑driven enhancements.
Backend ArchitectureLottery SystemRisk Control
0 likes · 26 min read

The article describes how the FoxFriend team built a scalable, configurable lottery‑activity platform that replaces manual feed‑based draws with a modular micro‑service architecture, featuring a flexible prize‑tier data model, pre‑occupied inventory buckets, multi‑tenant isolation, high‑concurrency stock deduction, user risk controls, accurate probability handling, and a roadmap toward AI‑driven optimization.
Backend DevelopmentDistributed LockLottery System
0 likes · 25 min read

This guide explains how to design the database, modify product detail, cart, and order pages, and use PHP and Ajax to enforce stock‑based purchase quantity limits in an online store, ensuring users cannot exceed available inventory and improving overall shopping experience.
BackendPHPe-commerce
0 likes · 4 min read

This article explains how to implement product purchase quantity limits in a PHP‑based online store by designing a stock field in the database, updating product detail, cart, and order pages, using Ajax for dynamic updates, and handling inventory adjustments during order processing to improve user experience and operational efficiency.
Backende-commercequantity limit
0 likes · 4 min read

The article analyzes common inventory‑deduction scenarios, compares three approaches—single‑row MySQL, multi‑row MySQL, and Redis INCRBY—highlights the limitations of database‑based methods under heavy load, and presents a robust Redis‑Lua solution with distributed locking and Java code examples for reliable stock management.
JavaLua scriptingRedis
0 likes · 12 min read

This article details the evolution, layered architecture, stock types, deduction strategies, high‑concurrency solutions, and synchronization mechanisms of the Vivo Mall inventory system, illustrating how the backend was refactored to support diverse business scenarios and prevent overselling.
High ConcurrencyInventorystock management
0 likes · 15 min read

This article analyzes the challenges of real‑time inventory synchronization for omnichannel retail—such as sync latency, concurrent overselling, and shared stock calculation—and presents a comprehensive backend architecture featuring low‑latency syncing, dynamic throttling, safety‑stock algorithms, and a scalable calculation engine.
Backend ArchitectureDistributed SystemsInventory
0 likes · 11 min read

This article compares three stock‑deduction approaches—single‑record MySQL, sharded MySQL, and Redis with Lua scripts—analyzes their performance and concurrency issues, and provides complete Java/Spring code for a Redis‑based solution including distributed locking and initialization callbacks.
Distributed LockInventorySpring
0 likes · 10 min read

This article compares three stock‑deduction approaches—single‑record MySQL, multi‑record MySQL, and Redis incrby—analyzes their concurrency drawbacks, and provides a complete Spring Java implementation using a Lua script, distributed lock, and callback for initializing inventory.
Springstock management
0 likes · 11 min read

This article explains how to handle flash‑sale (seckill) scenarios in PHP by reducing database pressure with caching, preventing stock oversell using row locks, transactions, file locks, and Redis queues, and provides complete code examples for each technique.
File LockRedisTransaction
0 likes · 13 min read

This article examines common stock‑deduction scenarios in e‑commerce and lottery systems, compares three implementation approaches—single‑row MySQL updates, sharded MySQL rows, and Redis INCRBY with Lua scripts—analyzes their concurrency issues, and provides detailed Java code for a robust Redis‑based solution with distributed locking and serialization considerations.
Luastock management
0 likes · 20 min read

This article analyzes a P0 flash‑sale incident where Redis distributed locks expired and non‑atomic stock checks caused a 100‑bottle over‑sell, then presents safer lock implementations, atomic stock decrement, and architectural improvements to avoid similar failures.
Distributed LockJavaRedis
0 likes · 11 min read


JD TechApr 12, 2018 · Backend Development
The article explains how JD Daojia's inventory system achieves stability and high availability for millions of items by using health‑monitoring platforms, choosing an order‑submission stock reservation strategy, preventing duplicate submissions with token and idempotent mechanisms, implementing rollback procedures, and applying various concurrency‑safe stock‑deduction techniques with code examples.
BackendConcurrencyInventory
0 likes · 12 min read

The article describes how JD Daojia's inventory system serves millions of stores by using health‑monitoring platforms, pre‑allocation policies, idempotent order processing, distributed locks, and rollback mechanisms to ensure stability, prevent overselling, and handle high‑concurrency scenarios such as flash‑sales.
Distributed LockIdempotencyInventory
0 likes · 11 min read
