How PHP programmers can break through technical bottlenecks _php tutorials

Source: Internet
Author: User
There are several PHP developers around the development of friends, but also exposed to a lot of PHP engineers, they often doubt their future in the technical growth and development, I often give them some advice, I hope they can break themselves, have better development.

The first clear I refer to the PHP project, refers to the post-graduation work, mainly in PHP web system development, did not use its language work. Work experience in about 3-4 years, ordinary Web system (millions access, level 1000 data or business logic is not particularly complex) development of basic handy, no problem. But they would have such a characteristic:

    • In addition to PHP's non-use of other languages, a shell script may be ordered.
    • 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 the other solutions)
    • The PHP code takes the process as the main idea, the object-oriented implementation is too round, can not understand

These phper are a lack of thought when it comes to the complexity of projects or business logic that requires high performance, high concurrency, and large amounts of data (systems need to address multi-domain business issues). Can not analyze the nature of the problem, technical judgment is poor, the problem can find a temporary solution, but often in the temporary solution, the system and their own step by step toward collapse. So how do you improve yourself? How can you challenge a more demanding system?

Where is the higher challenge? In combination with my own experience, I have listed some specific challenges so that we can first have a perceptual understanding.

Where are the challenges 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 guarantee high reliability?
    • How is your PHP code performing, and what happens after you use the optimizer tool? Where are the performance bottlenecks? Do you need to write a C extension?
    • What are the characteristics of user access, read more or write more? Do you need read/write separations?
    • How is data stored? What is the write speed and readout speed? How does data increase access speed read change?
    • How do I use caching? How to consider failure? How is data consistency guaranteed?

Where are the challenges of high complexity systems?

    • Can you identify the areas that your business corresponds to? Is it one or more?
    • Can the business be reasonably abstracted, and the changes in business rules can be achieved at a very small cost?
    • Data consistency, security can be guaranteed?
    • Does it hold the method of object-oriented analysis and design?

When I list the questions you are sure to answer, I think technically you may have become an architect. How you can not yet answer, you need to strengthen in the following several directions.

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

    • Analyze the principle of the technology you use and the mechanism behind it, so that you can improve your technical judgment and improve the correctness of your technical options.
    • Learn important knowledge during college, operating system principles, data structures and algorithms. Know that you used to study for exams, but now you need to learn for yourself, let yourself know why.
    • Start learning C again, although you've already learned it in college. This is not just because you may need to write a PHP extension, but also because, in the application of C, there is an environment that is concerned with performance, memory control, variable life cycles, data structures, and algorithms.
    • Learning object-oriented analysis and design, it is an effective way to solve complex problems. Learning abstraction is the only way to solve complex problems.

"How long will it take to learn so much stuff?" If you work hard, there is a better plan, estimated to take 1-2 years.

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

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

An iterative-driven task: Locate the region by IP.

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

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

    1. How do I find through IP? Ordered data, binary lookup is the fastest.
    2. How to sort? Using the library function sort of course is OK, but that is learning, it is to achieve a quick sort of it yourself.

Learning goals: Sorting algorithms, finding algorithms.

Phper general data structure and algorithm foundation is poor, peacetime also do not have this aspect of task, oneself also do not study, therefore this aspect of knowledge is very lack. However, the problem of programming solves eventually comes down to the data structure and algorithms for manipulating this data structure. If the data structure algorithm is often in the mind, then the problem can be clearly recognized its internal structure, the solution will naturally arise.

Second iteration: Optimize the loading and sequencing of data. If you do the first step, it's basically not available because the data needs to be loaded and sorted every time, so it's too time-consuming. The idea is that once the data is loaded and sorted, it is placed in a place where every PHP process can access it.

Put it in memcache it's easy for everyone to think of. In fact, in the shared memory (EA and other accelerators are supported) is a faster way, because memcache more network operations. How do you test performance when the data is put into shared memory or chunked? How to analyze the bottleneck (xdebug)? You will learn by driving these questions.

Learning Goal: The method of detecting, locating and optimizing PHP performance; The impact of PHP implementation structure on performance.

Third iteration: Write a php extension. Performance or not to go, have to enter the world of C + +, but you will not just phper and service end of the all-round engineer, of course, this has not done the C + + students challenge is huge. I can't simply say how to learn C/C + +, you can see PHP programmer learning

Learning goals: Learning from C + +, writing PHP extensions

How do you determine the mechanisms and principles that you need to learn? How to find the driving learning task? I have no concept of what needs to be learned, how to answer the above two questions?

    1. From the positioning of this technology to find out the need to learn the focus, that is how it does (mechanism) and why it can do so (model or principle)
    2. 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 understand that JS is the dynamic language of the web domain, mainly to solve the dynamic interaction of web pages. The main points I want to learn 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 are fully self-taught, find the key points (mechanisms, models, principles) that you need to learn to set up a learning task is really not that easy to grasp. If you find an experienced person to guide you or add a learning team, the speed of learning will certainly be greatly improved.

http://www.bkjia.com/PHPjc/752340.html www.bkjia.com true http://www.bkjia.com/PHPjc/752340.html techarticle There are several PHP developers around the development of friends, but also exposed to a lot of PHP engineers, they often doubt their future in the technical growth and development, I often give them some advice, I hope they can break ...

  • 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.