كل الأمثلة

أمثلة

كيف يتعامل مختصِر الروابط مع مليار نقرة

رابط قصير يُحَل عبر واجهة API وقاعدة بيانات، ثم ذاكرة تخزين مؤقت للروابط الرائجة، وموازن حمل أمام واجهتَي API، ثم تتعطل إحداهما فتنتقل الحركة إلى الأخرى.

صُنع هذا الفيديو بمهارة تصميم الأنظمة.

  • 1:11
  • تصميم الأنظمة
  • بصوت Charon
  • الإنجليزية

صُنع من فكرة

How does a URL shortener handle a billion clicks? Show the read path, a cache, and scaling out.

التفريغ النصي للفيديو

A billion clicks a day: your short links must redirect without overwhelming storage.

Your browser calls an API. The API reads the destination from a database, then returns a redirect.

That averages over eleven thousand requests per second. Here, database lookups take eighty milliseconds. Storage becomes the bottleneck.

Add a cache for popular links. On a miss, read the database, then cache the destination.

Cache hits take two milliseconds here, skipping storage. Expire entries and invalidate changed links; cached destinations can become stale.

Add a load balancer, then another stateless API. Both share storage. Extra servers cost more.

What if one API fails? Health checks remove it; traffic moves to the survivor. Keep spare capacity.

Browsers request redirects. The balancer distributes clicks, APIs resolve links, the cache skips reads, and the database keeps mappings.

موضوعك، مرسومًا في دقيقة تقريبًا.

أول 2 من فيديوهاتك مجانًا، مدة كلٍّ منها حتى دقيقة واحدة، مع علامة مائية. لا حاجة إلى بطاقة دفع. المنتج كاملًا، بكل الأصوات والأساليب.