Fundamentals 16 min read

How a Mobile App’s Search Request Travels: DNS, CDN, HTTP, TCP & Load Balancing

This article explains how a mobile app’s search query travels across the internet, detailing the roles of DNS resolution, CDN caching, HTTP communication, TCP connections, and load‑balancing mechanisms, and shows how each layer contributes to delivering results to the user.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How a Mobile App’s Search Request Travels: DNS, CDN, HTTP, TCP & Load Balancing

Modern consumer applications are essentially internet applications: whether accessed via a browser or a mobile app, the core request is sent over the internet to a backend data center, which may be a self‑built large‑scale facility like WeChat’s or a virtual host provided by a cloud provider such as Alibaba Cloud.

Regardless of the data center’s size, the app must interact with it at runtime. For example, typing the character "a" into Taobao’s search box triggers a cascade of network operations that deliver relevant product results back to the phone.

DNS

Internet communication begins with the IP protocol, whose most critical component is the IP address that uniquely identifies each device. An app must know the IP address of the server handling its requests.

Rather than hard‑coding IPs, apps rely on DNS (Domain Name System) to resolve domain names like xxx.taobao.com into IP addresses, enabling dynamic and flexible connectivity.

CDN

DNS may resolve a domain to a CDN (Content Delivery Network) server rather than directly to the data center. CDNs cache static resources (images, files) at edge locations near users, reducing latency and offloading traffic from the origin data center.

Static resource URLs often use subdomains like image.taobao.com, which resolve to CDN IPs. If the CDN has the requested file, it returns it immediately; otherwise, it forwards the request to the data center, caches the result, and then serves the user.

HTTP

All requests, whether to a CDN or a data center, use the HTTP protocol at the application layer. HTTP defines how data is encoded, what methods (GET, POST, etc.) are used, and which headers convey metadata such as caching directives, cookies, and content length.

HTTP works over TCP, the transport‑layer protocol that provides reliable, ordered delivery of byte streams.

Typical HTTP request headers include the method (GET, POST, etc.) and parameters like Cache-Control, Expires, and Cookie. GET requests contain only headers, while POST requests also carry a body whose length is indicated by the Content-Length header.

HTTP responses include status codes: 2XX for success, 3XX for redirection (e.g., 302), 4XX for client errors (e.g., 403, 404), and 5XX for server errors (e.g., 500, 502, 503). The response body is typically HTML for browsers or JSON for mobile apps.

TCP

Applications use the operating system’s socket interface, which encapsulates TCP. TCP, together with IP, forms the TCP/IP protocol stack, the foundation of internet communication.

The OSI model defines seven layers; TCP/IP merges the top three (application, presentation, session) into a single application layer where HTTP resides.

Physical layer transmits raw bits over media such as fiber, copper, or wireless. Data link layer packages bits into frames, adds MAC addresses, and handles error checking and flow control.

The network layer (IP) routes packets based on IP addresses, while the transport layer (TCP) ensures reliable delivery via a three‑way handshake (SYN, SYN‑ACK, ACK) and adds port numbers to direct traffic to the correct process.

During a POST request, the client sends a JSON payload (e.g., {"key":"a"}) that traverses each protocol layer, each adding its own header, until it reaches the server’s HTTP handler, which finally delivers the payload to the application logic.

Load Balancing (LB)

When a request reaches the data center, it first hits a load‑balancing layer that distributes traffic across a large cluster of search servers, ensuring high availability and performance.

Taobao typically uses Linux kernel‑level layer‑2 load balancing, which rewrites the destination MAC address in the Ethernet frame to point to a specific backend server, then forwards the frame within the local network. The backend server processes the request and sends the response directly back to the client, bypassing the load balancer.

Summary

The journey of a simple search character "a" involves DNS resolution, possible CDN caching, HTTP over TCP, load balancing, and finally processing by the search engine cluster, which may consult distributed caches or larger search back‑ends via RPC calls.

Understanding each network layer helps developers diagnose and resolve performance or reliability issues in large‑scale internet applications.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TCPCDNmobile appHTTPNetworkingDNSInternet Protocols
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.