The client-server relationship is pretty straightforward. When you request a certain website from your browser, a server somewhere sends it back to you. DNS (Domain Name System) allows you to type a website address like https://google.com instead of a full IP address, which makes surfing the web much easier!
However, we're missing one important piece of the puzzle. You know how on some websites, you create an account with an email address, and maybe you store other data on there, like a description or image of yourself for a profile. Where is this information stored?
We're talking about storing data, so the logical name for the place it gets saved is called a database.
Databases also live on servers. Here's how they fit into the overall equation we've discussed so far.
Clients request a website, and that request is sent to a server. Now, things can go differently than what we've previously seen.
If there's stored user data to send back in the web page as well (like the fact that my name is "Emily", which is stored in a database somewhere), the server will make its own request to a database!
The database responds to the server with the requested information.
The server responds to the client with all of that.
This can be confusing, so check out the video for an infographic that'll make it more clear!
The language in which servers make requests for data from databases is called SQL. Here's an example of SQL. You might find it to be surprisingly readable:
SELECT * FROM users WHERE last_name='Reese';
This will cause the database to return all users where the stored last name is Reese. Cool, right?
That's how websites save your account details! The more you know!
Now that you have a complete picture of how clients, servers, and databases fit together to send requests and responses on the web, let's check out different devices that can access the internet in the next chapter.