쉐도잉 연습: System Design: How to Build an API Rate Limiter - 영상으로 영어 말하기 배우기

레슨 만드는 중...
1
Let's design an API rate limiter for an application that takes thousands of requests per second.
2
User journey is simple.
3
User can make API calls to your server to do something.
4
Each user is allowed to make 100 API calls per minute.
5
If a user makes more than 100 calls per minute, then your server will not process those API calls.
6
Most engineers approach this problem with a counter.
7
For each user, you store user ID, count of API calls, and current minute.
8
Every time a request is made by user, you increase this count, and you will reject the requests once it passes 100 requests.
9
This implementation is good enough for internal API calls, but let's take two specific examples why this solution is not good.
10
Let's say user Alan is a burst user, and makes 100 API calls in first two seconds.
11
Then he will get rejected for the next 58 seconds.
12
Alan will be able to make calls when next minute starts.
13
And our second user, John, sends 100 API requests, but these requests are sent at the last second of the current minute.
14
The next second clock will reset to new minute, and John can send another 100 requests.
15
Basically, John sent 200 requests in 2 seconds, because according to Counter, these 100 requests belong to different minutes.
16
Basically, users will experience different behavior of APIs based on when they make the API call.
17
There is a fundamental issue with the approach we just discussed.
18
The Counter is watching the clock instead of watching the user.
19
Let's see a better approach.
20
So, we will give every user a bucket that holds 100 tokens.
21
Every API request from user takes one token out, and we will keep filling the bucket at a rate of 100 tokens per minute, which is approximately 1.67 tokens per second.
22
For simplification, let's assume we will fill two tokens per second.
23
If user doesn't make any API call, the bucket will remain at 100, and we don't need to fill.
24
If the bucket is empty, we will reject the request.
25
This token bucket approach is what Stripe, GitHub, and most API gateways actually use for tracking API calls.
26
Now let's take a look at Alan and John's requests again, and see how this bucket system will work.
27
Alan drains all 100 tokens in 2 seconds.
28
Then Alan has to slow down.
29
Bucket fills about 2 tokens per second.
30
That's why he can now make 2 calls per second.
31
John, who is making 100 API calls at the end of the minute, will also need to wait for Bucket to fill, because once he makes 100 requests in a second, Bucket will get empty.
32
So he can also make about 2 per second, as Bucket fills with time.
33
Next question is, how do we store these buckets?
34
We just need to store the token count, and the time of the last refill, so that you can add tokens per second.
35
But what if your app works at large scale, and you have 20 different servers accepting API calls.
36
Two requests for the same user can land on two servers in the same millisecond.
37
Therefore, you keep the bucket outside the servers, in one common shared storage.
38
This storage needs to be fast, and that's why we usually use Redis.
39
When any of these 20 servers processes any API call, we change the count at this common Redis.
40
To make this crystal clear in your mind, you need to remember that request limit is not just one number.
41
It's two numbers.
42
First, how much a user can burst in one go, and second, how fast they can go after the burst.

이 레슨의 어휘와 말하기 포인트

이 C1 수준 말하기 레슨은 영상 “System Design: How to Build an API Rate Limiter”을(를) 바탕으로 합니다. 가장 자주 반복되는 단어는 다음과 같습니다: Api, user, request, bucket, token. 이 영상에는 섀도잉할 문장 42개와 단어 594개가 있습니다. 말하는 구간의 길이는 2:47입니다. 화자는 분당 약 213단어로 빠르게 말하므로 연음과 약하게 발음되는 소리가 많습니다. 단어의 82%가 영어에서 가장 많이 쓰이는 3,000단어에 속합니다. 나머지는 연습 전에 미리 확인해 두세요.

이 영상의 핵심 어휘

영상에서 가장 어려운 단어 11개를 발음, 뜻과 함께 정리했습니다.

단어발음뜻
bucket 명사/ˈbʌkɪt/양동이
token 명사/ˈtoʊkən/토큰
server 명사/ˈsɝvɚ/서버, 봉사기
burst 동사/bɜːst/파열하다
crystal 명사/ˈkɹɪstəl/결정
belong 동사/bɪˈlɒŋ/속하다
fundamental 형용사/ˌfʌn.dəˈmɛn.təl/기본적
implementation 명사/ˌɪmplɪmənˈteɪʃən/이행
drain 명사/dɹiːn/배수구
millisecond 명사/ˈmɪlɪˌsɛkənd/밀리초, 밀리세컨드
refill 명사/ˈɹiː.fɪl/리필

이 영상의 문법

화자가 가장 많이 쓰는 문형을 영상 속 실제 표현과 함께 정리했습니다.

문형영상 속 표현
조건문 if + 절, will/would + 동사 — 조건과 그 결과If the bucket is empty, we will reject
수동태 be + 과거분사 — 누가 하는지보다 무슨 일이 일어나는지에 초점is allowed · is made · are sent

주의할 발음

  • “sh”와 “zh” 소리: implementation /ˌɪmplɪmənˈteɪʃən/, simplification /ˌsɪm.plɪ.fɪˈkeɪ.ʃən/
  • 긴 단어 — 강세 위치에 주의: fundamental /ˌfʌn.dəˈmɛn.təl/, implementation /ˌɪmplɪmənˈteɪʃən/, millisecond /ˈmɪlɪˌsɛkənd/, simplification /ˌsɪm.plɪ.fɪˈkeɪ.ʃən/

한국어 화자가 어려워하는 소리:

  • /f/ — ㅍ(/p/)으로 바꾸지 말고 윗니를 아랫입술에 대기: fundamental /ˌfʌn.dəˈmɛn.təl/, refill /ˈɹiː.fɪl/, simplification /ˌsɪm.plɪ.fɪˈkeɪ.ʃən/
  • /r/과 /l/ 구별하기: crystal /ˈkɹɪstəl/, refill /ˈɹiː.fɪl/

이 영상으로 연습하는 방법

  1. 먼저 말하지 않고 영상을 끝까지 듣고 모르는 단어를 적어 둡니다.
  2. 0.75배속으로 한 문장씩 섀도잉을 시작하고, 익숙해지면 보통 속도로 돌아갑니다.
  3. 자신의 목소리를 녹음해 원본과 비교하고, bucket, token, server 같은 단어에 특히 주의합니다.

쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법

쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.

섀도잉 방법: 단계별 전체 가이드 읽기 →