Distributed Architecture Evolution and AI Cloud Practices at Large Internet Companies

    From distributed search to cloud-native infrastructure and large language models, this article examines the architectural decisions behind large-scale systems. It covers sharding, replication, deployment checks, training and inference bottlenecks, data governance, and cost control, with practical guidance on choosing the simplest architecture that meets workload requirements.

    1. Search Systems: The Starting Point for Distributed Architecture

    Early search systems faced a fundamental scaling problem: as data volumes grew, a single machine could no longer handle crawling, storage, and retrieval. Backlink analysis helped assess the relative importance of web pages, but it was only the beginning. As datasets expanded from terabytes to petabytes, systems had to partition data across multiple machines and maintain multiple replicas of each shard.

    The inverted index is a foundational structure in these systems. It maps each term to a list of documents containing that term. Queries intersect or combine these lists to return results in milliseconds.

    In practice, architects need to address three issues together.

    Data sharding. The shard count should leave room for growth. Moving large amounts of data simultaneously during rebalancing can significantly increase query latency, so migrations should be rate-limited and performed in batches.

    Replication and failover. When a primary replica fails, the system needs to elect a replacement within seconds. A prolonged failover can interrupt writes and cause read requests to time out.

    Cache consistency. There is a delay between index updates and cache refreshes. For fields such as product prices and inventory levels, teams should first define an acceptable staleness window. Fields that exceed that window should be read directly from the database.

    The same approach applies to enterprise knowledge bases, log search, and e-commerce product search. However, teams must be able to monitor shard hotspots and replication lag. Without these metrics, sharding and replication merely add operational complexity.

    2. Selecting and Validating Cloud-Native Infrastructure

    Cloud services are commonly grouped into three layers: infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). Enterprise development teams most often use five service categories: elastic compute, object storage, message queues, container platforms, and monitoring and alerting.

    Deployment options can be compared as follows:

    • Managed public cloud services: Fast to deploy and less demanding to operate. Evaluate cross-border data transfer requirements, vendor lock-in, and long-term costs.
    • Self-managed Kubernetes clusters: Provide greater control and suit organizations with dedicated platform teams. Upgrades, certificate rotation, and node maintenance require ongoing investment.
    • Hybrid deployments: Keep core data in a private environment while using the public cloud for elastic workloads. Dedicated network connectivity and unified identity management are the main challenges.

    Pre-Production Checklist

    1. Are core services deployed across at least two availability zones, and can traffic automatically fail over if one zone fails?
    2. Does every container have resource requests and limits to prevent a single instance from consuming an entire node’s resources?
    3. Do rolling updates use readiness probes so that new instances receive no traffic until they are ready?
    4. Does object storage have lifecycle rules that automatically move historical backups and cold data to lower-cost storage tiers?
    5. Does each critical endpoint have latency, error rate, and saturation monitoring, with defined alert thresholds?
    6. Are disaster recovery drills conducted quarterly, and are recovery time objectives (RTOs) and recovery point objectives (RPOs) supported by measured results?

    Cost control requires clearly defined metrics. Common measures include average CPU utilization, cost per request, and the proportion of idle resources. The total bill alone cannot show whether an optimization is effective.

    As a rule of thumb, sustained average cluster CPU utilization below 20% often suggests that resource requests are set too high and should be reassessed.

    3. Large Language Model Training and Inference: Different Bottlenecks

    AI is changing software development, customer support, and content generation. However, large language model training and inference have different infrastructure requirements. Treating them as the same workload leads to poor resource planning.

    Training: Communication and Fault Recovery

    Training involves large-scale synchronized computation. GPUs must exchange gradients frequently, making inter-node bandwidth and communication latency common bottlenecks.

    Remote direct memory access (RDMA) can reduce communication overhead, but switches, network adapters, and network topology must be designed together. Otherwise, the benefits are limited.

    Training jobs are sensitive to individual component failures. Checkpoint frequency must balance the likelihood of failure against the overhead of saving checkpoints.

    Inference: Latency, Throughput, and GPU Memory

    Online inference primarily focuses on time to first token, tokens generated per second, and concurrent request capacity.

    GPU memory capacity often becomes a constraint before compute capacity does. Model weights and the key-value (KV) cache can fill available memory, preventing further increases in concurrency.

    Batching improves throughput but adds waiting time for individual requests. Batch size should therefore be adjusted to the application’s latency requirements.

    Three Ways to Adopt AI

    • Public cloud model APIs: The fastest option for prototypes and general-purpose tasks. Risks include data leaving the enterprise environment, usage costs increasing with traffic, and output behavior changing after model updates.
    • Private deployment: Keeps data within the organization’s environment and offers the greatest control. Costs include GPU purchases, operational staffing, and the full expense of model updates.
    • Hybrid deployment: Uses private models for sensitive data and public APIs for general-purpose tasks. The gateway layer must implement data classification and request routing.

    Data Governance and Security Review

    Data governance is a prerequisite for model quality. Before fine-tuning, training data should undergo deduplication, sensitive-data removal or masking, and spot checks of annotation quality. Uncleaned data may cause a model to memorize sensitive information or reinforce incorrect patterns.

    AI-generated code must undergo static analysis and human review. Model-generated vulnerability findings are supporting signals, not a replacement for a security audit.

    4. Emerging Compute Environments: What Matters in Practice

    Large technology companies are exploring additional computing environments, including in-vehicle intelligence through partnerships with automotive companies and low-latency inference at the edge. Most of these directions remain at an early stage and offer limited immediate implementation value for most teams.

    The more practical implication for developers is that applications need to support different compute environments. Cloud data centers, edge nodes, and end-user devices differ substantially in computing capacity, network latency, and availability.

    Standardizing interfaces and model formats where possible makes it easier to move applications between environments.

    For example, in factory quality inspection, running image inference on a local edge node allows the production line to continue operating during a network outage. It also helps keep inference latency within the production cycle time.

    5. Common Mistakes and Risks

    1. Choosing a distributed architecture by default. Adding sharding to a problem that a single machine can solve only increases the failure surface and operational costs.
    2. Configuring high availability without testing failures. A multi-zone deployment that has never undergone a failover test may still experience prolonged timeouts during an actual outage.
    3. Treating large language models as a universal solution. Without an evaluation dataset and data governance, teams cannot determine whether model quality has declined after deployment.
    4. Ignoring cost ownership. If GPU and object storage costs are not allocated to teams, no one is accountable for wasted resources.

    6. Practical Implementation Priorities

    First, classify the workload. Determine whether it is read-heavy or compute-intensive, and whether it serves online requests or runs offline jobs.

    Second, choose the least complex architecture that meets the requirements. Every additional layer should deliver a measurable benefit.

    Third, establish evaluation datasets and cost dashboards. Use the resulting data to decide where to invest next.