Cloud Load Balancing in Google Cloud
A friendly, step-by-step guide to the managed traffic director that spreads user requests across many servers, keeps applications running when machines fail, and lets one single IP address serve the whole planet.
Picture the entrance of a huge stadium on match day. Fifty thousand fans arrive at the same time. If every fan queued at one single gate, the entrance would collapse. Smart stadiums open many gates, place guides at the front, and close any gate that is blocked, so that everyone gets in quickly and safely. A load balancer plays the role of those guides, but for websites, apps and online services.
In this guide we start from nothing. We explain why one server is never enough, what a load balancer actually does, and how Google Cloud built a version that is not a box or a virtual machine but a distributed service running at the edge of Google’s worldwide network. Every new word is explained the first time it appears, with everyday comparisons and real company stories along the way.
WWhat Is Cloud Load Balancing?
A first, simple picture of the service before we open the hood.
A server is a computer that answers requests from other computers. When you open a shopping website, your phone sends a request, and a server sends back the page. A load balancer is a service that sits in front of many servers and decides which server should handle each incoming request. It also watches the servers, and if one stops working, it quietly stops sending visitors there.
Cloud Load Balancing is Google Cloud’s fully managed family of load balancers. “Managed” means Google runs, scales, patches and repairs the machinery. You do not create load balancer virtual machines, you do not guess how big they should be, and you do not warm them up before a big sale. You describe what you want, such as “send web traffic for this domain to these servers,” and Google’s infrastructure does the rest.
Think of an airport with many check-in counters. A friendly staff member at the entrance looks at the queues and says, “Counter seven is free, please go there.” If counter three has a broken computer, the staff member stops sending passengers to it. Cloud Load Balancing is that staff member, except it stands at every entrance of the airport at once and never gets tired.
A short history
Google has been balancing traffic for its own products, such as Search, Gmail and YouTube, since the early days of the company. Over the years its engineers built special software for this job. Two famous pieces are the Google Front End servers that meet users at the edge of the network, and Maglev, a software system that spreads raw network traffic across many machines at very high speed. Google published research about Maglev in 2016.
When Google Cloud arrived, Google chose to offer the same style of load balancing to customers rather than selling boxes. Early on, a famous demonstration showed a Google Cloud load balancer going from nothing to over a million requests per second without any warm-up. Since then, the family has grown to include many types for web traffic, general network traffic, internal traffic and global traffic.
“Cloud Load Balancing” is not one product but a family. Choosing the right member is the first big decision, and this guide teaches you how to make it.
TThe Problem Load Balancers Solve
To appreciate the solution, first feel the pain of the problem.
Step 1: One server, many visitors
A new website often starts on a single server. That works for a few visitors. As the site becomes popular, the server gets busier, answers slow down, and eventually it runs out of memory or processing power and stops responding. You could buy a bigger server, which is called vertical scaling, but there is always a limit, and a bigger server is still a single point of failure.
Step 2: Many servers, but who gets the visitor?
The better idea is horizontal scaling: run many ordinary servers and share the work. That raises a new question. If you have ten servers, which one should answer the next visitor? You cannot tell visitors to pick one themselves. You need a single front door that all visitors use, and a smart helper behind it that picks a server for each request. That helper is the load balancer.
A restaurant with one chef can serve a few tables. A restaurant with ten chefs needs a head waiter who takes each order and hands it to a chef who is free. Customers talk only to the head waiter, never to the kitchen, and if one chef goes home sick, nobody notices.
What a good load balancer must do
Spread the work
Avoid one server being overloaded while others sit idle, so all visitors get quick answers.
Survive failures
Detect broken servers and stop using them without any visitor seeing an error.
Allow growth
Let you add or remove servers at any time, even automatically, without changing the public address.
Reduce delay
Send each visitor to a nearby healthy server so that pages load fast.
Protect
Hide the real servers, stop bad traffic early and handle encryption in one place.
Update safely
Allow new software versions to be tried on a small share of visitors before everyone gets them.
Traditional load balancers and their pain
Before cloud services, companies bought hardware boxes from vendors and placed them in racks. These boxes were expensive, had a fixed capacity, and needed experts to configure. If traffic doubled on a holiday, you needed a bigger box in advance. Later, software load balancers running on virtual machines became common, but you still had to size them, patch them, and run at least two for safety. The load balancer itself could become the bottleneck or the single point of failure it was meant to remove.
A load balancer that runs on one machine is only as reliable as that machine. Google Cloud’s design solves this by making the load balancer a distributed service with no single machine to fail.
CCore Concepts You Must Know
A small vocabulary that makes everything else easy.
Layers: the idea of Layer 4 and Layer 7
Network communication is described in layers, like the floors of a building. Two floors matter for load balancing. Layer 4 is the transport floor, where connections such as TCP and UDP live. A Layer 4 balancer sees only addresses and port numbers, like a postal worker who reads the address on an envelope but never opens it. Layer 7 is the application floor, where web requests live. A Layer 7 balancer reads the contents, such as the web address, the headers and the cookies, like a receptionist who opens the letter and routes it to the right department.
| Question | Layer 4 (network) | Layer 7 (application) |
|---|---|---|
| What does it see? | IP addresses, ports, protocol | URLs, headers, cookies, methods |
| Speed and simplicity | Very fast, simple rules | Slightly more work, far smarter rules |
| Typical traffic | Databases, games, mail, custom protocols | Websites, APIs, gRPC, WebSockets |
| Example decision | Send port 443 traffic to pool A | Send “/images” to storage and “/api” to app servers |
The key vocabulary
Frontend
The public or private IP address and port that clients connect to. In Google Cloud it is defined by a forwarding rule.
Backend
The servers or services that do the real work, such as virtual machines, containers or serverless apps.
Health check
A small test sent regularly to each backend to learn whether it can accept traffic.
URL map
The routing table of a web load balancer, choosing a backend by hostname and path.
Target proxy
The component that ends the client connection, handles encryption and applies the routing rules.
Session affinity
A setting that sends the same visitor to the same backend again when that matters.
Connection draining
A grace period that lets in-progress requests finish before a backend is removed.
Scope
Whether a balancer works across the whole world (global) or inside one region (regional).
Proxy versus passthrough
Load balancers handle connections in two styles. A proxy balancer ends the client’s connection and opens a fresh one to the backend, so it sits in the middle of the conversation, like an interpreter. A passthrough balancer does not end the connection; it simply forwards packets to a backend, which talks to the client directly, like a switchboard operator who connects your call and then steps aside. Proxy balancers can read and change traffic and offer many features. Passthrough balancers are faster, keep the client’s original address, and support any protocol over the covered protocol families.
Almost every choice in Cloud Load Balancing comes back to four questions: Is the traffic web or not? Is it from the internet or inside my network? Does it need to be global or regional? Do I need a proxy or a passthrough?
AArchitecture and Components
The chain of building blocks you will configure, from public address to servers.
One surprise for newcomers is that a Google Cloud load balancer is not a single object you create with one click and one name. It is a chain of small parts, each with one job, linked together. This design lets you reuse parts and gives fine control, much like building with labelled train carriages rather than buying a pre-welded train.
flowchart LR
FR["Forwarding Rule: IP address and port"] --> TP["Target HTTPS Proxy: certificate and SSL policy"]
TP --> UM["URL Map: host and path routing"]
UM --> BS1["Backend Service: web"]
UM --> BS2["Backend Service: api"]
UM --> BB["Backend Bucket: static files"]
BS1 --> B1["Managed Instance Group"]
BS2 --> B2["Network Endpoint Group"]
HC["Health Check"] -.-> BS1
HC -.-> BS2
Walking the chain
Forwarding rule
The front door. It owns the IP address and port, such as port 443, and points incoming traffic at a target proxy or, for passthrough types, directly at a backend service.
Target proxy
Ends the client connection. For HTTPS it holds the certificate, applies the SSL policy that chooses allowed encryption versions, and passes the request on.
URL map
Reads the hostname and path and picks a backend service or backend bucket. It can also redirect, rewrite and split traffic.
Backend service
Defines how to talk to a group of backends: protocol, health check, balancing mode, session affinity, timeouts and security attachments.
Backends
The real workers: instance groups, network endpoint groups, serverless endpoints or even a storage bucket for static files.
Health check
Runs beside the chain and tells the load balancer which backends are allowed to receive traffic.
Optional add-ons that attach to the chain
- Cloud CDN caches popular content at the edge so that many requests never reach your servers.
- Cloud Armor adds a web application firewall and denial-of-service defence.
- Identity-Aware Proxy demands sign-in before a user can reach an internal application.
- Certificate Manager stores and renews TLS certificates for many domains.
- Firewall rules in your VPC network decide which traffic may reach each backend machine.
The Google Cloud console offers a wizard that builds the whole chain for you. Even so, learn the parts, because every error message and every monitoring chart refers to them.
TThe Family Tree: Types of Load Balancers
Google groups its load balancers into three main families, each with external and internal members.
Family one: Application Load Balancers
These are Layer 7 proxy balancers for HTTP, HTTPS and HTTP/2 traffic, including gRPC and WebSockets. They understand web requests and offer routing by hostname and path, caching, and security add-ons. They come in global external, regional external, regional internal and cross-region internal flavours, plus an older “classic” external flavour that remains for existing setups.
Family two: Proxy Network Load Balancers
These are Layer 4 proxy balancers for TCP traffic, with or without TLS. They end the client connection like Application balancers but do not read web content. They suit non-web protocols that still benefit from global reach or TLS termination, such as certain game or messaging services.
Family three: Passthrough Network Load Balancers
These are Layer 4 passthrough balancers for TCP, UDP and other protocols. They never end the connection. They preserve the real client address and let backends answer the client directly. They are regional and come in external and internal forms.
| Family | Layer | Style | Scope | Typical use |
|---|---|---|---|---|
| Application Load Balancer (external) | 7 | Proxy | Global or regional | Public websites, APIs, mobile back ends |
| Application Load Balancer (internal) | 7 | Proxy | Regional or cross-region | Private microservices, internal tools |
| Proxy Network Load Balancer | 4 | Proxy | Global, regional or internal | TCP services needing TLS offload or global reach |
| Passthrough Network Load Balancer (external) | 4 | Passthrough | Regional | UDP, mail, VoIP, games, custom protocols |
| Passthrough Network Load Balancer (internal) | 4 | Passthrough | Regional | Private databases, appliances, internal TCP and UDP |
Think of three kinds of reception desks. The Application desk opens every letter and delivers it to the exact department. The Proxy Network desk takes parcels, rewraps them and sends them on without reading the contents. The Passthrough desk points you to the right door and lets you walk there yourself, which is quickest and keeps your name on the visitor badge.
Google has renamed these products several times, and older articles use names such as HTTP(S) Load Balancing, SSL Proxy and TCP Proxy. The ideas stay the same. Always match the current names in the official documentation before building.
HHow the Global External Application Load Balancer Works Internally
The flagship design: one address, edge servers everywhere, and Google’s private network in between.
One address for the whole world: anycast
Normally an IP address belongs to one place. With anycast, the same IP address is announced from many Google locations around the world at once. Internet routing then delivers each user’s traffic to the closest location that announces it. A visitor in Mumbai, another in London and a third in Sao Paulo all type the same address, yet each lands at a different nearby Google edge site.
Imagine a pizza chain with one phone number. When you call, the phone system connects you to the nearest branch automatically. You never need to know the branch numbers, and if one branch closes, calls simply flow to the next nearest one.
Google Front Ends at the edge
At each edge site, powerful servers called Google Front Ends, or GFEs, accept the user’s connection. They finish the TCP and TLS handshake right there, close to the user. A handshake needs several back-and-forth messages, and doing them over a short distance makes the first page load much faster than doing them across an ocean. After that, the GFE forwards the request over Google’s private backbone network toward the chosen backend region, instead of sending it across the unpredictable public internet.
flowchart TD
U1["User in Mumbai"] --> IP["One anycast IP address"]
U2["User in London"] --> IP
U3["User in Sao Paulo"] --> IP
IP --> E1["Nearest Google edge: Google Front End"]
E1 --> BB["Google private backbone network"]
BB --> R1["Backends in asia-south1"]
BB --> R2["Backends in europe-west1"]
BB --> R3["Backends in us-east1"]
Choosing the region and the server
Inside the load balancer, a two-step choice happens. First, which region? By default the balancer prefers the region closest to the user that still has healthy capacity. If that region is full or unhealthy, traffic spills over to the next closest. Second, which backend in that region? Here the balancer follows the balancing mode and algorithm you configured, for example “send to the backend with the fewest active requests.”
Why there is no machine to break
The global load balancer is not one machine or even one cluster. It is software spread across Google’s edge and infrastructure, backed by Google’s software-defined networking layer called Andromeda. When one edge server fails, neighbours take over its share within moments. When traffic spikes, more edge capacity is used automatically. This is why the service needs no warm-up and no capacity planning from you.
Modern global balancers support HTTP/2 and HTTP/3 with QUIC between users and the edge, which reduces delays on mobile networks that lose packets.
TThe Life of a Request: Data Flow Step by Step
Follow one web request from the user’s phone to your server and back.
sequenceDiagram
participant C as Client
participant E as Edge Proxy
participant P as Policy Layer
participant B as Backend VM
participant H as Health Checker
H->>B: Probe health endpoint
B-->>H: Healthy
C->>E: TCP and TLS handshake
E->>E: Terminate TLS and read HTTP request
E->>P: Check security policy and URL map
P-->>E: Allowed and route to backend service
E->>B: New connection and forward request
B-->>E: Response
E-->>C: Response to client
DNS lookup
The user’s device asks the Domain Name System for the IP address of your site and receives the load balancer’s anycast address.
Connect to the edge
Traffic reaches the nearest Google edge. The TCP and TLS handshakes are completed there, using your certificate.
Security checks
If Cloud Armor is attached, the request is checked against your rules. Blocked requests are rejected here and never reach your servers.
Cache check
If Cloud CDN is on and the content is cached, the answer returns straight from the edge cache.
Routing
The URL map matches host and path and selects a backend service.
Backend selection
The balancer picks a healthy region and a specific backend using the balancing mode and algorithm.
Forward and answer
The request travels on the private backbone, the backend responds, and the response goes back through the edge to the user.
What the backend sees
Because a proxy balancer opens its own connection to the backend, the backend sees the balancer’s address as the source. To learn the true client address, the balancer adds a header called X-Forwarded-For that lists the original address. Application code that wants to log or rate-limit by client must read this header rather than the connection address. Passthrough balancers behave differently, because the real client address arrives unchanged.
Teams often see all traffic coming from “one address” in their server logs and think something is broken. It is normal for proxy balancers; read the forwarded header instead.
BBackends: Where the Work Really Happens
A load balancer is only as useful as the things it can send traffic to, and Google supports many kinds.
Instance groups
A managed instance group, or MIG, is a set of identical virtual machines created from one template. Google can add or remove machines automatically, which is called autoscaling, and replace broken machines automatically, which is called autohealing. An unmanaged instance group is a hand-made collection of machines that may differ from each other. MIGs are the classic and still very popular backend.
Network endpoint groups
A network endpoint group, or NEG, is a list of endpoints, where an endpoint is an address and port or a service. NEGs give finer control than instance groups, because the load balancer can target a single container or service instead of a whole machine.
Zonal NEG
Lists virtual machine addresses or container Pod addresses in one zone. This enables container-native load balancing on GKE.
Serverless NEG
Points to Cloud Run, Cloud Functions or App Engine, so serverless apps can sit behind the same front door.
Internet NEG
Points to an endpoint outside Google Cloud, such as another provider or a legacy site, reached by name or address.
Hybrid connectivity NEG
Lists endpoints in your own data center reached through Cloud VPN or Cloud Interconnect.
Private Service Connect NEG
Reaches a published service in another network, often one owned by a partner or another team.
Backend bucket
Serves files directly from a Cloud Storage bucket, ideal for images, scripts and downloads, often paired with Cloud CDN.
An instance group is like sending a delivery to a whole apartment building and letting the building decide who answers the door. A network endpoint group is like sending the delivery to one named flat. The second way is more precise, so fewer parcels take a detour inside the building.
Why container-native balancing matters
Without NEGs, traffic first reaches a node in a Kubernetes cluster and then hops again to the right Pod, which adds delay and makes health checks less accurate. With container-native load balancing, the balancer sends requests straight to Pods, so there are fewer hops, and balancing and health checks see the real application.
Mixing backends
One URL map can send “/static” to a backend bucket, “/api” to a GKE service, and “/legacy” to an internet NEG that points to an older system. This lets teams migrate step by step. You move one path at a time to the new platform while users keep the same address.
Example: gradual migration
A media company runs its old site in a rented data center. It puts a global Application Load Balancer in front, adds a hybrid NEG for the old servers, and sends the home page to a new Cloud Run service. Each week another path moves to the cloud. Readers never notice, and a rollback is as simple as editing one routing rule.
HHealth Checks: How the Balancer Knows Who Is Alive
A balancer that sends visitors to a broken server is worse than no balancer at all.
A health check is a small, repeated test. Probe machines inside Google’s network send a request to every backend at a regular interval. If the backend replies correctly several times in a row, it is marked healthy. If it fails to reply correctly several times in a row, it is marked unhealthy and receives no new traffic until it recovers.
The knobs you can set
| Setting | Meaning | Effect of a low value | Effect of a high value |
|---|---|---|---|
| Check interval | How often each backend is probed | Faster detection, more probe traffic | Slower detection, less noise |
| Timeout | How long to wait for an answer | May mark a slow but working server unhealthy | Tolerates slowness but delays failure detection |
| Unhealthy threshold | Failures in a row before removal | Quick removal, risk of false alarms | Stable but slower to react |
| Healthy threshold | Successes in a row before return | Returns quickly, may flap | Safer return, slower recovery |
Protocols and what they prove
- TCP: proves that a port accepts connections, nothing more.
- HTTP and HTTPS: prove that the application answers a specific web path with a success code. This is far more meaningful, because a server can accept connections while its application is stuck.
- gRPC and HTTP/2: match modern service protocols.
A TCP check is like knocking on a shop door and hearing someone say “hello.” An HTTP check is like asking, “Do you have bread today?” and getting a proper answer. The second test tells you whether the shop can really serve you.
The firewall detail that trips everyone
Health check probes come from special Google address ranges, commonly listed as 130.211.0.0/22 and 35.191.0.0/16, and for proxy-based regional balancers from a dedicated proxy-only subnet in your network. Your VPC firewall must allow them to reach your backends. If it does not, every backend looks unhealthy, and the balancer returns errors even though your servers are fine. Always confirm the current ranges in Google’s documentation.
“All backends unhealthy” right after setup almost always means a blocked firewall for health checks, a wrong port, or a health check path that returns an error. Check these three things before anything else.
Designing a good health endpoint
Create a dedicated path such as “/healthz” that checks the things the application truly needs, such as its ability to reach its database, but keep it light and fast. Avoid heavy work in the check, because probes arrive from many places often. Avoid making the check depend on slow external services, or one outside outage will remove every server at once.
BBalancing Modes, Algorithms and Session Affinity
The rules that decide which healthy backend gets the next request.
Balancing modes: how capacity is measured
Each backend group has a balancing mode that tells the balancer how to measure how full that group is.
Utilization
Looks at the average processor use of instances. Good when work per request varies and the processor is the limit.
Rate
Counts requests per second. Good for web services where each request costs roughly the same.
Connection
Counts open connections. Used for network balancers where long-lived connections matter.
Capacity scaler
A multiplier from zero to one. Lower it to send less traffic to a group; set it to zero to drain a group gracefully.
Local balancing algorithms
Once a region and backend group are chosen, the balancer chooses one endpoint. Newer proxy-based balancers let you pick the method.
- Round robin: take turns, one after another. Simple and fair when all requests are similar.
- Least request: pick the endpoint with the fewest requests in progress. Best when requests differ a lot in cost.
- Ring hash and Maglev hashing: pick based on a hash of something stable such as the client address or a header, so the same key keeps landing on the same endpoint even when endpoints change slightly.
- Random: pick any healthy endpoint, useful at very large scale where simplicity wins.
At a supermarket, round robin is like a guard who points shoppers to checkouts one, two, three in order. Least request is like a guard who looks at the queues and sends you to the shortest. Hashing is like a rule that all customers with names starting with the same letter always use the same till, so a regular customer always meets the same cashier.
Locality policies for global balancers
Global balancers also need a policy for spreading traffic across zones and regions. One common approach fills the nearest region first and spills over only when it is nearly full, often called a waterfall. Another spreads traffic evenly among all healthy regions that are close enough, which reduces the risk of one region being overwhelmed. Your choice trades lower latency against more even load.
Session affinity
Some applications keep temporary data in the memory of the server that handled the first request, such as a shopping cart held locally. If the next request goes elsewhere, the cart appears empty. Session affinity, also called stickiness, tries to send a visitor back to the same backend. Options include using the client address, a cookie that the balancer creates, or a value from a header. Affinity is a best effort, not a guarantee: if the chosen backend becomes unhealthy or the group changes, the visitor is moved.
Why use affinity
- Works with older apps that store session data locally
- Improves cache hit rates on backends
- Keeps long-lived connections such as WebSockets together
Why be careful
- Can leave some backends busier than others
- Hides the real fix: store sessions in a shared store
- Breaks when backends are replaced or scaled
Design applications to keep sessions in a shared place such as Memorystore or a database. Then any backend can answer any request, and you can scale freely.
UURL Maps and Advanced Traffic Management
Turning the load balancer from a simple distributor into a smart traffic controller.
Routing by host and path
A URL map compares each request with rules. A host rule looks at the website name, such as “shop.example.com” versus “blog.example.com.” A path rule looks at the part after the name, such as “/api/*” versus “/images/*.” The first matching rule picks the backend service. A default rule catches everything else. This is how one front door can serve dozens of different applications.
Powerful extras on proxy-based Application balancers
Header and query matching
Send requests with a certain header, such as a beta flag, to a special backend.
Weighted traffic splitting
Send ninety-five percent to the current version and five percent to the new one, then increase slowly.
URL rewrite and redirect
Change the path before forwarding, or send users from the old address to a new one with a proper redirect code.
Request mirroring
Send a silent copy of real traffic to a test backend, ignoring its responses, to check a new version safely.
Retries and timeouts
Try again on certain failures and give up after a set time so slow servers do not hold connections forever.
Circuit breaking and outlier detection
Stop sending traffic to endpoints that keep failing, and limit how many requests can queue for an overloaded backend.
Releasing new software with weighted splitting is like a restaurant testing a new dish. At first only one table in twenty gets the new recipe. If the diners smile, more tables get it. If they complain, the chef quietly goes back to the old recipe, and most customers never noticed.
A safe release in five steps
Deploy the new version beside the old
Create a second backend service pointing at the new version. Nobody uses it yet.
Mirror a copy of traffic
Check error rates and response times of the new version under real load, without any user impact.
Send a small percentage
Start with one to five percent of real users and watch the dashboards.
Increase gradually
Raise the share in steps while errors and latency stay healthy.
Finish or roll back
Move everyone over, or return all traffic to the old version with a single change.
Not every feature exists on every type. The classic external balancer and the passthrough balancers offer fewer routing options than the newer Envoy-based Application balancers. Read the feature comparison table in the official guide before choosing.
IInside Passthrough Network Load Balancers: Maglev and Direct Return
Speed, simplicity and the real client address, at the cost of fewer smart features.
Packets, not conversations
A passthrough balancer works with packets, which are the small units that carry data across a network. For each new connection it picks a backend by hashing connection details, such as the source and destination addresses, ports and protocol. It then keeps sending packets from that same connection to the same backend. Because the balancer does not end the connection, it needs no TLS certificates and does not read your data.
Direct server return
With passthrough balancers, the response does not travel back through the balancer. The backend sends it straight to the client, and the client sees the reply as coming from the balancer’s address. This is called direct server return. It saves effort, because responses are usually much bigger than requests, such as a video chunk compared with a short request for it.
Imagine calling a company’s main number. The switchboard operator listens only long enough to connect you to a free agent, then leaves the line. All the talking happens directly between you and the agent. The operator handles thousands of calls an hour because each call needs only a moment of attention.
Maglev for the external type
For external passthrough balancing, Google uses a system based on Maglev. Many ordinary servers run the Maglev software, and network routers spread incoming packets among them evenly. Each Maglev machine uses consistent hashing to pick the backend, so even if two different Maglev machines receive packets from the same connection, they pick the same backend. This lets the front layer grow, shrink and survive failures without breaking connections.
The internal type uses the network itself
The internal passthrough balancer has no separate machines in the middle at all. The decision is made inside Google’s software-defined network on the hosts that run your virtual machines. That is why it adds almost no delay and has no choke point.
Strengths
- Preserves the original client address
- Works with TCP, UDP and other common protocols
- Very low added delay
- No certificates to manage at the balancer
Limits
- No routing by URL or header
- No caching or web security add-ons at the balancer
- Regional only
- Backends must be set up to accept traffic for the balancer address
Example: a voice chat service
A game studio runs voice chat over UDP. They use an external passthrough balancer, because UDP is not web traffic and the servers need the real player address for moderation and for working around network address problems. The balancer spreads thousands of voice streams across a pool of servers, and each stream stays on one server for its whole length.
IInternal Load Balancing and Multi-Tier Designs
Not all traffic comes from the internet; much of it flows between your own services.
Modern systems are built from many small services that call each other, such as a web service calling an order service, which calls a payment service. Each of these inner calls also needs balancing and failover. Internal load balancers have private addresses that are reachable only from inside your network, from connected networks, or from on-premises sites linked by VPN or Interconnect.
The proxy-only subnet
Internal and regional proxy-based balancers run Envoy proxies inside your network. To give them room, you reserve a special proxy-only subnet in each region. The proxies use addresses from this block to talk to your backends, and your firewall rules must allow traffic from it. Forgetting to reserve the subnet is a very common setup error.
flowchart TD
U["Users on the internet"] --> EL["External Application Load Balancer"]
EL --> W["Web tier: managed instance group"]
W --> IL["Internal Application Load Balancer"]
IL --> A["App tier: services on GKE or VMs"]
A --> IP2["Internal Passthrough Network Load Balancer"]
IP2 --> D["Data tier: database proxies"]
Reading the picture
Users reach only the external balancer, which protects and caches. The web tier calls an internal Application balancer to reach the services in the app tier, so services can be added or moved without changing any address that callers use. At the bottom, a passthrough balancer in front of database proxies spreads raw database connections quickly while keeping the real source address for auditing.
Global access and cross-region internal balancing
By default an internal regional balancer accepts calls only from the same region. You can enable global access so clients in other regions can reach it. A cross-region internal Application balancer goes further, using one address that fronts backends in several regions, giving private applications multi-region failover.
Stable service address
Callers use one private address while servers behind it come and go.
Independent scaling
Each tier scales by its own load, so the app tier can grow without touching the web tier.
Safer releases
Internal traffic splitting lets teams test new service versions in production gradually.
Private by design
No public address means a smaller attack surface for internal services.
For large fleets of microservices, a service mesh such as Cloud Service Mesh can add balancing decisions inside the sidecar or proxyless gRPC client. The idea is the same, with the choice made closer to the caller.
CChoosing the Right Load Balancer
A simple path through the family tree.
flowchart TD
S["Start: what traffic do you serve?"] --> Q1{"Is it web traffic: HTTP or HTTPS?"}
Q1 -->|"Yes"| Q2{"Are clients on the internet?"}
Q1 -->|"No"| Q3{"Need the client IP kept and any protocol such as UDP?"}
Q2 -->|"Yes"| G["External Application Load Balancer: global or regional"]
Q2 -->|"No"| I["Internal Application Load Balancer"]
Q3 -->|"Yes"| P["Passthrough Network Load Balancer"]
Q3 -->|"No"| X["Proxy Network Load Balancer for TCP with TLS offload"]
Questions to ask yourself
What protocol?
Web protocols point to Application balancers. Anything else points to a Network balancer.
Who are the clients?
Internet users need an external balancer. Services and staff inside your network need an internal one.
How far apart are the users?
Users around the world with backends in many regions suit a global balancer. Users in one area suit regional.
Is the client address important?
If backends must see the real address without reading headers, choose passthrough.
What extras do you need?
Caching, a web firewall, header routing and traffic splitting need an Application balancer.
| Scenario | Recommended choice | Reason |
|---|---|---|
| Worldwide e-commerce site | Global external Application balancer with CDN and Cloud Armor | One address, edge termination, caching and protection |
| Regional government portal with data-residency rules | Regional external Application balancer | Keeps processing in one region |
| Private microservices in one region | Regional internal Application balancer | Smart routing and release tools without public exposure |
| Online game using UDP | External passthrough Network balancer | UDP support and the real player address |
| Global TCP service with TLS | Global external Proxy Network balancer | Worldwide reach and TLS offload for a non-web protocol |
| Database proxies inside a network | Internal passthrough Network balancer | Lowest delay and client address preserved |
A small internal tool with a few users does not need a global balancer. Start with the simplest type that meets your needs, because moving later is possible, though it requires planning.
PPerformance, Scalability and Network Service Tiers
How the service stays fast when a million people arrive at once.
Scaling without warm-up
With traditional balancers, a sudden surge could overwhelm the balancer before you had time to add capacity. Cloud Load Balancing is built from distributed software that uses Google’s enormous shared infrastructure, so it absorbs surges without manual preparation. For very large events, such as a product launch or ticket sale, Google still encourages customers to talk with their account team and to make sure that quotas and backend capacity are ready, because the backends are your responsibility.
Where your own scaling fits in
The balancer spreads the work, but the servers must be able to do it. A managed instance group can use autoscaling that watches signals such as processor use or the amount of traffic the balancer sends it, and adds or removes machines. This creates a lovely loop: the balancer reports load, the autoscaler adds machines, new machines pass health checks, and the balancer starts using them.
Traffic rises
More requests arrive at the edge and are spread across existing backends.
Backends get busier
Utilization or request rate per instance climbs above the autoscaler target.
New machines start
The managed group creates instances from the template, which takes some time to boot.
Health checks pass
Only when new machines reply correctly do they receive traffic, which protects users from half-ready servers.
Load evens out
Per-instance load returns to target, and the cycle repeats in reverse when traffic falls.
Premium Tier and Standard Tier
Google Cloud offers two Network Service Tiers. In the Premium Tier, traffic enters Google’s network at the edge closest to the user and then stays on Google’s private backbone, which usually means lower and steadier delay. Global external balancers need this tier. In the Standard Tier, traffic travels over the public internet for most of its journey and enters Google’s network close to the region where your backends live, which costs less but gives less predictable performance and works with regional scope.
Premium Tier
- Global anycast address and global balancing
- Backbone transport for lower, steadier latency
- Higher network cost
Standard Tier
- Lower price for outbound traffic
- Regional scope only
- Performance depends more on the public internet
Practical speed-ups
- Turn on Cloud CDN for cacheable content so that repeat requests never reach your servers.
- Enable HTTP/2 and HTTP/3 toward clients, which allows many requests over one connection.
- Compress responses either on the backends or through supported edge features, to move fewer bytes.
- Keep backends close to users by deploying in several regions and letting the global balancer pick the nearest.
- Use connection reuse by setting backend keepalive timeouts longer than the balancer’s idle timeout.
- Tune timeouts so slow requests do not hold resources forever, while genuine long operations such as uploads still finish.
Run a load test that includes the balancer, the autoscaler and the database. A fast balancer cannot rescue a database that has become the real bottleneck.
HHigh Availability, Failover and Reliability
What happens when a server, a zone or a whole region disappears.
Layers of protection
Instance failure
Health checks remove the broken machine within seconds, and autohealing replaces it.
Zone failure
Spread backends across at least two or three zones so that a zone outage removes only part of capacity.
Region failure
A global balancer with backends in several regions moves traffic to the remaining regions automatically.
Balancer failure
The balancer itself is distributed software with no single machine, so there is nothing you must duplicate.
flowchart TD
U["Users"] --> G["Global External Application Load Balancer"]
G --> A["Region A: healthy, serves nearby users"]
G -.->|"health check fails"| B["Region B: unhealthy, receives no traffic"]
G --> C["Region C: healthy, takes spillover"]
A -->|"overflow when full"| C
What the failover really needs
Failover only helps if the remaining regions can carry the extra load. If you run two regions at ninety percent each, losing one region means the other cannot cope. A common rule is to keep enough headroom that any one region can fail and the others still run safely, often called N plus one capacity. Your data layer must also be ready, because a stateless web tier in three regions is little use if the database exists in only one.
Passthrough failover groups
Passthrough balancers offer a failover feature in which you mark some backends as primary and others as standby. When too few primary backends are healthy, traffic moves to the standby group. This helps with appliances such as firewalls that should run in active and standby pairs.
Draining and graceful change
When you remove a backend or deploy a new version, connection draining lets requests already in progress finish for a set time while new requests go elsewhere. Without draining, users can see failed downloads or broken checkouts during deployments.
A shop closing one of its tills does not kick out the customer being served. It puts up a sign that says “closed after this customer” and the till shuts once that one is finished. Draining is that sign.
Test failover on purpose. Set a backend group’s capacity to zero or block its health check in a test environment, and watch how traffic and alerts behave. A plan you have never exercised is a hope, not a plan.
SSecurity: Certificates, Cloud Armor and Access Control
The balancer is your front gate, so it is the best place to put locks and guards.
Encryption with TLS
TLS is the protocol that encrypts web traffic, which is why you see a padlock in a browser. The balancer holds the certificate, a digital identity card that proves your site is genuine. You can use Google-managed certificates, which Google obtains and renews for you once your domain points at the balancer, or your own certificates. Certificate Manager helps you handle many certificates, wildcard names and automatic renewal.
An SSL policy controls which TLS versions and cipher choices are allowed. Choose a modern profile and set a sensible minimum version so that old, weak encryption is refused. For traffic from the balancer to your backends, you can use HTTPS too, so data stays encrypted all the way, which many compliance rules require.
Cloud Armor: the guard at the gate
Cloud Armor attaches to a backend service and examines requests at the edge before they reach your servers.
Web application firewall
Preconfigured rules help block common attacks such as SQL injection and cross-site scripting.
DDoS protection
Large floods aimed at the network and transport layers are absorbed by Google’s scale at the edge.
Allow and deny lists
Permit or block traffic by address range or country, useful for staff-only apps and sanctions rules.
Rate limiting
Limit how many requests one client may send in a time window, slowing password-guessing and scraping.
Adaptive protection
Machine learning watches traffic patterns and suggests rules when an attack starts.
Bot defence
Integrates with challenge systems that separate real people from automated programs.
Identity-aware access
Identity-Aware Proxy, or IAP, can sit on the balancer and require users to sign in with their organisation’s identity before reaching the application. This replaces the old habit of putting internal tools behind a VPN. Each request is checked against who the user is and what they are allowed to do.
Protecting the backends
- Give backend machines no public IP addresses where possible, so the balancer is the only door.
- Write firewall rules that allow traffic only from the balancer and health check ranges, not from the whole internet.
- Use least-privilege permissions in IAM so only the right teams can edit balancer settings.
- Turn on audit logs to see who changed a URL map, a certificate or a security policy.
- Verify the forwarded client address carefully, because anyone can send a fake forwarded header; trust only the value added by the balancer.
Cloud Armor rules can be set to preview, which logs what they would have blocked without blocking it. Review the logs for false alarms, then switch the rule to enforcement.
IIntegrations: GKE, Cloud Run, CDN and Beyond
The balancer rarely works alone; it is the doorway to your other Google Cloud services.
Google Kubernetes Engine
Kubernetes is a system that runs containers, which are small packaged applications. In Google Kubernetes Engine, you describe how outside traffic should reach your containers using an Ingress or the newer Gateway API. GKE then creates and manages the Google Cloud load balancer for you, including the URL map, health checks and network endpoint groups. A Service of type LoadBalancer creates a Network balancer for non-web traffic.
Serverless products
A serverless NEG allows Cloud Run, Cloud Functions and App Engine apps to sit behind a global balancer. This unlocks features that serverless URLs do not offer alone, such as a custom domain with your own certificates, Cloud Armor, Cloud CDN, and routing several functions under one address. It also enables multi-region serverless setups, where the balancer picks the nearest region that has your service deployed.
Cloud CDN and Cloud Storage
A content delivery network, or CDN, stores copies of popular files in many cities so that users download from nearby. Cloud CDN works together with the Application balancer: on a cache hit the edge answers immediately, and on a miss it fetches the file from the backend and stores it for later. Pairing a backend bucket with the CDN is a cheap and fast way to serve a static website or large downloads.
| Integration | What it adds | Good for |
|---|---|---|
| GKE Ingress and Gateway | Automatic balancer creation from Kubernetes objects | Container platforms and microservices |
| Serverless NEG | Custom domains, security and CDN for serverless apps | Cloud Run APIs and functions |
| Cloud CDN | Edge caching | Websites, images, video segments, downloads |
| Cloud Armor | Firewall and denial-of-service defence | Any public application |
| Identity-Aware Proxy | Sign-in before access | Internal dashboards and admin tools |
| Hybrid and internet NEGs | Backends outside Google Cloud | Migrations and multi-cloud designs |
| Cloud Service Mesh | Service-to-service balancing and policy | Large microservice estates |
| Infrastructure as code tools | Repeatable, reviewed configuration | Teams with many environments |
Infrastructure as code
Because a balancer is a chain of several objects, clicking through the console again and again invites mistakes. Teams usually describe the whole chain in a tool such as Terraform, review changes like any other code, and apply them the same way in every environment. This also makes it easy to rebuild the setup after an accident or to copy it for a new project.
MMonitoring, Logging and Metrics
Reading the dashboard of your front gate.
Metrics worth watching
Request count
How many requests arrive, broken down by response code class, region and backend.
Total latency
The time from the balancer receiving a request to finishing the response. Watch the slowest percentile, not just the average.
Backend latency
The part of the time spent waiting for your servers. A large gap between this and total latency points to slow clients or networks.
Error ratios
Share of responses in the 4xx and 5xx classes. Rising 5xx often means backend trouble.
Healthy backend count
How many backends pass their checks. A sudden drop is an early warning.
Utilization and connections
How close each group is to its configured limit.
Request logs
You can enable logging on a backend service and set a sampling rate, such as logging every request or one in ten. Each log entry records the client, the URL, the response code, the latency and a field that explains the outcome, such as whether the response came from the backend, from the cache, or was blocked by a security policy. Logs flow to Cloud Logging, where you can search them, build alerts from them, or export them to BigQuery for deeper analysis.
Reading the common error codes
| Code | Usual meaning at the balancer | First things to check |
|---|---|---|
| 403 | A security policy or access rule denied the request | Cloud Armor rules, IAP settings, allow and deny lists |
| 404 | No route matched or the backend has no such page | URL map rules, default service, application paths |
| 429 | Rate limit reached | Rate limiting rules and client behaviour |
| 502 | Bad gateway: backend closed the connection or sent an invalid reply | Backend keepalive timeout, crashes, protocol mismatch |
| 503 | No healthy backends available | Health checks, firewall for probes, capacity settings |
| 504 | Backend did not answer within the timeout | Slow queries, backend service timeout setting |
Think of the load balancer’s dashboard as the control tower of an airport. Request count is the number of flights, latency is how long each takes, health shows which runways are open, and error codes are the radio calls saying something went wrong. A good controller reads all of them together.
Alerts that earn their keep
- Alert when the share of 5xx responses stays above a small threshold for several minutes.
- Alert when the number of healthy backends drops below the minimum you need.
- Alert when the slowest one percent of latencies crosses your service goal.
- Alert when certificates are close to expiry, if you manage your own.
- Alert on unusual spikes of denied requests, which can signal an attack or a wrongly written rule.
Network Intelligence Center offers tests that trace a path from a source to a balancer or backend and show which firewall rule or route blocks it. This saves hours when a setup refuses to work.
CUnderstanding the Cost
Knowing what you pay for helps you design wisely.
The main parts of the bill
Forwarding rules
A charge per hour for each forwarding rule, whether busy or idle. Many rules and many addresses add up.
Data processed
A charge per gigabyte that passes through the balancer, which grows with your traffic.
Outbound transfer
Traffic leaving Google Cloud to the internet, billed according to your Network Service Tier and destination.
Cloud Armor and CDN
Policies, rules and requests for Cloud Armor, and cache fill and egress for Cloud CDN, are billed on their own.
Exact prices differ by balancer type, region and tier, and Google updates them from time to time, so always use the official pricing page and calculator for real numbers.
Ways to keep the bill sensible
- Share one balancer across many services by using host and path rules, instead of creating a separate balancer for each small service.
- Cache aggressively with Cloud CDN, because a cache hit avoids both backend work and some transfer cost.
- Compress content to reduce the number of gigabytes processed and transferred.
- Keep traffic in one region where possible; cross-region and cross-zone transfers inside your own system can add charges.
- Choose the right tier for each workload: Premium for latency-sensitive users, Standard for cost-sensitive, regional workloads.
- Delete unused balancers and reserved addresses, which keep billing even when nothing uses them.
Example: consolidating balancers
A company with fifteen small internal tools created fifteen separate external balancers, each with its own address and hourly fees. After moving to one balancer with host rules, protected by Identity-Aware Proxy, the monthly bill dropped sharply and certificate management became a single task instead of fifteen.
AAdvantages, Disadvantages and Trade-offs
An honest look at both sides, so you can choose with open eyes.
Advantages
- Fully managed: nothing to patch, size or warm up
- Single global address with edge termination and backbone transport
- Automatic health checking and failover across zones and regions
- Rich traffic control for safe releases
- Built-in integrations for security, caching and identity
- Support for containers, virtual machines, serverless and on-premises backends
- Pay-as-you-go pricing without hardware purchase
Disadvantages
- Several balancer types with different features can confuse newcomers
- Configuration is a chain of objects, which takes time to learn
- Google Cloud only, so multi-cloud designs need extra layers
- Limited low-level tuning compared with self-run software
- Costs grow with forwarding rules, data and add-ons
- Changes can take minutes to spread globally
The trade-offs in plain words
- Smart versus simple: Application balancers read and route web content but add a little processing; passthrough balancers are leaner but see less.
- Global versus regional: global reach brings the best user experience and failover but needs the Premium Tier and careful data design.
- Managed versus control: you give up some deep tuning in exchange for never having to operate the balancer.
- Sticky versus stateless: affinity helps old applications but hides scaling problems.
Comparing with other options
| Option | Strength | Watch out for |
|---|---|---|
| Google Cloud Load Balancing | Global anycast, edge termination, no warm-up | Tied to Google Cloud |
| Self-run software such as NGINX or HAProxy on virtual machines | Full control and portability | You size, patch, secure and make it highly available |
| Other clouds’ managed balancers | Native to their own platforms | Different features, often regional by default |
| DNS-based traffic steering alone | Simple, cheap, works anywhere | Slow failover because of caching, no health detail per request |
| In-cluster ingress controllers only | Close to the application | Still need an outer layer for global reach and protection |
If you already live on Google Cloud and want the least operational work, a managed balancer is almost always the right choice. Use self-run proxies only when you need a feature or portability that the managed family cannot provide.
DDesign Patterns and Anti-patterns
Habits that work, and traps that catch many teams.
Patterns that work
Edge shield
Put Cloud Armor and Cloud CDN in front of every public application so that bad and repeat traffic dies at the edge.
Multi-region active-active
Run identical stateless backends in several regions behind one global address for speed and resilience.
Static and dynamic split
Serve files from a backend bucket with CDN and send only dynamic requests to application servers.
Canary release
Use weighted splitting to try new versions on a few users before everyone.
Strangler migration
Move one path at a time from a legacy system to a new one behind the same address.
Tiered balancers
Use an external balancer for users, an internal one for services and a passthrough one for data proxies.
Anti-patterns to avoid
What people do
They run a virtual machine with a self-managed proxy in front of the managed balancer “for extra control.”
Why it hurts
The extra machine becomes a single point of failure and a bottleneck, and it hides the real client address and health information.
Better approach
Use the routing, security and traffic features of the managed balancer. Add a proxy only for a feature you truly cannot get otherwise, and run it as a scaled, health-checked group.
What people do
They rely on session affinity to keep important state in server memory.
Why it hurts
When a server is replaced or scaled in, users lose carts and sign-ins, and load spreads unevenly.
Better approach
Store sessions in a shared service so any backend can serve any request.
What people do
They use a shallow TCP health check for an application that can hang while the port stays open.
Why it hurts
The balancer keeps sending users to a server that cannot answer, and errors rise while dashboards look healthy.
Better approach
Use an HTTP health check against a real endpoint that proves the application is working.
What people do
They deploy backends in several regions but keep one database in a single region, then call the setup highly available.
Why it hurts
A failure of that one region still takes the whole service down, and distant regions suffer slow database calls.
Better approach
Design the data layer for multiple regions, using replicated or globally distributed databases, before relying on multi-region front ends.
What people do
They leave backend machines with public addresses and open firewalls so that anyone can bypass the balancer.
Why it hurts
Attackers skip the firewall, rate limits and sign-in checks you placed at the balancer.
Better approach
Remove public addresses, and allow traffic to backends only from the balancer and its health checks.
WWorked Example: A Global Web Shop from Scratch
Putting every idea together in one realistic build.
Imagine a small company that sells handmade goods online. At first all customers are in one country, but the owners plan to ship worldwide within a year. They want fast pages, no downtime during sales, protection from bots and a safe way to ship new versions. Let us design their front door step by step.
Pick the balancer
The site is web traffic from the internet with users in many countries, so they choose a global external Application Load Balancer on the Premium Tier.
Reserve an address and certificate
They reserve one global IP address, point their domain name at it, and attach a Google-managed certificate so that customers see the padlock.
Create backends
Product images go in a Cloud Storage bucket as a backend bucket with Cloud CDN. The shop application runs on Cloud Run in two regions, connected through serverless network endpoint groups. A small legacy stock system stays in a rented data center, reached through a hybrid network endpoint group.
Write the URL map
Paths beginning with images go to the bucket. Paths beginning with stock go to the legacy backend. Everything else goes to the shop application service.
Add protection
Cloud Armor blocks common attack patterns, limits login attempts per client, and denies traffic from countries where the company does not sell.
Set health checks and capacity
The application exposes a light health path. They keep enough capacity in each region that the other can handle all traffic if one region fails.
Observe
They enable request logging with sampling, build a dashboard for latency, error ratio and healthy backends, and alert on a rising error rate.
Release safely
New shop versions go first to five percent of visitors using weighted traffic splitting, and they widen the share only when the dashboards stay calm.
What the customer experiences
A customer in Singapore opens the site. DNS returns the single global address. The request reaches a nearby Google edge, where the encrypted connection is completed quickly. Cached images return instantly from the edge. The page request passes the security checks and is routed to the shop service in the nearest healthy region. If that region has a bad hour, the customer is served from the other region and never sees an error page.
One front door hid three very different backends, protected all of them with one policy, and allowed a gradual move from old to new. That combination of simplicity for users and flexibility for engineers is the real strength of Cloud Load Balancing.
BBest Practices, Common Mistakes and Troubleshooting
A checklist for a healthy setup and a path for when things go wrong.
Best practices
Choose the type deliberately
Answer the four questions about traffic type, client location, scope and proxy style before building.
Spread across zones and regions
Never place all backends in one zone, and use several regions for important public services.
Use meaningful health checks
Check the application path, keep the check light, and allow the probe ranges in your firewall.
Keep headroom
Plan capacity so that losing a zone or region still leaves enough servers.
Automate configuration
Define everything as code, review changes and apply them consistently.
Secure the edge
Use modern TLS settings, Cloud Armor in preview then enforce, and remove public addresses from backends.
Align timeouts
Set backend keepalive timeouts longer than the balancer’s idle timeout and choose request timeouts that fit your slowest valid operations.
Monitor and rehearse
Build dashboards and alerts, then test failover and rollback before you need them.
Common mistakes
Blocking health checks
A firewall that blocks probe ranges makes every backend look dead.
Forgetting the proxy-only subnet
Regional proxy-based balancers need a reserved subnet and a firewall rule that allows it.
Trusting the connection address
Applications log the balancer’s address instead of the real client from the forwarded header.
Short backend keepalive
If a server closes idle connections before the balancer does, occasional bad gateway errors appear.
Certificate stuck in provisioning
Managed certificates wait until the domain truly points at the balancer’s address.
Wrong port name or protocol
A backend service that expects one protocol while servers speak another causes confusing errors.
Ignoring config propagation time
Changes may need a few minutes to reach all edge locations, so testing instantly can mislead.
Over-sharing one backend service
Mixing very different workloads under one setting makes tuning timeouts and capacity impossible.
A troubleshooting path
Read the status code and log reason
The error class and the log field that explains the outcome narrow the cause quickly.
Check backend health
Open the backend service page and see which backends are healthy and why others are not.
Verify firewall and routes
Use connectivity tests to confirm that probes and balancer traffic can reach the backend port.
Test the backend directly
From inside the network, call the health path and the application path to separate balancer issues from application issues.
Review recent changes
Check audit logs for edits to URL maps, security policies or firewall rules shortly before the problem began.
RReal-World and Industry Examples
Where these ideas show up in practice.
Google’s own services
Products such as Search, Gmail and YouTube are reached through Google Front Ends and global load balancing technology that Google has described in research papers and public talks. Cloud Load Balancing brings the same style of design, with an anycast address, edge termination and a private backbone, to customers.
Niantic and Pokemon Go
When Pokemon Go launched, traffic grew far beyond the most optimistic forecasts of its makers. Niantic has publicly described how its back end on Google Cloud, including Cloud Load Balancing, helped absorb the huge and sudden demand. The lesson is that surprise popularity is exactly the situation a distributed, warm-up-free balancer is built for, though the backends and databases must scale as well.
Media and streaming platforms
Video companies serve large files to viewers across many countries. They typically combine global Application balancers, Cloud CDN and cloud storage so that popular segments are cached near viewers while the balancer routes player and account requests to application services. This illustrative pattern keeps start-up time short even at peak hours.
Retail flash sales
Online retailers prepare for sale events that bring many times normal traffic in minutes. In an illustrative design, the retailer pairs Cloud Armor rate limiting with a waiting-room page for the checkout path, uses autoscaled backends, and watches error ratios on a shared dashboard. The balancer keeps traffic spread evenly while protective rules slow down bots.
Banks and regulated industries
Financial organisations often choose regional or internal balancers to keep processing inside a country. They add Identity-Aware Proxy for staff tools, private connectivity from branch networks, strict TLS policies and detailed audit logging, which supports compliance reviews.
Gaming and real-time communication
Studios running UDP or custom protocols commonly choose passthrough Network balancers to preserve player addresses and reduce delay, and use global proxy balancers for TCP-based lobby and matchmaking services. A single entry address simplifies the game client’s settings.
Company details come from public talks and case studies and may change, and some examples are illustrative patterns rather than named customers. Check Google Cloud’s customer stories before quoting any of them.
GGlossary of Load Balancing Terms in Simple Words
A quick reference to return to whenever a word feels unfamiliar.
Load balancer
A service that receives requests and spreads them across several healthy servers.
Backend
A server, container or service that actually handles the work behind a balancer.
Frontend
The address and port that clients connect to, defined by a forwarding rule.
Health check
A repeated test that decides whether a backend may receive traffic.
Layer 4
Transport level, which sees addresses, ports and protocols such as TCP and UDP.
Layer 7
Application level, which sees web addresses, headers and cookies.
Proxy
A balancer that ends the client’s connection and opens a new one to the backend.
Passthrough
A balancer that forwards packets without ending the connection.
Anycast
One IP address announced from many places, so users reach the nearest one.
Google Front End
Edge servers that accept user connections and handle encryption close to the user.
Maglev
Google’s software system that spreads network packets across many machines using consistent hashing.
Direct server return
Responses go straight from the backend to the client, skipping the balancer.
URL map
The routing table that picks a backend by host and path.
Network endpoint group
A list of precise targets such as containers, serverless apps or external addresses.
Session affinity
A setting that tries to keep one visitor on one backend.
Connection draining
A grace period for in-progress requests before a backend is removed.
Cloud Armor
Google’s edge firewall and denial-of-service defence service.
TLS
The protocol that encrypts web traffic and proves a site’s identity with certificates.
FFrequently Asked Questions
Quick answers to the questions that beginners ask most often.
No. It is a managed, distributed service. There are no balancer machines for you to create, patch or resize.
Yes. A global external balancer on the Premium Tier uses one anycast address and sends each user to the closest healthy backend region.
Application balancers work at Layer 7 and understand web requests, so they can route by host and path. Network balancers work at Layer 4 and deal with connections and packets for any protocol.
The most common causes are a firewall blocking the health check ranges, the wrong port or path, or an application that returns errors on the check path. Fix these first.
Not the balancer itself. You still need backends, databases, quotas and autoscaling that can handle the load, and it is wise to load test before important launches.
Yes, using serverless network endpoint groups. This lets you add custom domains, Cloud Armor and Cloud CDN to serverless services.
With proxy balancers, read the forwarded header that the balancer adds. With passthrough balancers, the real address arrives directly.
Yes. Internet network endpoint groups and hybrid connectivity network endpoint groups can reach other clouds or your own data center.
No. It is a best effort. If the chosen backend becomes unhealthy or is removed, the visitor moves to another one, so applications should not depend on it for correctness.
DNS only hands out addresses, and cached answers make failover slow. A load balancer inspects each connection or request, checks backend health continuously and reacts within seconds.
Yes. Host and path rules in the URL map let one balancer front many sites and services, which also reduces cost and certificate work.
An internal Application balancer, often with Identity-Aware Proxy, is a good starting point. It stays private and gives routing and sign-in features without extra servers.
SSummary and Key Takeaways
The whole story in a few lines before you go.
Cloud Load Balancing turns the old, fragile idea of a traffic box into a distributed service that lives at the edge of Google’s network. It accepts users at the nearest location, applies security and routing rules, picks a healthy backend, and keeps working when machines, zones or whole regions fail. Your job is to choose the right family, define clear backends and health checks, protect the edge, and watch the dashboards.
Key Takeaways
- It is a family, not one product. Application balancers read web traffic at Layer 7, while Network balancers handle other protocols at Layer 4 as proxy or passthrough, each in external or internal forms.
- A balancer is a chain of parts. Forwarding rule, target proxy, URL map, backend service, backends and health check each have one clear job.
- Global design uses anycast and the edge. One address, Google Front Ends close to users and the private backbone give fast, resilient access without warm-up.
- Health checks decide everything. Use meaningful application checks, allow probe ranges in firewalls, and keep headroom so failover really works.
- Secure the front gate. Combine modern TLS, Cloud Armor, Identity-Aware Proxy and private backends so that bad traffic stops at the edge.
- Release and migrate gradually. Weighted traffic splitting, mirroring and path-based routing make new versions and migrations safe.
- Pick the simplest type that fits. Choose by protocol, client location, scope and proxy style, and watch cost, logs and metrics from day one.