Growth bottlenecks faced by PHP engineers

Source: Internet
Author: User
Tags data structures php and php and mysql php code sort

As one of the most widely used languages in web development, PHP has a large number of fans, so are you a good programmer? At the same time, do you want to face all kinds of problems, how can I break through my bottleneck, in order to better development?

PHP Engineers face growth bottlenecks

First of all, this refers to the PHP engineer, is mainly PHP for the development of the web system, did not use its language to 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 Master of PHP is not fine (many PHP manuals are not read, except the library).

Knowledge is narrower (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. 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 not use the 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? Do you need to read and write separate?

How does the data store? Write speed and read out speed? How does the data increase access speed change?

How do I use caching? How do you think about failure? Consistency of data how to 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

The questions listed here can be answered with certainty, stating that you are probably the architect of the technology. How can you still not answer, you need to strengthen in the following directions.

How to improve, break through the bottleneck

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 all for the exam, but now you need to learn for themselves, 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 of C, there is a moment of concern about performance, memory control, variable lifecycle, data structure and algorithm environment;

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 to study effectively is a big problem. "Architecture-centric, use-case driven, iterative development", using this idea, the effective learning method can be expressed as follows: 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: Implementing functionality without considering performance (implemented in PHP)

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 do the search:

How to find the ordered data via IP, and the binary lookup is the fastest.

How do I sort? Use library function sort of course it can, but that is to learn, it is to achieve a quick sort of it.

Learning goals: Sorting algorithms, finding algorithms

Phper 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 for 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.

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 to learn, how to answer the two questions above? Identify the key to learning from the positioning of the technology, i.e. how it works and why it can do so. 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. The first thing to understand is that JavaScript is a dynamic language in the web domain, mainly to solve the dynamic interaction of web pages. The main points to learn are as follows:

How JavaScript interacts with HTML (mechanism)

Where are the dynamic features of JavaScript different from 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.

Finally, want to say to everyone: PHP because of simple and use, but not because it's simple and 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.