Overview of B/S network architecture

  • Architecture design of B/S network architecture:
     

  • The BS network architecture has been simplified from the front end to the back end, and is based on the unified application layer protocol HTTP to exchange data. Unlike the long connection interaction mode adopted by most traditional CS Internet applications, the HTTP protocol uses a stateless short connection Usually, a request completes a data interaction, which usually corresponds to a business logic, and then the communication connection is disconnected. This method is adopted to serve more users at the same time, because current Internet applications process hundreds of millions of user requests every day, and it is impossible for each user to directly maintain this state after visiting once

  • When a user enters the URL www.taobao.com in the browser, many operations will occur. First, it will request DNS to resolve the domain name into the corresponding IP address, and then find the corresponding server on the Internet according to the IP address, and initiate a get request to the server, and the server will return the default data resource to the visiting user. In fact, there is still very complex business logic on the server side : there may be many servers, which server is designated to handle the request, which requires a load balancing device to evenly distribute all user requests; and the requested data is stored in The distributed cache is still in a static file, or in the database; when the data is returned to the browser, the browser parses the data and finds that there are still some static resources (such as CSS, js or pictures) and initiates another HTTP request preferentially, while These requests are likely to be on the CDN , and the CDN server will process the user's request. Generally speaking, a user request will involve so many operations

No matter how the network architecture changes, there are always some fixed principles that need to be followed:

  • All resources on the Internet must be represented by a URL. A URL is a uniform resource locator. If you want to publish a service or a resource on the Internet so that others can access it, you must first have a unique URL in the world.
  • Must interact with the server based on the HTTP protocol
  • Data display must be performed in a browser . After you get the data resource, you must restore its appearance on the browser

Guess you like

Origin blog.csdn.net/weixin_54046648/article/details/127645891