O
O
Oleg2016-03-23 11:48:34
Apache HTTP Server
Oleg, 2016-03-23 11:48:34

The work of the client-server model, questions from the noob?

Good afternoon, could you clarify a few questions for a beginner? :)
For example: we have a client-server model Client - Web Server - Application Server - Database. In the client (browser) I enter the URL ( toster.ru
), then the DNS server is accessed and it returns an ip that corresponds to toster.ru
Questions:
already going direct with the Web Server/Application Server?
2) What is the difference between a web server and an application server? For example, Apache is a web server, but as I understand it, it can also be an application server?
3) Which link from the client-server model (Client - Web Server - Application Server - Database) can be missing in this chain?
As I understand it, if this is just a page with my photo and a page "about me", then there may be no Application Server-DB, but if it is an "online store with a forum" then all the components are necessary?
4) And one more stupid question: what happens, for example, if I put an item in the shopping cart in an online store?
As I see it: the client sends a request to the web server, it processes it and sends it to the application server, the application server processes the request and sends a request to change the database, and then in the reverse order. Is this correct? Or does the first call go to the DNS server from the client?
Thanks everyone and sorry for the noob questions!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2016-03-23
@saboteur_kiev

1) At the next call (going to another page of the site), does the call go back to DNS or is the interaction already going directly with the Web Server / Application Server?
You are confusing the server-client application and the operation of the DNS service. The server can initially be accessed by IP address, the server can be accessed and not by IP networks at all. As for the work of DNS, it works more complicated.
Your computer looks at the hosts file, if the site you want is not there, it looks at the local cache, which stores recent hits. If not there, it will contact your DNS server. He looks into his cache, if it is not in it, he turns to the upstream DNS server, and so on to the root server. Along the way, each DNS server may have its own cache. On average, the cached value is stored for a day, but each domain owner can set their own TTL (time to live). In addition, there are dns balancers, when different IPs can be returned to the same DNS.
2) The web server respectively works as a server for the web (http), the application server respectively works for applications (for example, it runs a java servlet that can be accessed in various ways, including http)
3) in the chain "client - web server - application server" the second or third point may be missing. That is, it can be a client-webserver or a client-server application. In general, it is correct to say client-server. And what kind of client and server, and how they communicate - this is secondary.
4) You are confusing the work of the client-server part and the work of network protocols directly. Don't interfere with DNS here, it works transparently for your client and server.
Do not interfere with the database here, you can work even without it.
If you click "add to cart", then the client sends a command, the server processes it and responds to the client in some way that the client understands. What the server does - puts it in the database, or does not put it - it depends on the implementation of the basket.
It is clear that all commands that the client gives to the server and all the answers that the server gives to the client must be clear to both the server and the client. That is why it works.

D
Dimonchik, 2016-03-23
@dimonchik2013

1) directly, if the same domain, to speed up the pictures can be on subdomains, it will once request their IP, although the IP is often the same
2) this is a convention of interpretation, maybe , but it’s better not to bathe. Strictly speaking, giving only statics and proxying the rest of the requests - the web server is already an application server and there are
3) any two of the three: Web server - Application server - database
again - this is an interpretation, a database is not necessarily RDBMs, maybe on files
4) forget about DNS here at all, but AJAX is happening
and here is a useful site for a long time to come - ruhighload.com "I would like it at your age"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question