Todos os exemplos

Exemplos

Como um encurtador de URL aguenta um bilhão de cliques

Um link curto resolvido por uma API e um banco de dados, depois um cache para os links populares, um balanceador de carga sobre duas APIs e uma API que cai enquanto o tráfego passa para a outra.

Este vídeo foi feito com a habilidade Design de sistemas.

  • 1:11
  • Design de sistemas
  • Narrado por Charon
  • Inglês

Feito a partir de um prompt

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

Transcrição do vídeo

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.

Seu tema, desenhado em cerca de um minuto.

Seus primeiros 2 vídeos são grátis, de até 1 minuto cada, com marca d’água. Não precisa de cartão. Produto completo, com todas as vozes e estilos incluídos.