Todos los ejemplos

Ejemplos

Cómo una app de chat entrega un mensaje en tiempo real

El upgrade a WebSocket mensaje a mensaje, un mensaje reenviado en cuanto llega y dos servidores de chat unidos por un broker de mensajes, para que los amigos conectados a servidores distintos sigan chateando en directo.

Este video se hizo con la habilidad Diseño de sistemas.

  • 1:11
  • Diseño de sistemas
  • Narrado por Orus
  • Inglés

Hecho a partir de un prompt

How does a chat app deliver a message in real time? Show the WebSocket connection step by step.

Transcripción del video

One message must reach your friend without either of you refreshing.

Your app contacts the server, requesting a WebSocket upgrade over HTTP one point one. Success returns status one hundred one.

WebSocket stays open, so either side can send immediately. Your friend's app establishes its own WebSocket connection.

You send a message, and the server forwards it immediately. Your friend's acknowledgement confirms delivery, not reading.

Your app and your friend's app share one server. In this example, a thousand messages per second makes it ninety-five percent busy.

Your friend reconnects to another server; a message broker now routes messages between their separate connections.

Why add a broker? It crosses server boundaries, but costs another network hop and operational complexity.

Apps keep WebSockets open, servers manage connections, and the broker routes live messages. Chat and multiplayer updates use this pattern.

Tu tema, dibujado en un minuto, más o menos.

Tus primeros 2 videos son gratis, de hasta 1 minuto cada uno, con marca de agua. No necesitas tarjeta. Producto completo, con todas las voces y estilos incluidos.