Millions technical preparation for visiting the website (i)

Source: Internet
Author: User
Keywords Servers themselves could upfront

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Open their own domain name blog, the first one to get a heavy point to the 4-dollar domain name. As a technical practitioner for ten years, stroll around for ten years to find some knowledge East a hammer West a club to look around the whole time to tidy up a clue, that I on the system point of the beginning of the step-by-step, a small web site from the day thousands of visit to the day to visit 1 million or 2 million of small sites, how to let it smoothly through this stage, not in The technology appears congenitally deficient, writes to some technical personnel, also writes to the entrepreneur who does not understand the technology.

People who know the internet have their own ideas, someone put their ideas into practice, do a website and then start operating. In fact, from the pure Web site technology, because the development of open source model, now build a small site has been very simple and cheap. When the traffic reaches a certain order of magnitude, the cost starts to soar and the problem begins to appear. Because of the increase in bandwidth, the expansion of hardware, the increase in the cost of personnel is obvious, and there is a considerable part of the cost is because of code refactoring, refactoring, and even the bottom of the development of language changes caused by the most miserable is the data loss, hard for several years, a night back to business before.

To reduce costs is to increase profits. A lot of things, we can avoid in the beginning, first lay a good foundation, you can save a lot of energy, less exercise a lot of heart. If you are a participant in the start-up of the technical staff, the current poor, what all have to do their own money, the initial hundreds of thousands of of the funds, do an application is not particularly complex site, then we should pay attention to the following points:

I. Development language

In general, the technical staff (programmers) are based on their own technical background to choose their own most familiar with the language, but considering that it is not always a person to write the program, this still need to think carefully. Regardless of the language, the final code quality is to see management, so we still from the pure language level of reality. Now the popular Java, PHP,. NET, Python, Ruby have their pros and cons, Python and Ruby, now people still relatively difficult to recruit some, performance optimization also pay some effort,. NET platform cannot afford Windows server. Java, PHP or most. For the early days, the application of almost all rely on the front-end support of the site, the advantages of a slightly larger PHP, easy to start, design patterns simple, write fast, enough performance, but not pay attention to the design pattern is its disadvantage, easy to become loose, hidden bugs slightly more difficult to maintain. Java's advantage is that the entire management process has many mature tools to assist, strong typing can avoid some of the mentally retarded bugs, most Java programmers pay more attention to design patterns, regardless of reality, the code format looks good. This is also a disadvantage, beginners may be too focused on the model and difficult to solve the actual demand.

The front end is not just HTML, CSS. The entire part that interacts with the user is the front-end, including the handler. This kind of program or the proposed use of PHP, the main reason is the rapid development, a wide range of practitioners. As for the back end such as behavior analysis, Bank interface, asynchronous message processing, and so on, the random program, that can only be based on different business needs to choose a different language.

Second, the Code version management

If the network speed between developers is similar, SVN; Most people are still svn.

If you choose SVN, there are a few considerations. One is what tree structure is used. There may be only one backbone in the beginning, and a branch will need to be established, such as a development branch, a line branch, and, later, a branch of each group. Suggest a young person choose two branch, development and online, each function local test is correct to submit to the Development Branch, the final unified test, can be integrated online when the branch. If you like to use SVN as a mobile hard disk, write a little bit of a commit does not matter, is the merger of the head larger, these people can build their own branch or even set up a local code warehouse, casually to their own branch submission, test completed and then submitted to the Development branch.

Deployment, you can deploy it either manually or automatically. Manual deployment is relatively simple, usually directly on the server SVN update, or find a new directory svn checkout, and then the Web root to ln-s past. The more complex the application, the more complex the deployment, there is no unified standard, as long as you do not use FTP upload that form is good, one is uploaded file reference inconsistent error rate increase, two is very easy to appear the version of the developer and online version inconsistent, resulting in the original want to change a typo results into a rollback of the cup. If more than one server is recommended for automatic deployment, the machine that replaces the code is temporarily withdrawn from the current service pool and then rejoin after the update is complete.

No matter how small the project, develop a good habit of using version management, at least can be as your backup, my http://zhiyi.us Although is a WordPress, but also SVN, only to change one or two CSS that is also the result of labor.

Iii. server hardware

Do not envy the big customers and the rich, look at the computer room retail area, a server lonely support of the Web site countless. If the funds are slightly adequate, it is recommended that at least three standard configurations be used for Web processing, databases, backups, respectively. The Web server needs at least 8G RAM, dual SATA RAID1, 15k SAS raid1+0 If the economy is slightly loose, or if there are more static files or pictures. Database at least 16G RAM, 15k SAS raid 1+0. The backup server is best configured to be the same as the database server. Hardware can buy their own brand of the backplane, that is, chassis with the motherboard and hard disk box, CPU memory hard drives are their own, you can also on the whole brand, can also be compatible with the machine. Three machines, the market 6, 70,000 is also a match.

The Web server can run both the program and the memory cache, the database server will only run the main database (if it is MySQL), the backup server dry more than a few, web configuration, cache configuration, database configuration to the front two consistent, so that the Web and database any one of the problems, Switch the backup server to a different IP. Backup strategy can be DRBD, can be rsync, or many other open source backup options available. The easiest way to rsync is to run it on a cron. Backup and switching, it is recommended to do more testing, choose the safest and most suitable for the business, and backup as far as possible offsite.

Four, room

Three kinds of computer room as far as possible not to choose: China Unicom to visit particularly slow telecommunications room, telecommunications access particularly slow Unicom room, telecom Unicom visit particularly slow mobile or railcom room. That netcom computer room? Pro, Netcom Unicom N long ago merged to call Unicom. A lot of search, field visits, a lot of testing, many snooping, Beijing, Shanghai, Guangzhou and other major nodes of the city, there are many high-quality computer rooms, to find a network of good quality, strict management of the room, especially the strict management, do not have access to the site, make a phone call in the past to know that other people maintain your network cable knocked off, This is a headache than DOS. I pulled a few fiber is called the room, see you to resist the risk level and psychological quality. Room can be said to be very important, directly related to the speed of Web site access, Web site access speed directly related to the user experience, I can look at the wall, but to buy a VPN to open the network you are not well-known site is difficult. Perhaps your site's Ajax is excellent, but document is not ready, some code is forever insulated from the user.

V. Framework

Initial architecture is generally relatively simple, web load Balancing + database Master + cache + Distributed storage + queue. The general direction is indeed on these things, the details of countless articles are repeated, according to the future will have more than n web,n more master-slave relationship, n multiple cache, n more than xxx design on the line, the basic plan is ready-made, but you are more powerful than others in the design of the cache when the failure to consider the avalanche effect, the main Unexpected things from synchronized data consistency and time lag, queue stability and failed retry policies, file storage efficiency, and backup methods. The cache will one day be invalidated, the database replication will one day be broken, the queue will one day write not to go in, the power will one day burn out. According to Murphy's law, if this is not considered, the site will become a tea table sooner or later.

Vi. Server Software

Linux, Nginx, PHP, MySQL, almost standard, we have to look at the name, but also choose the version. Linux distributions are numerous, as long as there are no special requirements, choose the most people, the community most active, the most convenient configuration, the most up-to-date package, such as Debian, Ubuntu. As for Rhel, do you use software that can only be run on Rhel? The rest of the Nginx, PHP, MySQL, ACTIVEMQ, and so on, unless you have changed these software or your program is really incompatible with the new version, or as much as possible version of the new, the new version, means that the new features increased , fewer bugs, more performance. There are always some hearsay people telling you that the old version is stable. The so-called stability, is relative to the special business, and on a PHP written site, most people have not changed any Server software source code, most of the situation can be a smooth upgrade to the new version. Such changes as Jdk5 to Jdk6,python2 to Python3 are relatively rare. Look at the changelog, look at the upgrade instructions, combined with their own situation assessment, the earlier the better, other people's home with PHP6 to write procedures here also PHP4 enjoyed. Good open source program upgrades or very responsible, optimistic about the document, don't be afraid.

The above six points are ready to complete, now we have a running environment, with the basic framework skeleton, with backup and switching scenarios, should begin to design and development aspects of things. There are countless things to develop, and the next one will start with some emphasis.

Original address: http://zhiyi.us/internet/thinking-twice-before-building-your-site-one.html

Reprint please indicate from Zhiyi.us.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.