#System Design
7 posts
-
FCFS Load Test Retrospective: Things Easy to Miss in Practice
Problems we hit while k6-testing 4 FCFS strategies — Rate Limiter conflicts, queue over-counting bugs. Plus 4 ways to isolate FCFS APIs from regular APIs in production: separate DataSource, Redis offloading, service separation, and Bulkhead pattern.
-
FCFS System Showdown: Load Testing All Approaches with k6
DB Lock, Redis, Queue, Token — we load-tested all 4 FCFS strategies under identical conditions (100 stock, 100/500/1,000/2,000 concurrent users) with k6. Each scenario ran 10 times to get stable averages for TPS, P95/P99 response times, and we identify the optimal strategy for each situation.
-
Implementing FCFS with Tokens: From Entry Tickets to Bot Prevention
Implements a first-come-first-served system that issues entry tokens upfront — only token holders can purchase. Covers JWT-based token design, TTL expiration strategy, and multi-layered bot prevention with Rate Limiting + CAPTCHA.
-
Implementing FCFS with Queues: From Redis Sorted Set to Kafka
Implements a first-come-first-served system using Redis Sorted Set waiting queues and Kafka message queues. Covers queue UX (polling vs WebSocket), slot reallocation on timeout/abandonment, and traffic spike absorption strategies.
-
Implementing FCFS with Redis: From DECR to Lua Scripts
Implements a first-come-first-served stock deduction system using Redis DECR atomic operations and Lua scripts. Builds it with Spring Boot + Redisson, directly compares TPS against DB locks under identical conditions (100 stock, 100 concurrent users), and covers Redis-DB consistency and failure recovery strategies.
-
Implementing FCFS with DB Locks: From FOR UPDATE to Concurrency Testing
Implements a first-come-first-served stock deduction system using SELECT FOR UPDATE. Builds it with Spring Boot + JPA, validates data consistency with 100 concurrent requests, and identifies where DB locks hit their limits.
-
First-Come-First-Served Systems Explained: 6 Implementation Strategies and How to Choose
Breaks down the core challenges of FCFS systems — concurrency, stock deduction, duplicate prevention — and compares 6 implementation strategies from DB locks to Redis, message queues, waiting queues, and token issuance.