0%
Reading0% completed
Nyxen Logo
Nyxen
Back to Dispatch
Messaging2026-06-26

How Modern Chat Apps Actually Work: WhatsApp, Telegram & NyChat Explained

12 min readBy Yash Shinde
MessagingWhatsAppTelegramNyChatWebSocketsEncryptionReal-time Communication

The Foundation: Client-Server Communication

Every modern chat application relies on a client-server model at its core. When you send a message, your device (the client) transmits data to a central server, which then routes that message to the intended recipient.

This sounds straightforward, but the engineering complexity behind making this feel instantaneous, reliable, and secure is substantial. Let us break down every layer of how modern chat apps actually function.

How Message Routing Works

When you tap "Send" on any messaging app, a chain of events fires within milliseconds:

  • Your client encrypts the message payload
  • The encrypted data is sent to a relay server over a persistent connection
  • The server identifies the recipient using internal routing tables
  • If the recipient is online, the server pushes the message immediately
  • If the recipient is offline, the server queues the message for later delivery
  • Once delivered, the server sends a delivery receipt back to the sender

This pipeline needs to handle millions of concurrent connections without dropping messages or introducing noticeable latency.

Real-Time Communication: WebSockets and Beyond

Traditional HTTP operates on a request-response model. The client asks for something, the server responds, and the connection closes. This pattern is fundamentally unsuitable for real-time messaging because it requires the client to constantly poll the server for new messages.

WebSockets

WebSockets solve this by establishing a persistent, bidirectional connection between client and server. Once the WebSocket handshake completes, both sides can push data at any time without the overhead of opening new connections.

Most modern chat applications use WebSockets or similar persistent connection protocols. The advantages are clear:

  • Near-instant message delivery
  • Reduced bandwidth compared to polling
  • Support for typing indicators and presence status in real time
  • Lower server load per active connection

Long Polling and Server-Sent Events

Some platforms use long polling as a fallback. The client opens a request to the server, and the server holds the connection open until it has new data to send. Once data is sent, the client immediately opens a new long-polling request.

Server-Sent Events (SSE) offer a one-directional persistent connection from server to client. This works well for notifications and read receipts but is not ideal for full duplex messaging.

Encryption Basics

End-to-End Encryption

End-to-end encryption (E2EE) ensures that only the sender and recipient can read a message. The server that relays the message cannot decrypt it. WhatsApp uses the Signal Protocol for E2EE across all personal chats and calls by default.

The simplified flow works like this:

  • Each user generates a public-private key pair
  • Public keys are exchanged during initial contact
  • The sender encrypts the message using the recipient's public key
  • Only the recipient's private key can decrypt it
  • The server never has access to the plaintext

Server-Side Encryption

Telegram uses a different model. Regular Telegram chats use client-server encryption, meaning messages are encrypted in transit and at rest on Telegram's servers, but Telegram holds the encryption keys. This enables features like cloud sync across devices.

Telegram offers "Secret Chats" which use E2EE, but this is opt-in and limited to single-device sessions.

Push Notifications

When your phone screen is off and the app is in the background, WebSocket connections may be terminated by the operating system to save battery. Push notifications bridge this gap.

  • On Android, apps use Firebase Cloud Messaging (FCM)
  • On iOS, apps use Apple Push Notification service (APNs)
  • The chat server sends a lightweight notification payload to FCM or APNs
  • The operating system wakes the device and displays the notification
  • When the user opens the app, the full message is fetched and decrypted locally

This is why you sometimes see "You have a new message" instead of the actual message content — the notification payload intentionally omits the decrypted text for security.

Media Uploads and Storage

Sending images, videos, and documents requires a separate pipeline from text messages. Here is the typical flow:

  • The client compresses and encrypts the media file
  • The encrypted file is uploaded to a CDN or object storage service
  • The server generates a download URL and attaches it to the message metadata
  • The recipient's client downloads and decrypts the media on demand

WhatsApp encrypts media with a random AES key and shares that key as part of the message payload. Telegram stores media on its cloud servers, allowing access from any device.

Multi-Device Syncing

Supporting the same account across phones, tablets, and desktops introduces significant complexity.

WhatsApp's Approach

WhatsApp originally required the phone to be online for the desktop client to function. Their multi-device architecture now uses a companion device protocol where each device has its own encryption keys, and messages are individually encrypted for each registered device.

Telegram's Approach

Telegram's cloud-based architecture makes multi-device sync straightforward. Since messages are stored on Telegram's servers (with server-side encryption for regular chats), any device can pull the full message history after authentication.

Group Chats

Group messaging multiplies the complexity of every system we have discussed. Each message must be encrypted and delivered to every group member. There are two main approaches:

  • Fan-out on send: The sender's client encrypts the message once per group member and sends individual encrypted copies. This is more secure but bandwidth-intensive.
  • Fan-out on receive: The sender encrypts once with a shared group key. The server distributes the single encrypted payload to all members. This is more efficient but requires secure group key management.

WhatsApp uses a Sender Key mechanism where each group member distributes a sender key to all other members. Messages are encrypted once with the sender key, and the server distributes them.

Presence and Typing Indicators

Online Status

Presence indicators show whether a contact is currently active in the app. This typically works by having the client send periodic heartbeat signals to the server. When the server stops receiving heartbeats, it marks the user as offline after a timeout period.

Typing Indicators

When you start typing, your client sends a lightweight signal to the server, which forwards it to the conversation partner. These signals are throttled to avoid flooding the connection — typically sent once when typing begins and reset after a brief pause.

Read Receipts

Read receipts track message state through multiple stages:

  • Sent: Message left the sender's device
  • Delivered: Message arrived on the recipient's device
  • Read: Recipient opened the conversation and the message was rendered on screen

Each state transition generates a small acknowledgment packet sent back through the same WebSocket connection.

Message Storage

Cloud Storage vs. Local Storage

Telegram stores all regular chat messages on its cloud servers indefinitely. This enables seamless device switching but means Telegram has access to encrypted message data.

WhatsApp stores messages locally on the device by default. Cloud backups to Google Drive or iCloud are optional and have historically not been end-to-end encrypted (though WhatsApp has since added encrypted backup options).

Temporary and Disappearing Messages

Both WhatsApp and Telegram offer disappearing messages with configurable timers. The implementation varies:

  • WhatsApp's disappearing messages are deleted from both devices after the set duration
  • Telegram's self-destructing messages in Secret Chats include a countdown timer visible to both parties

Comparing WhatsApp, Telegram, and NyChat

Each platform serves different needs and makes different engineering tradeoffs. Here is an honest comparison:

FeatureWhatsAppTelegramNyChat
Account RequiredYes (phone number)Yes (phone number)No
End-to-End EncryptionDefault (all chats)Opt-in (Secret Chats)Session-based
Multi-DeviceYes (companion)Yes (cloud sync)Single session
Message StorageLocal + optional backupCloud (indefinite)Ephemeral only
Group ChatsYes (up to 1,024)Yes (up to 200,000)Room-based
Media SharingFull (photos, video, docs)Full (up to 2GB files)Text-focused
Disappearing MessagesYes (configurable)Yes (Secret Chats)All messages ephemeral
User IdentityPhone numberPhone number + usernameAnonymous
Read ReceiptsYes (toggleable)Yes (in private chats)No
Typing IndicatorsYesYesMinimal

Where NyChat Fits

NyChat is not trying to replace WhatsApp or Telegram. Those platforms excel at persistent communication between identified users. They have massive infrastructure, years of refinement, and billions of users.

NyChat addresses a different need entirely: anonymous, ephemeral conversations with zero friction.

There is no phone number verification. No email signup. No account creation of any kind. You open NyChat, create a room, share the link, and start chatting. When the session ends, the conversation disappears.

NyChat's Design Goals

  • Anonymous conversations — No identity required from any participant
  • Ephemeral messaging — Messages exist only during the active session
  • Privacy-first experience — No data persists after the conversation ends
  • Zero signup friction — Instant access without any registration

This makes NyChat ideal for scenarios where persistent identity is unnecessary or undesirable: quick coordination, anonymous feedback, temporary team discussions, or simply talking to someone without leaving a digital trail.

What NyChat Does Not Claim

We want to be transparent about NyChat's positioning. We are not claiming stronger encryption than WhatsApp's Signal Protocol implementation. We are not claiming the feature depth of Telegram. NyChat is purpose-built for a specific use case — ephemeral, anonymous communication — and it does that one thing well.

The Engineering Challenge Ahead

Building messaging infrastructure is one of the most demanding engineering problems in consumer technology. It requires solving concurrency at scale, maintaining sub-second delivery latency, handling network partitions gracefully, and implementing cryptographic protocols correctly.

At Nyxen, we continue to refine NyChat's architecture while studying how the industry leaders have solved these problems. Every messaging platform makes tradeoffs. Understanding those tradeoffs helps us make better decisions for our users.

If you are interested in messaging technology and want to try a different approach to chat, NyChat is available now at nychat.app.

Share Article
YS
Yash Shinde

Founder, Nyxen

Yash is the founder of Nyxen. He leads product conception, design systems, and engineering architecture across our software portfolio.