How to break through the technical bottleneck analysis of PHP Programmers _php Digest

Source: Internet
Author: User
Tags data structures php and mysql php code
First of all, I refer to the PHP project title, refers to the graduation work, mainly in PHP for the development of the web system, did not use its language work. Working experience is probably in 3-4 years, the common Web system (millions access, level 1000 data or business logic is not particularly complex) developed basic handy, no problem. But they're going to do something like this:

Except that PHP does not use other languages, it may point to a shell script.
The mastery of PHP is not fine (many PHP manuals are not read, except the library)
Narrow knowledge (in the face of demand, except the use of PHP and MySQL, do not know other solutions)
The PHP code takes the process as the main, thinks the object-oriented realization is too round, does not understand
These phper are lacking in the complexity of projects or business logic that requires high performance, high concurrency, and large amounts of data (the system needs to solve multiple domain business problems). Cannot analyze the nature of the problem, the technical judgment is poor, for the problem can find a temporary solution quickly, but often in the temporary solution, the system and its own step-by-step collapse. So how do you improve yourself? How can you challenge a more demanding system?

Where are the higher challenges? With my own experience, I have listed some specific challenges that will give you a sense of sensibility first.

Where is the challenge of high-performance systems?

How do I select a Web server? Do you want to use fast-cgi mode
Do you want to use the reverse proxy service? Select Full memory cache or hard disk cache?
Do you need load balancing? Is it based on the application layer or the network layer? How to ensure high reliability?
How is your PHP code performing, and what about using the optimization tool? Performance bottlenecks in there? Do you need to write a C extension?
What are the characteristics of user access, read more or write more? is read/write separation required?
How is the data stored? What is the write speed and read speed? How does the data increase access speed change?
How do I use caching? How to consider failure? How does the consistency of data guarantee?
Where is the challenge of high complexity systems?

Can you identify the areas of your business? Is it one or more?
Can a reasonable abstraction of the business be realized at a very small cost in the change of business rules?
Can data consistency and security be guaranteed?
Whether to hold the object-oriented analysis and design methods
When I list the questions that you can answer with certainty, I think you are probably basically the architect of the technology. How can you still not answer, you need to strengthen in the following directions.

How can you still not answer, you need to strengthen in the following directions:

Analyze the principle of the technology you use and the mechanism behind it, which will improve your technical judgment and improve the correctness of your technical options;
Learn important knowledge of the university, operating system principles, data structures and algorithms. Know that you used to study for the exam, but now you need to learn for yourself, let yourself know why.
Start learning C Again, even though you've learned it in college. This is not only because you may need to write PHP extensions, but also because, in the application for C, there is an environment that cares about performance, memory control, variable lifecycle, data structure, and algorithms.
Learning object-oriented analysis and design, it is an effective way to solve complex problems. Learning abstraction, it is the only way to solve complex problems.
"How long does it take to learn so many things?" If you work hard, have a better plan, it will take 1-2 years.

How to study effectively is a big problem. Some of their own practice but very fragmented, not good summary. Before I went to bed last night, I suddenly thought of the core of RUP, "architecture-centric, use-case driven, iterative development," to use this idea, the effective learning method, can be expressed: the principle, model or mechanism as the center, task-driven, iterative learning.

A little abstract, give an example to illustrate how to learn. Objective: To learn how to improve processing performance.

An iterative-driven task: Locating the location by IP.

This is a common task for Web applications, and the IP database is a record of around 10 Wan.

First iteration: Implement functionality (implemented through PHP) without regard to performance. Because it is impossible to find a region directly through key (IP), it is not possible to put it directly into the data or through an associative array. The idea is to sort the data first and then look for it.

How do I find it through IP? Ordered data, binary lookup is the fastest.
How to sort? It is OK to use the library function sort, but that is to learn, it is to achieve a quick sort of it.
Learning goals: Sorting algorithms, finding algorithms.

Phper general data structure and algorithm base is poor, usually do not have this task, they do not learn, so this knowledge is scarce. However, the problem of programming solution will eventually come down to the data structure and the algorithm for the operation of this data structure. If the data structure algorithm is often in the heart, then the problem will be able to clearly recognize its internal structure, the solution will naturally arise.

Second iteration: Optimizing the loading and sorting of data. If you do the first step, it is basically not available, because the data need to load and sort each time, so time-consuming. The solution is that the data is loaded once sorted and placed where each PHP process can be accessed.

Put it in the memcache it is easy for everyone to think of the problem. In fact, it is quicker to put it in shared memory (which is supported by accelerators, etc.), because Memcache also has more network operations. How do you test performance when the data is put into shared memory or divided into chunks? How to analyze the bottleneck (xdebug)? Driven by these problems you will learn.

Learning objectives: To detect, locate, optimize the performance of PHP methods; The performance impact of PHP implementation architecture.

Third iteration: Writing extensions to PHP. Performance or do not go, have to enter the world of C/s + +, but from then on you will not only phper and service-side of the all-round engineer, of course, this is not done to the students of C + + is a huge challenge. I can not simply say how to learn C + +, see "PHP Programmer learning C + +"

Learning objectives: C/C + + learning, PHP extension of the writing

How to determine the mechanism and principle of learning? How to find the driving learning task? I have no concept of what I need to learn, how to answer these two questions?

From the positioning of this technology to find out what needs to be learned, that is, how it works (the mechanism) and why it can do so (model or principle)
List the most common applications of this technology, as a learning task, from simple to difficult to practice.
If I need to learn JavaScript, I have some perceptual knowledge about html,css. First of all, I learned that JS is a dynamic language in the web domain, mainly to solve the dynamic interaction of web pages. The main points that I have to study are as follows:

How JS interacts with HTML (mechanism)
What is the difference between JS's dynamic characteristics and other dynamic languages? (Language model)
If you completely self-study, find the main points (mechanism, model, principle) of learning to set the learning task is not so easy to grasp. If you find an experienced person to guide you or add a learning team, the speed of learning will indeed be greatly improved.

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.