PHP programmers break through the growth bottleneck

Source: Internet
Author: User
First, I should clarify that the PHP engineer I mentioned refers to the development of WEB systems mainly using PHP after graduation and has not worked in other languages. Work experience is about 3 ~ 4 years, the general WEB system (millions of access, less than thousands of data or business logic is not particularly complex) development of the basic heart... "> <LINKhref =" http://www.php100.com//statics/styl

First, I should clarify that the PHP engineer I mentioned refers to the development of WEB systems mainly using PHP after graduation and has not worked in other languages. Work experience is about 3 ~ In the past four years, the development of common WEB systems (millions of accesses, less than million pieces of data, or business logic is not particularly complex) has been quite handy and there is no problem. But they will:

Except for PHP, shell scripts may be used in other languages.

Poor understanding of PHP (except for libraries)

Narrow knowledge (in addition to using PHP and mysql, I do not know other solutions in the face of requirements)

PHP code is mainly process-oriented, and the implementation of object-oriented is too difficult to understand.

PHPer lacks ideas when it comes to projects or business logic that require high performance, high concurrency, and a large amount of data (the system needs to solve the problem of multi-domain businesses. We cannot analyze the nature of the problem and have poor technical judgment. we can quickly find a temporary solution to the problem. However, in the constant temporary solution, the system and itself are gradually collapsing. How can we improve ourselves? How can we challenge a more difficult system?

Where are the higher challenges?

Based on my own experience, I will list some specific challenges to give you a perceptual knowledge first.

What are the challenges of high-performance systems?

How to select a WEB server? Do you want to use the fast-cgi mode?

Do you want to use the reverse proxy service? Choose full memory cache or hard disk cache?

Do I need server load balancer? Is it based on the application layer or the network layer? How can we ensure high reliability?

What is the performance of your PHP code? what is the performance of the optimization tool? Where is the performance bottleneck? Do I need to write C extensions?

What are the features of user access? is there more reads or writes? Do I need read/write splitting?

How to store data? What is the write speed and read speed? How does data increase and access speed reading change?

How to use cache? How to consider invalidation? How can we ensure data consistency?

What are the challenges of high-complexity systems?

Can I identify the business domains? Is one or more?

Can we reasonably abstract the business at a very small cost when business rules change?

Is data consistency and security guaranteed?

Whether or not the object-oriented analysis and design methods are supported

You can answer all the questions I have listed. I think you may have become an architect technically. You still cannot answer the question. you need to strengthen the question in the following ways.

How to improve and break through the bottleneck

If you cannot answer the question, you need to strengthen it in the following ways:

Analyze the principle and running mechanism of the technology you are using, which can improve your technical judgment and correctness of your technical solution selection;

Learn important knowledge, Operating System Principles, data structures, and algorithms during the university period. I know that you used to take exams, but now you need to learn for yourself and let yourself know why.

Start learning C language again, although you have already studied it in college. This is not only because you may need to write PHP extensions, but also because, in C applications, there is an environment that always cares about performance, memory control, variable lifecycle, data structures, and algorithms.

Learning object-oriented analysis and design is an effective way to solve complex problems. Learning abstraction is the only way to solve complex problems.

"How long does it take to learn so many things "?

If you work hard, you have a good plan. it may take 1 ~ We will discuss how to learn the problem in 2 years.

(Note: The following is a learning method shared by the original author Zuo Wenjian)

Learning suggestions

Effective Learning is a big problem. I have some practices, but they are scattered and difficult to summarize. Before going to bed last night, I suddenly thought of the core of RUP, "Architecture-centric, case-driven, iterative development". I used this idea to learn effective methods, it can be expressed as follows:

Focusing on principles, models, or mechanisms, task-driven, iterative learning

A little abstract. here is an example to illustrate how to learn.

Objective: to learn how to improve processing performance.

Iterative-driven task: Locate the region by IP address.

This is a common task of WEB applications. the IP database records about 10 million rows.

First iteration: implement functions without considering performance (implemented using PHP)

Because you cannot directly search for a region through the KEY (IP), it is not feasible to directly store the data or associate the array. The idea is to sort the data before searching.

1. how to search through IP addresses? For sorted data, binary search is the fastest.

2. how to sort? You can use the library function sort, of course, but you can also learn it, so you should implement quick sorting by yourself.

Learning Objectives: sorting algorithm and searching algorithm

PHPer's data structure and Algorithm basics are relatively poor, and there are no such tasks at ordinary times, and they do not learn themselves. Therefore, there is a lack of knowledge in this area. However, the problems solved by programming will eventually come down to the data structure and the algorithm used to operate on this data structure. If the data structure algorithm is always in mind, the internal structure of the data structure can be clearly recognized in the case of problems, and the solution will naturally generate.

The second iteration: Optimizing data loading and sorting

If you do the first step, it is basically unavailable because the data needs to be loaded and sorted every time, which is too time-consuming. The solution is to put the data in a place that can be accessed by every PHP process after being loaded and sorted at a time.

Put it in memcache, which is easy to think. In fact, it is faster to put it in shared memory (which is supported by accelerators such as EA), because memcache has more network operations. Whether the data is integrated into the shared memory or segmented, how can we test the performance? How to analyze the bottleneck (xdebug )? Driven by these problems, you will learn

Objective: to learn how to detect, locate, and optimize PHP performance. the impact of PHP implementation structure on performance.

Third iteration: compile PHP extension

The performance is still not good, and you have to enter the world of C/C ++, but from now on, you will not just be a PHPer server full-team engineer, of course, this is a huge challenge for those who have not done C/C ++. I can't simply talk about how to learn C/C ++ here. For more information, see PHP programmers learning C ++.

Objective: to learn C/C ++ and compile PHP extensions

How can we determine the mechanisms and principles to be learned? How can we find a learning-driven task?

I have no idea what to learn. how can I answer the above two questions?

Find out the focus of learning from the positioning of this technology, that is, how it achieves (mechanism) and why it does (model or principle)

List the most common applications of this technology, as a learning task, from simple to difficult to practice.

If I want to learn Javascript, I have a certain understanding of HTML and CSS.

First, I learned that JS is a dynamic language in the WEB field and mainly solves the dynamic interaction of WEB pages.

The main points to learn are as follows:

How JS interacts with HTML (mechanism)

What is the difference between the dynamic features of JS and other dynamic languages? (Language model)

If you are completely self-taught, it is not easy to find the key points (mechanisms, models, and principles) to be learned and set learning tasks. If you find an experienced person to guide you or add a Learning Team, the learning speed will indeed be greatly improved.

Finally, I would like to say: PHP is easy to use, but it cannot limit our growth!

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.