STEPHANIE WONG: Cat fashion, photons, and load balancers.
How do they all relate?
YURIY BABENKO: Stay tuned to learn more.
[MUSIC PLAYING]
STEPHANIE WONG: For many people, one of the greatest mysteries
in the universe is how in the world
Google can return billions of cat image results
in under one second.
So I brought my friend Yuriy here
to help explain just how we do that.
YURIY BABENKO: While the internet
has a whole set of optimizations to make things
like these searches fast, Google's global architecture
has its own secret sauce that allows it to achieve the speed
and accuracy that you've come to know,
which prompts many customers and companies to ask
how to leverage that performance for their own needs.
STEPHANIE WONG: Well, Google spent the last two decades
building one of the largest, fastest fiber optic networks
in the world to support Google Cloud
and Google's own services-- you know, like YouTube and Gmail.
And that network has grown 15 times in the past six years,
passing 600 trillion bits per second
across land and through sea, allowing us to service over
1 billion users a day.
YURIY BABENKO: In building this network,
Google has had to put in years of research, some of which
has made it back into the community as white papers,
which talk about more of their amazing achievements
in technology.
STEPHANIE WONG: But we're getting ahead of ourselves.
To understand how big this technology is,
let's start by getting small and looking
at how the internet works from the perspective
of a single photon running through Google's network.
Let's say we just created our latest web e-commerce site
on Google Cloud that serves the latest cat fashion trends.
We have some users in Singapore who are testing our new site
and send a request from their device
to purchase cat winter apparel.
YURIY BABENKO: The request from the user's device
will hit the service provider first,
which will realize the destination is a Google server.
It will send it right to the closest Google front-end server
that it can find.
These GFEs sit at the very edge of Google's global network,
with multiple points of presence.
Why?
To allow information to be served as close to the users
as possible, like Rio de Janeiro, Zurich, and Singapore.
STEPHANIE WONG: At this point, Google's technological magic
takes over.
The first thing the request does is
slam into Google Cloud's software-defined global load
balancer.
This load balancer is responsible for distributing
HTTP and HTTP(S) traffic to back-ends in order
to manage and distribute load in a scalable way.
In the best scenario, we've deployed our software onto VMs
running in the Singapore data center, in which case
the request is handled and the data is sent back to the user.
YURIY BABENKO: But let's say the closest back-end instance
group in Singapore is unavailable,
or maybe we haven't deployed VMs to this region yet.
The user's request is seamlessly directed
to other VMs we are running stationed
in the US-East region.
What is great about the global L7 load balancer
is that routing to a different region across the globe
happens without the developer having to lift a finger.
And configuration is just a few clicks in the UI.
It gives you a single Anycast IP that you can point traffic to,
even if the back-ends go down.
STEPHANIE WONG: What lets the L7 load balancer do
this is the fact that all of the load balancing
is done in software, rather than in hardware.
It performs a weighted selection from the set of back-ends,
skipping any back-ends that appear unhealthy
or whose connections are saturated.
This is called the waterfall by region algorithm,
and we'll have an in-depth episode
on this on our other series, "Get Cooking in Cloud."
Traffic is proxied through these GFEs, which
forwards the query to the selected back-end
running our cat web server.
YURIY BABENKO: Now, in our scenario of a user in Singapore
requesting data from a VM in US-East,
the GFEs send the request across a subsea fiber optical cable
from APAC to the US, which connects
various operational regions of Google Cloud.
These fiber networks connect Cloud regions
across land with thousands of kilometers.
You've probably passed them and never even noticed.
They are underground, along railroad tracks, across
[INAUDIBLE],, or even across mountain ranges.
And if you're wondering about the speed,
photons travel at [INAUDIBLE] of the speed of light in fiber.
And with that speed, our photons can
carry over 2,000,000 photos and 8,000 YouTube videos
every second across our network.
STEPHANIE WONG: Bear with me on what happens next.
That Anycast IP the L7 load balancer
has comes with an associated forwarding
rule, which will then direct traffic to a target proxy.
Here, the target proxy terminates the client session.
It has configurations for a URL map,
like host and path rules, which then routes the traffic
to the correct back-end service on VMs in the US-East region.
YURIY BABENKO: The back-end servers
check each back-end's capacity and health
and sends traffic to the most available and healthy back-end.
It then sends the shopping data back.
The GFE caches the response and forwards it to the user.
STEPHANIE WONG: And this, my friends,
is how you can optimize for latency by choosing from Google
Cloud's globally extensive regions
that are closest to your users, even
when back-ends are overloaded or unhealthy.
Or you can use Google Cloud content delivery network
to leverage our load-balancing and cache
content closer to your users.
YURIY BABENKO: But let's go back for a second.
We would be remiss if we didn't discuss
in a bit more detail what happens
as the content is sent back to the user from the back-ends.
As the response is served back to the GFE from the VM,
photons are sent from our servers,
which are connected to optical transmission equipment.
These use infrared lasers to transmit signals
through the fiber network.
A typical cable would have hundreds of optical fibers,
each made of a glass, with a diameter of just a human hair.
And they can transmit signals with terabytes capacity.
Then the photons leave the Google data center's fibers
that are bundled in an outside plant cable.
STEPHANIE WONG: But we inevitably face a problem.
As photons travel down fiber optic cables,
their intensity diminishes, called attenuation.
For example, in one of Google's research papers,
they demonstrated what happens when optical signals travel
through 3,200 kilometers.
Looking at the graph, you can see that the relative power
level of the signal decreased.
So how do photons make it all the way
between regions which are thousands of kilometers apart?
YURIY BABENKO: To combat attenuation,
we place optical amplifiers along our cables,
with hundreds of them on the route.
Amplifiers increase a signal over long distances,
so our photon on can make it to a destination.
STEPHANIE WONG: The journey of the photon
finally ends back in Singapore.
It traveled along fiber laid underground and strung
through the air, getting amplified
along the way, all of which happen in just milliseconds.
Our fiber networks now connect to Google Cloud regions
across five continents.
Over the past 10 years, through a combination
of buying and leasing, Google has fiber all around the world.
But this is only the beginning.
There is so much more in development
to support our future cloud regions.
YURIY BABENKO: In fact, you can automatically
take advantage of these by using the Premium Tier
network to access Google's own global private network,
avoiding suboptimal internet path.
Check out the link below to learn more.
STEPHANIE WONG: Like this video if you
want more content like this.
And remember, optimizing your network
means freeing up your bandwidth.
[MUSIC PLAYING]