5 thoughts on “What is the basic architecture of the website”

  1. The website architecture is divided into hard architecture and soft architecture according to the production steps.
    1. Hard architecture
    1, computer room: When choosing a computer room, according to the regional distribution of website users, you can choose a single -machine room or double computer room for Netcom, telecommunications.
    2, bandwidth: Estimated the daily access of the website, and select the appropriate bandwidth according to the number of access. The calculation of the bandwidth is mainly involved two indicators: peak traffic and page size.
    3, server: Select the required servers, such as picture server, page server, database server, application server, log server, for websites with a large number of access, separation of separate picture servers and page servers is necessary.
    . Soft architecture
    1, website framework: There are many options for the current PHP framework, such as: Cakephp, Symfony, Zend Framework. According to the creative team, they are familiar with each framework.
    2, layering of logic
    1) Performance layer: All logic related to performance should be included in the category of the expression layer.
    2) Application layer: The main role is to define what the user can do and feedback the operating results to the performance layer.
    3) Field layer: The layer of the logic of the field is to tell users the specific operation process.
    4) The lasting layer: that is, the database, save the field model saved to the database, including the architecture and logical relationship of the website.
    Extension information
    The classification of the website
    1. According to the programming language classification used on the website: for example, ASP website, PHP website, JSP website, ASP. Net website, etc.;
    2, according to the purpose of the website Category: For example, portal websites (comprehensive websites), industry websites, entertainment websites, etc.;
    3, according to the functional classification of the website: such as a single website (corporate website), multi -functional websites (network malls) and so on.
    4. Category according to the holders of the website: for example, personal websites, commercial websites, government websites, education websites, etc.
    5. Classified according to the business destination of the website: profit -type website (industry website, forum), non -profit -based websites (corporate websites, government websites, education websites).
    Reference materials Source: Baidu Encyclopedia — website architecture
    Reference materials Source: Baidu Encyclopedia — website

  2. Flat OR tree type: When it comes to the website structure, everyone will mention the flat structure and tree structure, which must be called "structure flat". Essence In fact, for the Baidu search engine, as long as the structure is reasonable, logical, and regular, it is friendly.
    Link structure: Compared with the physical structure, it is necessary to talk about logical structure: the link structure formed by internal links, the logical structure is the most concerned of search engines. For a website, the webpage can only pass the homepage -Directory 1 -Directory 2 Follow to Follow. It is not enough. A good link structure should be mesh.
    The homepage link should be chained to the important channel page, the channel page of the channel page to the node page or ordinary page below. At the same time, the channel page, node page, and ordinary pages should be able to linked back to the homepage
    In links between which pages are connected to each other, you need to describe the appropriate anchor text
    The engine is not visible. The use of the picture for the link in the port should be improved. The ALT tag
    Baidu search engine currently only supports some JS and FLASH analysis.
    This is to leave more entrances for important pages. Baidu search engine believes that the webpage that gets more internal voting is relatively more important
    "The closer to the homepage" webpage, the easier it is to be valued by Baidu. This "near" refers to the click distance of the page from the homepage. Even if the directory level of the URL is deeper, as long as there is an entrance on the homepage, Baidu thinks this is a very important page.
    sm not to produce a terrible island page. Although Baidu has done a lot of work in submitting imports and social mining, link capture is still the most important channel for Baidu to get a new page

  3. The website architecture is generally considered to be based on the results of customer needs, accurately locate the target group of the website, set the overall architecture of the website, plan and design website columns and content, formulate the website development process and order Management design. Its content has a procedural architecture, showing architecture, and information architecture. The steps are mainly divided into two steps: hard architecture and soft architecture. Network architecture is a necessary basic technology for modern network learning and development.

    The choice of machine room
    Apicking the machine room, according to the regional distribution of website users, you can choose Netcom or telecommunications room, but more often, the dual -line computer room may be suitable. The larger the city, the more expensive the price of the machine room. From a cost perspective, you can host the server in some small and medium -sized cities. For example, the company in Beijing can consider holding the server in Tianjin, Langfang and other places. It is not particularly far away, but the price will be much cheaper.
    The soft architecture
    The choice of framework
    The PHP framework currently has many options, such as: Cakephp, Symfony, Zend Framework, etc. As for which one should be used, there is no unique answer, according to Team Team The members of the team depends on the degree of understanding of each framework. Many times, even if there is no framework, it can also write good programs. For example, Flickr is said to use a class library such as Pear Smarty. It is the consciousness of framework in our programming thoughts.
    The layer of logic
    . After the size of the website is to a certain extent, the various logic entangled in the code will bring huge obstacles to maintenance and expansion. At this time, our solution is actually very simple. That is the reconstruction to layered the logic. Generally, from top to bottom, it can be divided into expression layers, application layers, field layers, and long -lasting layers.
    The expression layer
    The so -called expression layer does not just refer to templates. Its range is wider. All logic related to performance should be included in the category of the expression layer. For example, the fonts somewhere should be displayed as red, and the beginning of somewhere should be empty, which belongs to the expression layer. Many times, the error that we can easily make is to put the logic of the expression layer at other levels. Here is a very common example: when we display the title of the article on the list page If the length exceeds this limit, it is cut off, and ".." is displayed later. This is the most typical layer of expression logic, but in the actual situation, many programmers complete the data acquisition and interception in the non -expression layer code. Then assign a value to the expression layer template. The most direct disadvantage of such code is the same data. On this page, I may want to display the first 10 words, and another page I may want to display the first 15 words. Once we are in the program, we are in the program. After solidifying this word, it lost transplantability. The correct approach is to make a program such as a view assistant to specifically handle such logic. Compared with: Truncate in Smarty belongs to such a view assistant (but it is not suitable for Chinese).
    The application layer
    The so -called application layer, its main role is to define what users can do and feedback the operating results to the performance layer. As for how to do it, it is usually not its scope of responsibility (but the scope of the duties of the domain layer). In a website that uses the MVC architecture, we can see the URL like the following: domain/ArticleS/View/123. Application layer operation, because it defines users that can do a viewing action. In the MVC architecture, there is a guidelines: Rich Model is good. The implication is that it is better to keep it "thin", which means that the application layer should be as simple as possible, and not to include logic involving the content of the field.
    domain layers
    The most direct explanation is the layer containing field logic. It is the soul of a software. Let's take a look at what field logic is. To put it simply, the logic with a clear field of concept is the field logic. For example, we withdraw money on the ATM machine. , Take the money, and then spit out a transaction bob. In this process, the process of the UnionPay card allocated money from the account in the ATM machine is a field logic, because withdrawal of money in the bank is a clear field concept, and the ATM machine spit out a transaction voucher is not the field logic. And it is just a application logic, because the vomiting transaction is not a clear concept in the bank, it is just a technical means. Correspondingly, we do not vomit the transaction for the transaction. But this is not necessarily the case. If we ask for withdrawal, we must spit out the transaction voucher after withdrawal, that is to say, the vomiting of the transaction is closely combined with the withdrawal of the withdrawal, then you can also treat the vomiting transaction. Some parts, everything depends on the specific situation of the problem. In the classic field -driven design of Eric, the field layer is divided into five basic elements: entity, value object, service, factory, warehousing. You can refer to the introduction in the book. The most common mistake in the field layer is to leak logic that should belong to the field layer to other levels. For example, at a CMS system, the definition of popular articles is like this: more than 1,000 times a day is browsed, and they are reviewed by comments. The number of times is more than 100 times, and such an article is a popular article. For a CMS, the word popular article is undoubtedly an important field concept, so how do we realize this logic design? You may give a similar code below: "Select ... from ... where browse> 1000 and comment> 100", yes, this is the simplest implementation method, but it is important to note that "every day is browsed every day The number of times the number of times is more than 1,000 times, and the important field logic of the number of times is more than 100 times. "The logic of the SQL statement is obviously not in the scope of the domain layer, that is, the logic of our field is leaked.
    Slayer layer
    The so -called lasting layer refers to saving our field models into the database. Because our program code is object -oriented, and the database is generally related to the database, we need to crush the field models to save them into the database, but in PHP, it has not yet appeared very good ORM. Therefore, there are not many solutions in this regard. For the book's application architecture mode of MARTIN, the method that can be used is roughly available. Layer 2 is the way to turn into an activity record (Active Record).
    Edit the load balancing of the website architecture of this paragraph. Eight solutions must be considered
    HTML static
    In fact, everyone knows that the highest efficiency and the smallest consumption is the pure and static HTML page, so we we As much as possible, the pages on our website architecture are implemented with static pages. This easiest way is actually the most effective method. But for a large number of content and frequently updated websites, we cannot manually implement them one by one, so we have a common information release system CMS, like the news channels of various portals we often visit, and even their other channels. If the information release system is managed and implemented, the information release system can realize the simplest information entry to automatically generate static pages. It can also have functions such as channel management, authority management, and automatic grabbing. The management CMS is essential. In addition to the portal and information release type website, for community type websites with high interaction requirements, as static as much as possible is also a necessary means to improve performance. Real -time staticization of posts and articles in the community have been updated. Re -static at time is also a large number of strategies. Like MOP's hodgepodge, it uses such a strategy, as is the NetEase community. At the same time, HTML static is also a means of use of some cache strategies. For applications that use databases frequently in the system, but the content updates are very small, you can consider using HTML staticization to achieve it, such as the public setting information of the forum in the forum. These information is currently The mainstream forums can be managed in background management and stored in databases. In fact, a large number of information is called by the front desk program, but the update frequency is very small. You can consider stating this part of the background update to avoid a large number of databases. Access request.
    It picture server separation
    Ey knows that for the web server, whether it is Apache, IIS or other containers, the picture is the most consumed resource, so we need to separate the picture from the page. This is basically basically The strategies that will be adopted on large websites, they all have independent picture servers, and even many picture servers. Such a architecture can reduce the pressure of the server system that provides page access requests, and it can ensure that the system will not collapse due to picture problems. On the application server and picture server, different configuration optimization can be performed. Support, as little loadmole as possible to ensure higher system consumption and execution efficiency.
    The database cluster and library scattered
    large websites have complex applications. These applications must use the database. Then when facing a large number of access, the bottleneck of the database can be displayed quickly. At this time A database will not be able to meet the application quickly, so we need to use the database cluster or library scattered. In terms of database clusters, many databases have their own solutions. Oracle, Sybase, etc. have a good solution. Master/SLAVE provided by the commonly used MySQL is also a similar solution. The solution can be implemented. The database clusters mentioned above will be limited by the DB type in terms of architecture, cost, and expansion. Therefore, we need to consider improving the system architecture from the perspective of the application. Essence We have separated the database to install business and applications or functional modules in the application. Different modules correspond to different databases or tables, and then make smaller database distributions on a page or function according to certain strategies, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables, such as user tables. Swipe the user ID, so that the performance of the system can be improved at a low cost and has a good scalability. The SOHU forum uses this architecture to separate the information of the forum users, settings, posts and other information, and then use the section and ID to make a large database and table in accordance with the section and ID. In the end It can make the system add a low -cost database at any time to supplement the system performance.
    This cache
    The word cache has been exposed to technology, and cache is used in many places. The cache in website architecture and website development is also very important. Here is the two most basic caches. Advanced and distributed slow existence later. The architecture cache can know that Apache provides its own cache module for people who are familiar with Apache. They can also use the Squid module for cache. These two methods can effectively improve Apache's access to response. The cache of website program development, Linux provides commonly used cache interfaces, can be used in web development. For example Essence In addition, when using Web language development, various languages ​​basically have their own cache modules and methods. PHP has a Pear Cache module, and Java is more. It is not very familiar. I believe there must be.
    mirror
    Igly is the method of improving performance and data security often adopted by large websites. The technology of mirroring can solve the difference in access speed of different network access and regions, such as chinanet and ENET. The differences have prompted many websites to build mirror sites in the Education Network, and the data is updated regularly or real -time updates. In terms of details of mirroring, it is not too deep here. There are many professional and ready -made solutions and products. There are also low -cost ideas to implement software, such as RSYNC and other tools on Linux.
    The load balancing
    The load balancing will be the ultimate solution used by large websites to solve high load access and a large number of concurrent requests. The load balancing technology has developed for many years. There are many professional service providers and products to choose from. I have personal contact with some solutions. Two of them can give you a reference.
    The four -layer exchange of hardware
    The first -layer exchange information uses the head information of the third and fourth -level information packages. According to the application interval identification business flow, the business flow of the entire interval section is allocated to the appropriate application server Processing. The fourth layer of exchange function is like a virtual IP, pointing to the physical server. It has a variety of protocols it transmitted, including HTTP, FTP, NFS, Telnet or other protocols. These businesses need to be a complex load balance algorithm based on physical servers. In the IP world, the business type is determined by the terminal TCP or UDP port address, and the application interval in the fourth layer exchange is determined by the source and terminal IP address, TCP and UDP ports. In the field of hardware exchange products, there are some well -known products to choose from, such as Alteon, F5, etc. These products are very expensive, but it is worthwhile, which can provide very good performance and flexible management capabilities. Yahoo China used to use three or four Alteon to get three or four servers in China.
    Software four -layer switching
    The principles of the four -layer switch of the hardware, the software four -layer exchange based on the OSI model is also born. Slightly worse. However, if a certain amount of pressure is satisfied, some people say that the software implementation method is actually more flexible, and the processing ability depends on the familiar ability of your configuration. We can use the LVS commonly used on Linux to solve it. LVS is Linux. He provides a solution based on the real -time disaster response solution based on the heartbeat line HeartBeat to improve the robustness of the system. Management functions can meet a variety of application needs at the same time, which is essential for distributed systems. A typical strategy of using load balancing is to build a Squid cluster on the basis of the four -layer exchange of software or hardware. This idea is adopted on many large websites including search engines. Expansion is very easy to increase or decrease nodes in the architecture at any time. I prepared for such a structure to be empty and sorted out to discuss with you in detail. For large websites, each method mentioned earlier may be used at the same time. I introduce it here. Many details in the specific implementation process also need to be familiar and appreciated. Sometimes a small Squid parameter or a small Squid parameter or a small Squid parameter or The Apache parameter setting will have a great impact on system performance. I hope everyone will discuss it together to achieve the effect of attracting bricks.

  4. I think it is a web page.
    A website is composed of several webpages, so the webpage is the basic structure of the website.
    can also be said,
    The basic structure of the website is: space, domain name, program, which are the three basic elements of the website.

Leave a Comment