search
HomeBackend DevelopmentPHP TutorialAnalysis of how to break through technical bottlenecks of PHP programmers_PHP Tutorial
Analysis of how to break through technical bottlenecks of PHP programmers_PHP TutorialJul 21, 2016 pm 03:26 PM
phphostanalyzebackhowWorkprojecttechnologygraduatebottleneckofprogrammerbreakthroughquestion

First, let me be clear about the PHP engineering questions I am referring to. I mean that after graduation, I mainly used PHP to develop WEB systems and have never worked in other languages. I have about 3 to 4 years of work experience. I am basically comfortable in developing ordinary WEB systems (million-level access, less than 1,000-level data, or the business logic is not particularly complex) without any problems. But they will point out something like this:

Do not use other languages ​​except PHP, and may click on shell scripts.
Lack of mastery of PHP (have not read many PHP manuals, except for libraries)
Narrow knowledge (faced with demand, do not know other solutions except using PHP and mysql)
PHP code Focusing on processes, I think object-oriented implementation is too convoluted and difficult to understand
These PHPers are faced with projects or business logic that require high performance, high concurrency processing, and large amounts of data (the system needs to solve business problems in multiple fields). ), lack of ideas. They are unable to analyze the essence of the problem and have poor technical judgment. They can quickly find temporary solutions to the problem, but often the system and themselves collapse step by step in the constant temporary solutions. So how do you improve yourself? How can I challenge a more difficult system?

Where are the higher challenges? Based on my own experience, I will list some specific challenges to give everyone a perceptual understanding.

What are the challenges of high-performance systems?

How to choose a WEB server? Should I use fast-cgi mode
Should I use a reverse proxy service? Choose 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 the performance of your PHP code after using optimization tools? Where is the performance bottleneck? Does it need to be written as an extension of C?
What are the characteristics of user access? Is it more reading or writing? Is read-write separation required?
How is the data stored? What are the writing and reading speeds? How does access speed change as data increases?
How to use caching? How to consider failure? How to ensure data consistency?
What are the challenges of high-complexity systems?

Can you identify the field that the business corresponds to? Is it one or multiple?
Can the business be abstracted reasonably and changes in business rules be implemented at a small cost?
Can the consistency and security of data be guaranteed?
Have you mastered object-oriented analysis and design methods?
When you can answer the questions I listed in the affirmative, I think it is basically possible for you to become an architect technically. If you can't answer it yet, you need to strengthen in the following directions.

If you still can’t answer, you need to strengthen in the following directions:

Analyze the principles of the technology you use and the mechanism behind it, which can improve your technical judgment. Improve the correctness of your choice of technical solutions;
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 study for yourself and let yourself know why.
Start learning C language again, even though you have already learned 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 life cycle, data structures and algorithms.
Learn object-oriented analysis and design, which is an effective method to solve complex problems. Learn abstraction, it is the only way to solve complex problems.
"How do you learn so many things? How long does it take to learn?" If you work hard and have a good plan, it will probably take 1 to 2 years.

How to study effectively is a big problem. I have some practice but it is very scattered and difficult to summarize. Before going to bed last night, I suddenly thought of the core of RUP, which is "architecture-centered, use case-driven, iterative development." Borrowing this idea, effective learning methods can be expressed like this: centered on principles, models or mechanisms, Task-driven, iterative learning.

It’s a bit abstract, let’s give an example to illustrate how to learn. Purpose: Learn how to improve processing performance.

Iterable-driven task: Find the location by IP.

This is a common task for WEB applications. The IP database has about 100,000 rows of records.

First iteration: Implement functionality without considering performance (implemented through PHP). Because the region cannot be searched directly through KEY (IP), simple methods such as directly placing it in the data or through an associative array will not work. The idea is to sort the data first and then search.

How to find by IP? For ordered data, binary search is the fastest.
How to sort? Of course you can use the library function sort, but since you are learning, it is better to implement quick sort yourself.
Learning objectives: Sorting algorithms, search algorithms.

PHPer generally has a poor foundation in data structures and algorithms. He usually does not have tasks in this area and does not study himself, so he lacks knowledge in this area. However, the problems solved by programming will ultimately come down to the data structure and the algorithms that operate on this data structure. If the data structure algorithm is always in your mind, you will be able to clearly understand its inner structure when you encounter a problem, and the solution will naturally emerge.

Second iteration: Optimize data loading and sorting.If you do the first step, it is basically not available because the data needs to be loaded and sorted every time, which is too time-consuming. The solution is to load and sort the data once and put it in a place where each PHP process can access it.

Put it in memcache This is an easy question for everyone. In fact, putting it in shared memory (supported by EA and other accelerators) is a faster way, because memcache also has more network operations. Is the data put into shared memory as a whole or in chunks? How to test performance? How to analyze bottlenecks (xdebug)? Driven by these issues, you will learn.

Learning objectives: Methods to detect, locate, and optimize PHP performance; the impact of PHP implementation structure on performance.

Third iteration: Writing an extension to PHP. The performance still cannot improve, and I have to enter the world of C/C++. But from now on, you will not only be a PHPer but also an all-round engineer on the server side. Of course, this will be a huge challenge for students who have never done C/C++. I can't simply explain how to learn C/C++ here. You can refer to "PHP Programmers Learn C++"

Learning goals: learning C/C++, writing PHP extensions

How to determine the need What about the mechanisms and principles of learning? How to find the driving learning tasks? I don’t have any idea about what I need to learn. How can I answer the above two questions?

Find out the key points that need to be learned from the positioning of this technology, that is, how it does it (mechanism) and why it can do it (model or principle)
List the most common aspects of this technology Application, as a learning task, is carried out from simple to difficult.
If I need to learn Javascript, I have some perceptual knowledge of HTML and CSS. First of all, I learned that JS is a dynamic language in the WEB field, which mainly solves the dynamic interaction of web pages. Then the key points I want to learn are as follows:

How JS interacts with HTML (mechanism)
What are the dynamic characteristics of JS, and how are they different from other dynamic languages? (Language model)
If you are completely self-study, find the key points that need to be learned (mechanism, model, principle). Setting learning tasks is indeed not that 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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323964.htmlTechArticleFirst of all, make it clear that the PHP engineering questions I am referring to refer to the development of WEB systems mainly using PHP after graduation. , have not worked in its language. Work experience is about 3 to 4 years, ordinary WEB system...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php怎么查找字符串是第几位php怎么查找字符串是第几位Apr 22, 2022 pm 06:48 PM

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php怎么设置implode没有分隔符php怎么设置implode没有分隔符Apr 18, 2022 pm 05:39 PM

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

php怎么去掉字符串首位的tab空白符php怎么去掉字符串首位的tab空白符Apr 22, 2022 pm 07:11 PM

在php中,可以利用ltrim()函数来去掉字符串首位的tab空白符,语法为“ltrim(string)”;当只给ltrim()函数传入一个参数,用于规定要检查的字符串时,可删除该字符串开始位置的空白字符(例空格、tab制表符、换行符等)。

php怎么将url的参数转化成数组php怎么将url的参数转化成数组Apr 21, 2022 pm 08:50 PM

转化方法:1、使用“mb_substr($url,stripos($url,"?")+1)”获取url的参数部分;2、使用“parse_str("参数部分",$arr)”将参数解析到变量中,并传入指定数组中,变量名转为键名,变量值转为键值。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function