쉐도잉 연습: How Does a URL Shortener Work? - 영상으로 영어 말하기 배우기
레슨 만드는 중...
1
Everyone wonder what happens when you click a tiny URL?
2
You know, those short links like bit.ly and tinyurl, they somehow know exactly where to take you.
3
Today, we're going to reverse engineer how URL shorteners actually work.
4
And trust me, there's way more going on behind the scenes than you might think.
5
So what exactly does a URL shortener do?
6
Simple, it takes a massive URL like this Amazon link that goes on forever and turns it into something short and clean.
7
Click the short version and boom, you end up at the same place.
8
But here's where it gets interesting.
9
Let's say you're building the next bit.ly.
10
How many URLs do you think you need to handle?
11
Try 100 million new URLs every day.
12
That's over a thousand new short links created every single second.
13
And since people click links way more than they create them, you're looking at over 10,000 clicks per second.
14
Now think about storage.
15
Over 10 years, that's 365 billion URLs you need to keep track of.
16
Just storing the URLs themselves would take 36 terabytes.
17
So the real question becomes, how do you even generate these short URLs?
18
This is where the math gets fun.
19
Short URLs can use numbers and letters.
20
That's 62 possible characters, 0 through 9, lowercase A through Z, and uppercase A through Z.
21
But how short can we make them?
22
Let's work backwards.
23
We need 365 billion unique combinations.
24
With one character, you get 62 possibilities.
25
With two characters, 62 squared.
26
That's about 3000.
27
With three characters, 62 cubed. About 238,000.
28
Keep going you get to 7 characters, 62 to the 7th power.
29
That's 3.5 trillion possible combinations, way more than we need.
30
So 7 characters it is, but how do we actually create them?
31
There are two approaches, and they couldn't be more different.
32
The first approach, just hash the long URL.
33
Take any hash function like md5, run the long URL through it, and you get back a long string of random characters.
34
The problem?
35
That string is way too long.
36
Even the shortest hash gives you 32 characters when you only want 7.
37
So you take the first 7 characters and call it a day.
38
But wait, what happens when two different URLs give you the same first 7 characters?
39
You've got a collision.
40
Now you're stuck.
41
You have to try again with some variation of the original URL until you find 7 characters that nobody else is using.
42
Every time you want to create a short URL, you have to check if those 7 characters are already taken.
43
That's a lot of database lookups.
44
The second approach is way more elegant.
45
Instead of hashing, you just count.
46
Every time someone wants to shorten a URL, give you the next number in sequence.
47
URL number 1, number 2, number 3, and so on.
48
Then convert that number to what's called base 62.
49
Here's how that works.
50
Let's say you're on URL number 11157.
51
To convert to base 62, you divide by 62 over and over, keeping track of the remainders.
52
11157 divided by 62 is 179, remainder 59.
53
179 divided by 62 is 2, remainder 55.
54
2 divided by 62 is 0, remainder 2.
55
Now read the remainders backwards.
56
2, 55, 59.
57
In base 62, 2 stays as 2.
58
55 becomes T.
59
59 becomes X.
60
So URL number 11157 becomes 2TX.
61
Your short URL is tinyurl.com slash 2tx.
62
No collisions, no database lookups to check if it's taken, just clean math.
63
To trade off, you need a way to generate unique numbers across multiple servers.
64
That's its own engineering challenge.
65
And there's a security issue.
66
If someone figures out your pattern, they can guess the next short URL.
67
But for most cases, this approach is much cleaner.
68
Now, generating the short URL is just half of the problem.
69
The other half is what happens when someone clicks it.
70
When you click a short URL, the system needs to look up the original URL and redirect you there.
71
And this happens a lot more often than creating new short URLs.
72
So speed matters.
73
First, check the cache.
74
If the mapping is there, redirect immediately.
75
If not, hit the database, cache the result for next time, then redirect.
76
The redirect itself uses what's called a 301 status code.
77
That tells your browser this URL has permanently moved to the other location.
78
Your browser remembers this, so it might skip the URL shortener entirely next time.
79
But here's what makes this really interesting a scale.
80
A single database can handle 10,000 lookups per second, so you need multiple database replicas to spread the load.
81
Eventually, you will need to split the data across multiple databases entirely.
82
This is called sharding, and it's another whole engineering problem.
83
You need to figure out how to distribute the data evenly, how to route requests to the right database, what happens when one database goes down, how to rebalance when you add more servers.
84
And that's just the beginning.
85
In the real world, you also need to think about rate limiting so people can't spam your service.
86
You need analytics to track how many people click each link.
87
You need security to block malicious URLs.
88
What started as make this URL shorter becomes a lesson in distributed systems, caching, database scaling, and performance optimization.
89
Every major tech company has built some version of this.
90
Twitter shortens URL in tweets.
91
Slack does it in messages.
92
Even your company's internal tools probably do this.
93
And the techniques we talk about, unique ID generation, caching strategies, database sharding, these patterns show up everywhere.
94
Instagram uses similar ID generation for photos.
95
Netflix uses similar caching for video metadata.
96
Uber uses similar database splitting for trip data.
97
The next time you click a shortened link, you will know there's a host system working in milliseconds to get you where you're going.
98
And you will start recognizing these same patterns in every app you use.
99
Ready to ace your next technical interview?
100
Join our community where we offer comprehensive courses on system design, coding, behavioral questions, machine learning, and object-oriented design.
101
Learn more at bytebytego.com.
📺 같은 채널
✨ 추천 영상
이 레슨의 어휘와 말하기 포인트
이 영상에는 섀도잉할 문장 100개와 단어 978개가 있습니다. 말하는 구간의 길이는 6:41입니다. 화자는 분당 약 146단어의 일정한 속도로 말해서 섀도잉하기에 편한 속도입니다. 영어에서 가장 많이 쓰이는 3,000단어에 속하는 단어가 81%뿐이라 어휘가 어려운 편입니다.
이 영상의 핵심 어휘
영상에 나오는 익혀 둘 만한 단어 15개를 발음, 뜻과 함께 정리했습니다.
| 단어 | 발음 | 뜻 |
|---|---|---|
| database 명사 | /ˈdeɪtəˌbeɪs/ | 데이터베이스 |
| remainder 명사 | /ɹəˈmeɪndɚ/ | 나머지 |
| cache 명사 | /kæʃ/ | 캐시 |
| divide 동사 | /dɪˈvaɪd/ | 나누다, 가르다 |
| hash 명사 | /ˈhæʃ/ | 해시 |
| server 명사 | /ˈsɝvɚ/ | 서버, 봉사기 |
| string 명사 | /stɹɪŋ/ | 끈 |
| mathematics 명사 | /mæθ(.ə)ˈmæt.ɪks/ | 수학 |
| collision 명사 | /kəˈlɪʒn̩/ | 충돌 |
| lesson 명사 | /ˈlɛs.ən/ | 수업, 과 |
| technique 명사 | /tɛkˈniːk/ | 기술 |
| comprehensive 형용사 | /ˌkɑm.pɹəˈhɛn.sɪv/ | 포괄적인 |
| sequence 명사 | /ˈsiː.kwəns/ | 순서 |
| tweet 명사 | /ˈtwiːt/ | 트윗, 트위트 |
| variation 명사 | /ˌvɛəɹiˈeɪʃn̩/ | 변화 |
영상에 나오는 구동사
| 단어 | 뜻 |
|---|---|
| go down 동사 | 내려가다 |
주의할 발음
화자는 you're, can't, couldn't 같은 축약형과 약화된 형태를 9번 사용합니다. 들리는 대로 짧게 발음하세요.
- “sh”와 “zh” 소리: cache /kæʃ/, hash /ˈhæʃ/, collision /kəˈlɪʒn̩/, combinations /kɑmbɪˈneɪʃənz/, variation /ˌvɛəɹiˈeɪʃn̩/
- 긴 단어 — 강세 위치에 주의: mathematics /mæθ(.ə)ˈmæt.ɪks/, combinations /kɑmbɪˈneɪʃənz/, comprehensive /ˌkɑm.pɹəˈhɛn.sɪv/, permanently /ˈpɜː.mə.nənt.li/, behavioral /bɪˈheɪvjəɹəl/
이 영상으로 연습하는 방법
- 먼저 말하지 않고 영상을 끝까지 듣고 모르는 단어를 적어 둡니다.
- 보통 속도로 한 문장씩 섀도잉하고, 화자의 리듬과 맞을 때까지 반복합니다.
- 자신의 목소리를 녹음해 원본과 비교하고, database, remainder, cache 같은 단어에 특히 주의합니다.
쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법
쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.


























