Server System Design for Withstanding Traffic Spikes - Coupon Issuance Service

Through the implementation of a first-come, first-served coupon system, you will solve key real-world backend challenges such as concurrency issues, data consistency, and handling peak traffic. By writing the code yourself, you will identify problems and master essential practical skills, including synchronous/asynchronous processing and queue management. This project-based course is designed to help junior developers and job seekers gain hands-on experience.

(4.9) 22 reviews

805 learners

Level Basic

Course period Unlimited

Java
Java
Kotlin
Kotlin
MySQL
MySQL
Docker
Docker
Spring Boot
Spring Boot
Java
Java
Kotlin
Kotlin
MySQL
MySQL
Docker
Docker
Spring Boot
Spring Boot

Reviews from Early Learners

4.9

5.0

SPRING

100% enrolled

I found the system architecture flow very helpful. Although the course is labeled as beginner-level, the infrastructure used does not seem to be at a beginner level. Personally, I prefer live coding over reviewing AI-generated code, so I liked that aspect. However, I am more familiar with Java, so the Kotlin syntax was unfamiliar to me. I also changed the package names as I pleased before starting the course, and since I ran K6 in a container from Windows Git Bash, the shell script tests actually made the learning process more difficult. Some people may find it convenient to copy and paste the shell script tests, but I personally did not like them. I found the flow of the K6 and shell script tests more difficult to follow than expected, and I feel that I may forget the test flow again when I look at it after some time has passed. Nevertheless, I think it is a good course that will be very helpful to learners from an architectural perspective and in terms of utilizing Redis.

5.0

maruhxn

61% enrolled

I hadn't been able to organize the potential issues that occur with large-scale traffic in my head, but this single lecture makes me feel like all my fragmented knowledge is finally coming together. I am so grateful to be able to take a course like this.

5.0

AKBA

100% enrolled

[Overall Review] Rather than merely providing an overall introduction to the architecture, this course created problem scenarios and explained the What, Why, and How in depth. I was able to learn not only what to use, but also why it is needed and how to apply it. I mainly use Python, but I am also studying Kotlin and Spring separately, so I had no major difficulty following the course. I personally learned a great deal, and for that very reason, it was difficult to fully digest all the content in a single pass. It was a sufficiently in-depth course that I wanted to watch it at least twice and review the material. In terms of difficulty, it may be a little challenging for beginners, but it is a course worth taking despite that difficulty. [Points for Improvement] I practiced in a Windows environment, and some of the test scripts in the latter part of the course were difficult to run as-is in PowerShell, so I had to modify them and proceed in a different way. I was able to resolve the issues with the help of AI, but it took some time to adapt them to my environment. It would be very helpful if Windows-specific test scripts or execution instructions could be provided separately in the future. I tend to write the code myself in order to understand the logic as thoroughly as possible, so lectures longer than 30 minutes sometimes felt somewhat burdensome to study as a single lesson. Of course, I also understand the intention to explain a single topic without interrupting its flow. It was a great course.

What you will gain after the course

  • Techniques for Resolving Concurrency Issues and Ensuring Data Integrity

  • Traffic load distribution design through synchronous/asynchronous processing

  • Implementing a Queueing System and Peak Traffic Protection Architecture


Why does a server that is usually fine collapse when an event starts? 🚦


  • When a first-come, first-served coupon event opens, countless requests access the same inventory simultaneously.

  • More coupons may be issued than the prepared quantity, the same user may receive two, or records across multiple data stores may become inconsistent.



Instead of memorizing a finished architecture, this course has you bring down and redesign a coupon issuance service yourself.


Reproduce the problem, measure TPS, P99, error rates, and actual issuance accuracy, then choose DB locks, Redis, Kafka, caching, and a virtual waiting room, and validate them again under the same load.


Server System Design for Withstanding Traffic Spikes - Coupon Issuance Service

  • You will write code with Kotlin and Spring Boot.

  • You will run MySQL, Redis, and Kafka with Docker Compose, and even if Redis and Kafka are new to you, you can follow along step by step if you have a basic understanding of HTTP, RDBs, and Spring Boot.


Features of This Course


📌 Continuously evolve a single coupon service from a basic implementation through concurrency, asynchronous processing, caching, consistency recovery, and traffic control.

📌 We repeat the process of reproducing the problem → measuring bottlenecks → choosing a design → revalidating under the same conditions in every part.

📌 We don't look only at TPS and P99. We also verify whether exactly N tickets were issued, whether the one-ticket-per-person rule was followed, and whether every event was stored in MySQL without omission.

📌 We directly compare various alternatives, such as DB pessimistic locks and Redis Lua, and in-memory queues and Kafka, to determine when to choose which.

📌 We don’t stop at theory. Working code, the execution environment, k6 load scenarios, and validation results from before and after the changes are all preserved as one complete set.

Recommended for those who fit the following profile

Junior backend developers experiencing peak traffic for the first time

This is a great fit for those who feel unsure where to start—whether with the database, cache, or queue—when requests surge.

Backend job seekers who want to develop their system design skills

Recommended for those who want to explain problems, choices, and results through projects instead of simply listing technology names.

Server development learners who want to validate performance with numbers

This will help those who want to take their systems beyond CRUD through load testing and failure reproduction.

You’re already familiar with straightforward implementations but feel unsure where to start investigating and which technologies to choose when traffic surges. This is a great fit for you. By reproducing problems yourself and improving designs based on measurement results, you’ll develop practical criteria for making decisions in real-world situations.


After completing the course,

✓ You can implement issuance logic that maintains both accurate quantities and the one-ticket-per-person rule, even with concurrent requests.

✓ You can compare the pros and cons of DB pessimistic locks, Redis distributed locks, and Redis Lua atomic operations, and choose the right approach for each situation.

✓ Separate user responses from database storage with Kafka, and recover failed messages through a DLT and reprocessing flow.

✓ You can detect and respond to Cache Stampede, request surges after a sellout, and inconsistencies between Redis and MySQL.

✓ Connect a virtual waiting room with Gateway Rate Limit to make legitimate users wait and block abusers at the entrance.

✓ In addition to TPS, P99, and error rate, you can measure issuance volume, duplicates, and missing data to demonstrate the results of design improvements.


You’ll learn about these topics.

Reproduce the problem and find the cause through numbers

Intentionally create coupon over-issuance and bottlenecks. Read TPS, P99, error rates, and accuracy metrics, then compare the designs before and after under the same k6 load conditions. Build a basis for your next decision using measurements, not intuition.

Grow through 6 stages, from basic implementation to traffic control

We proceed in the order of implementing coupon requirements, concurrency control, asynchronous processing, caching strategies, consistency recovery, and traffic control. By identifying the limitations of each step, you will naturally understand why the next design is needed.

Connect multiple technologies into a single coupon issuance flow

The Gateway and virtual waiting room control the entry rate, while Redis atomically handles inventory and duplicate issuance. The Kafka Worker saves the data to MySQL, and the batch scheduler checks for inconsistencies between the two data stores.

The code and verification results are preserved together

You will build an application with Kotlin and Spring Boot. Run MySQL, Redis, and Kafka with Docker Compose, then use k6 to apply real-world load and check TPS, P99, error rate, issuance volume, duplicates, and missing records.

Why I created this course

  • A completed architecture may make every choice seem obvious, but in practice you need to identify the cause and choose one option from among several alternatives.

  • Rather than teaching you how to add yet another popular technology, I wanted to convey the ability to decide where to control requests, where to place each state, and what to use to determine success.

This course does not cover

  • We won’t broadly cover coupon-adjacent domains like payments and shipping, or all distributed systems theory.

  • We focus on issuing a predetermined number of coupons, one coupon per person, a set start time, and ending when sold out.

Pre-Course Notes

Practice Environment

• We use Kotlin, Spring Boot, and Gradle.

• MySQL, Redis, and Kafka are run using Docker Compose.

• We use k6 for load testing.

• You can practice in a Windows, macOS, or Linux environment that can run Docker.

• We recommend at least 8GB of memory for a smooth hands-on experience.

Learning materials

• We provide the lecture slides and complete source code.

(The course is taught in Kotlin, but practice code is provided in both Kotlin and Java versions.)

• We provide execution environments and Docker Compose configurations for each part.

• There are k6 load-testing scenarios you can run repeatedly yourself.

• Review the design documents for each step along with the verification results before and after the changes.

Prerequisites and Important Notes

• You need a basic understanding of HTTP and REST APIs.

• We use relational databases and SQL at the level of SELECT and UPDATE statements.

• You should be familiar with Java or Kotlin syntax.

• Basic knowledge of Spring Boot is recommended.

• Experience with Redis and Kafka is not required.




Recommended for
these people

Who is this course right for?

  • Junior backend developer looking to gain hands-on experience

  • A backend job seeker who wants to learn concurrency control and handling high-volume traffic

  • A computer science major who wants to gain hands-on experience designing backend systems at a professional level

Need to know before starting?

  • Understanding of the basic syntax of backend programming languages (Java, Python, etc.)

  • Basic Database and SQL Knowledge

  • Basic Concepts of REST APIs and HTTP Communication

Hello
This is apiece

Inflearn Verified

Career Verified

1,770

Learners

62

Reviews

53

Answers

4.9

Rating

7

Courses

Hello, I’m Developer Hanjogak.
Having worked at Kakao and SK, I have designed and operated various backend systems in real-world service environments.

I share the problems and trial and error I encountered along the way, as well as the considerations involved in choosing technologies, through knowledge-sharing content.
From when and why to use a technology to the criteria for designing systems, I want to convey it all within a real-world context.

I hope the challenges and experiences I’ve faced help reduce your trial and error and
make better choices.

If there was anything you were curious about or found lacking while viewing the content, please feel free to let me know anytime.
I want to create better content based on your honest feedback.

Thank you.

apiece.dev.ai@gmail.com

More

Curriculum

All

59 lectures ∙ (10hr 17min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

All

22 reviews

4.9

22 reviews

  • lv032k34님의 프로필 이미지
    lv032k34

    Reviews 9

    ∙

    Average Rating 5.0

    Edited

    5

    100% enrolled

    [Overall Review] Rather than merely providing an overall introduction to the architecture, this course created problem scenarios and explained the What, Why, and How in depth. I was able to learn not only what to use, but also why it is needed and how to apply it. I mainly use Python, but I am also studying Kotlin and Spring separately, so I had no major difficulty following the course. I personally learned a great deal, and for that very reason, it was difficult to fully digest all the content in a single pass. It was a sufficiently in-depth course that I wanted to watch it at least twice and review the material. In terms of difficulty, it may be a little challenging for beginners, but it is a course worth taking despite that difficulty. [Points for Improvement] I practiced in a Windows environment, and some of the test scripts in the latter part of the course were difficult to run as-is in PowerShell, so I had to modify them and proceed in a different way. I was able to resolve the issues with the help of AI, but it took some time to adapt them to my environment. It would be very helpful if Windows-specific test scripts or execution instructions could be provided separately in the future. I tend to write the code myself in order to understand the logic as thoroughly as possible, so lectures longer than 30 minutes sometimes felt somewhat burdensome to study as a single lesson. Of course, I also understand the intention to explain a single topic without interrupting its flow. It was a great course.

    • apiece
      Instructor

      Hello AKBA, thank you for your thoughtful course review! I’m truly glad to hear that you found the course so in-depth that you wanted to review it multiple times. I also think that your effort to understand the logic by writing the code yourself aligned with my intentions in creating the course and was helpful to you. I’ll be sure to take your feedback on the difficulty level and the length of the lectures into account when preparing my next course. Regarding the difficulties you experienced with the Windows exercises, the recent test scripts were prepared to be compatible with Git Bash, but it seems the instructions were not clear enough. I’ll make improvements so that you can more easily find information on how to run them on Windows in the future. Thank you once again for your thoughtful review, and I’m grateful that you described it as a good course 😊

  • gylim78265525님의 프로필 이미지
    gylim78265525

    Reviews 21

    ∙

    Average Rating 5.0

    5

    31% enrolled

    I originally started learning Java but switched to Kotlin, learning by following along and writing the code. It’s not all that different, so I haven’t had much difficulty, and I’ve been able to establish a solid understanding of concurrency concepts, haha.

    • apiece
      Instructor

      Hello, Gapalja! I’m glad to hear that you were able to follow along without much difficulty despite transitioning from Java to Kotlin. Above all, I’m happy that the course helped you establish your understanding of one of the concepts necessary for server development: concurrency 🙂 I’ll continue doing my best to create courses that help with your learning. Thank you.

  • s1121238291님의 프로필 이미지
    s1121238291

    Reviews 100

    ∙

    Average Rating 4.9

    5

    100% enrolled

    I found the system architecture flow very helpful. Although the course is labeled as beginner-level, the infrastructure used does not seem to be at a beginner level. Personally, I prefer live coding over reviewing AI-generated code, so I liked that aspect. However, I am more familiar with Java, so the Kotlin syntax was unfamiliar to me. I also changed the package names as I pleased before starting the course, and since I ran K6 in a container from Windows Git Bash, the shell script tests actually made the learning process more difficult. Some people may find it convenient to copy and paste the shell script tests, but I personally did not like them. I found the flow of the K6 and shell script tests more difficult to follow than expected, and I feel that I may forget the test flow again when I look at it after some time has passed. Nevertheless, I think it is a good course that will be very helpful to learners from an architectural perspective and in terms of utilizing Redis.

    • apiece
      Instructor

      Hello, SPRING! Thank you for leaving such a detailed course review along with a great rating! We’re glad to hear that the course was helpful in understanding the flow of system architecture and how Redis is used, and that you also enjoyed the live-coding approach. At the same time, we understand that the infrastructure topics covered in the course may have felt more difficult than beginner-level material, and we’ll pay closer attention to the difficulty level and course structure going forward. We’ll also take note of your feedback that unfamiliar Kotlin syntax and shell script–based tests may have made the learning process more difficult. Nevertheless, thank you for completing the entire course and leaving such a high rating along with detailed feedback. Based on your comments, we’ll continue improving the course to make it even better. Thank you 🙇‍♂️

  • devdev123님의 프로필 이미지
    devdev123

    Reviews 1

    ∙

    Average Rating 5.0

    5

    100% enrolled

    [What was good] - Since the architecture is developed incrementally, it is easy to clearly understand what is improved at each stage and why - In particular, learning the criteria for deciding when and where to introduce Redis and Kafka was very helpful from a design perspective [What could be improved] - In a Windows environment, shell scripts have to be run through workarounds such as Git Bash, and even then, there are parts that get stuck along the way, requiring direct modifications to proceed [Difficulty] - Although it is labeled as beginner-level, it is actually closer to intermediate level. At the beginner level, it may be difficult to fully digest the explanations

    • apiece
      Instructor

      Hello, Developer! Thank you for carefully learning about the process of gradually evolving an architecture, as well as which tools to introduce, when, and why—and for leaving such a thoughtful course review! 😊 Regarding the use of shell scripts and the difficulty level in the Windows environment that you mentioned, we’ll make improvements so that students can follow along more easily. Thank you once again for your valuable feedback! 🙏

  • maruhxn님의 프로필 이미지
    maruhxn

    Reviews 13

    ∙

    Average Rating 5.0

    5

    61% enrolled

    I hadn't been able to organize the potential issues that occur with large-scale traffic in my head, but this single lecture makes me feel like all my fragmented knowledge is finally coming together. I am so grateful to be able to take a course like this.

    • apiece
      Instructor

      Hello, maruhxn. I am truly glad to hear that your fragmented knowledge has been connected into one, as it means the intention behind creating this lecture was well-conveyed. I hope it helped you establish a standard for looking at large-scale traffic issues. Thank you for leaving a review! 😊

Similar courses

Explore other courses in the same field!