Home > Article > Backend Development > What skills do PHP programmers need?
This article divides PHP programmers into two categories: intermediate and advanced programmers, and explores the skills that these two categories of programmers should have.
Intermediate PHP Programmer
1.Linux
Can Smoothly use Shell scripts to complete many automated tasks; awk/sed/perl also operates well, and can complete a lot of text processing and data statistics; basically can install most non-special Linux programs (including various libraries, packages , third-party dependencies, etc., such as MongoDB/Redis/Sphinx/Luncene/SVN, etc.); understand basic Linux services, know how to view Linux performance indicator data, know basic issue tracking under Linux, etc.
2. Nginx:
Based on the first stage, understand the more complex Nginx configuration; including multi-core configuration, events, proxy_pass, sendfile/tcp_* configuration, know timeouts, etc. Relevant configuration and performance impact; know that in addition to web server, nginx can also undertake proxy server, reverse static server and other configurations; know basic nginx configuration tuning; know how to configure permissions, compile an nginx extension to nginx; know basic nginx operation Principle (master/worker mechanism, epoll), know why nginx performance is better than apache performance and other knowledge;
3. MySQL/MongoDB:
In the first stage On the basics, in terms of MySQL development, I have mastered many tips, including regular SQL optimization (group by/order by/rand optimization, etc.); in addition to being able to build MySQL, I can also hot and cold backup MySQL data, and I also know the factors that affect the performance of innodb/myisam Configuration options (such as key_buffer/query_cache /sort_buffer/innodb_buffer_pool_size/innodb_flush_log_at_trx_commit, etc.), and also know the appropriate values for configuring these options; in addition, we also know some special configuration options, such as knowing how to set up a mysql master-slave synchronization environment, and knowing each binlog_format The difference; know MySQL performance tracking, including slow_log/explain, etc., and also know basic index creation and processing; understand the basic MySQL architecture (Server storage engine) in terms of principles, and know the basic InnoDB/MyISAM index storage structure and differences (Clustered index, B-tree); know the basic InnoDB transaction processing mechanism; understand the solutions for most MySQL exceptions (or know where to find the solutions). If conditions permit, it is recommended to learn about the MongoDB database, a representative of NoSQL, and compare the differences with MySQL. Colleagues can use MongoDB safely and prudently in suitable application scenarios, and know the basic combined development of PHP and MongoDB.
4. Redis/Memcached:
In most medium-sized systems, cache processing will definitely be involved, so you must understand the basic cache; know Memcached and Redis Similarities, differences and application scenarios, be able to install Redis/Memcached independently, understand some basic features and limitations of Memcached, such as the maximum value, and know how to combine PHP with their use; understand the basic working principles and usage of Redis, understand conventional data types, and know Which types should be used in what scenarios, understand Redis transactions, etc. In the principle part, you can have a general understanding of the memory structure of Memcached (slab mechanism). Redis understands the underlying implementation storage structure of common data types (SDS/linked list/SkipList/HashTable), etc. By the way, you can learn more about Redis's transactions, RDB, AOF and other mechanisms. Good
5. PHP:
In addition to the first stage capabilities, in terms of installation and configuration, you can freely install the compilation and installation configuration of PHP and various third-party extensions; understand PHP -Most of the configuration options and meanings of fpm (such as max_requests/max_children/request_terminate_timeout and other configurations that affect performance), know the difference between mod_php/fastcgi; have become proficient in various basic technologies in PHP, including various more in-depth PHP, including in-depth understanding of PHP object-oriented/SPL/special features at the syntax level such as reflection; in terms of frameworks, I have read the code of at least one conventional PHP MVC framework, and know the internal implementation mechanism and design of the basic PHP framework Thought; in PHP development, you have become proficient in using conventional design patterns for application development (abstract factory/single case/observer/command chain/strategy/adapter, etc. patterns); it is recommended to develop your own PHP MVC framework to fully liberalize development , let yourself deeply understand the MVC model, and also enable yourself to quickly upgrade in business project development; be familiar with various code optimization methods of PHP, and be familiar with solving most PHP security problems; be familiar with the basic PHP execution mechanism principles (Zend Basic working mechanism of engine/expansion);
6. System design:
Able to design website architecture, database, and basic PHP framework selection for most medium-sized systems; performance Testing, troubleshooting, etc.; can complete basic design, development and maintenance of websites similar to: browser-> CDN (Squid) -> Nginx PHP -> cache-> database structure; can support millions to tens of millions of basic traffic every day Website development and maintenance work;
Senior PHP Programmer
Key points: In addition to the basic LNMP program, you can also have in-depth study in a certain direction or field. (Depth Dimension Development)
Goal: In addition to being able to complete basic PHP business development, you can also solve most in-depth and complex technical problems, and you can independently design and complete medium and large-scale system design and development work; you can independently Hold goes deep into a certain technical direction and is relatively professional in this area. (For example, in-depth research in any direction such as MySQL, Nginx, PHP, Redis, etc.)
1. Linux:
In addition to the second stage capabilities, under Linux In addition to regular operations and performance monitoring and tracking, you can also use many advanced and complex commands to complete the work (watch/tcpdump/starce/ldd/ar, etc.); in terms of shell scripts, you can already write relatively complex shell scripts (more than 500 lines) Shell to assist in completing many tasks including backup, automated processing, monitoring, etc.; has become proficient in applications such as awk/sed/perl, and can freely operate, control, process, text statistics and analyze data in various complex formats; has knowledge of Linux internal mechanisms Some understanding, basic processing of kernel module loading, startup error handling, etc.; also some understanding of other related things, such as NFS, disk management, etc.;
2. Nginx:
On the basis of the second stage, I have been able to operate Nginx very proficiently and can perform more in-depth operation and maintenance work on Nginx, such as monitoring, performance optimization, complex problem handling, etc.; see For personal interests, you can consider focusing on in-depth study of the working principle of Nginx, mainly starting from reading the source code, such as the specific master/worker working mechanism, Nginx internal event processing, memory management, etc.; at the same time, you can learn Nginx In the development of extensions, you can customize some of your own private extensions; at the same time, you can have a certain degree of understanding of Nginx Lua to see if it can be combined and applied to create a better model; the requirement at this stage is an in-depth understanding of the principles of Nginx, and you can consider becoming an Nginx developer In-depth professional in the direction.
3. MySQL/MongoDB:
Based on the second stage, in terms of MySQL applications, in addition to the previous basic SQL optimization, some complex tasks can also be completed. Operations, such as importing and exporting large batches of data, changing table structures or adding or deleting index fields for online large batches of data, and other high-risk operations;
In addition to installation and configuration, it has been able to handle more complex MySQL problems, such as The investigation of various problems, the solution of master-slave synchronization delay problem, cross-machine room synchronization data scheme, MySQL high-availability architecture, etc. are all involved;
is familiar with the MySQL application level and is familiar with the core key technologies of MySQL. For example, transaction mechanisms (isolation levels, locks, etc.), a certain understanding and application of triggers, partitions and other technologies;
For MySQL performance, including disk optimization (SAS migration to SSD), server optimization (memory , server itself configuration), in addition to other core performance optimization options in the second stage (innodb_log_buffer_size/back_log/table_open_cache /thread_cache_size/innodb_lock_wait_timeout, etc.), connection pool software selection application, and in-depth knowledge of operation statements such as show * (show status/show profile) Understand and be able to complete most performance problem tracing;
In-depth familiarity with MySQL backup technology, including disaster recovery and restoration, in-depth understanding of Binlog, hot and cold backup, multi-IDC backup, etc.;
In terms of MySQL principles, I have more knowledge, such as starting to read part of the source code about the working mechanism of MySQL, such as learning the source code of master-slave synchronization (replication) technology, or learning about a certain storage engine (MyISAM/Innodb/TokuDB), etc. Learn and understand the source code. If conditions permit, you can refer to the CSV engine to develop your own simple storage engine to save some data and enhance your understanding of MySQL. During this process, if you are interested, you can also consider developing in the direction of DBA.
At the MongoDB level, you can consider, for example, starting to apply MongoDB online when writing less and reading more, or doing some online data analysis and processing operations. The specific scenarios can be based on the work, but the core is to To better understand the applications of RMDBS and NoSQL in different scenarios, if conditions or interests permit, you can start to learn more about the working mechanism of MongoDB.
4. Redis/Memcached:
On the basis of the second stage, more in-depth application and learning can be achieved. Because Memcached is not particularly complex, it is recommended to read the source code, especially the memory management part, to facilitate in-depth understanding; in the
Redis part, you can do more applications of complex data structures (zset does ranking ranking operations) / Transaction processing is used to ensure atomicity in applications such as flash sale scenarios);
Mostly involve learning applications of synchronization mechanisms such as aof, and design a highly available Redis application architecture and cluster;
It is recommended that you study the source code of Redis in depth and apply the knowledge accumulated in the second stage. In particular, you can read about core event management, memory management, internal core data structure, etc. to fully understand it. If your interest allows, you can become a very professional user of Redis.
5. PHP:
As basic core skills, we need more in-depth study and application based on the second stage. In terms of basic code application, it can solve 95% of the problems encountered in PHP development and understand most of the PHP skills;
can quickly get started using most PHP frameworks within a day, and understand The advantages and disadvantages of each mainstream PHP framework can quickly and conveniently make technology selection during project development; /auto_append_file), including some complex advanced configurations and principles in the extension (such as memcache.hash_strategy in the memcached extension configuration, apc.mmap_file_mask/apc.slam_defense/apc.file_update_protection in the apc extension configuration);
Have a good understanding of the working mechanism of php, including the working mechanism of php-fpm (such as the calculation and principle of the number of processes enabled by php-fpm under different configuration machines), and have a basic familiarity with the zend engine (vm/gc/stream processing), read Have basic PHP kernel source code (or read relevant articles), have an understanding of the implementation of most core data structures (basic types/Array/Object) of PHP's internal mechanisms, and have in-depth study of the core infrastructure (zval/hashtable/gc) Understand;
Be able to carry out basic PHP extension development, understand some intermediate and advanced knowledge of extension development (minit/rinit, etc.), and be familiar with the details of different communication and interaction methods between php and apache/nginx (mod_php/fastcgi); except When developing PHP extensions, you can consider learning to develop Zend extensions to understand PHP from a lower level.
6. C/C:On the basis of the second stage, you can have a deeper understanding of the C/C language and be able to complete small and medium-sized C programs. /C system development work;
In addition to the basic C/C syntax and data structures in the second stage, you can also learn some special data structures (b-tree/rb-tree/skiplist/lsm-tree/ trie-tree, etc.) to facilitate the needs in special work;
In terms of system programming, you are familiar with multi-process and multi-thread programming; in multi-process situations, you understand most of the communication methods between multi-processes and can flexibly choose communication Method (shared memory/semaphore/pipeline, etc.);
Multi-threaded programming can well solve the problem of lock conflicts, and can develop and debug multi-threaded programs;
Network programming at the same time Be relatively familiar with, understand the differences and selections of multi-process models/multi-thread models/asynchronous network IO models, be familiar with the principles and differences of different asynchronous network IO models (select/poll/epoll/iocp, etc.), and be familiar with common asynchronous frameworks ( ACE/ICE /libev/libevent/libuv/Boost.ASIO, etc.) and use it. If you have free time, you can also look at some domestically developed libraries (such as muduo);
At the same time, you can design a good high-concurrency program architecture (leader-follow/master-worker, etc.);
Understand most of the issues in C/C back-end server development (memory management, log printing, high concurrency, front-end and back-end communication protocols, service monitoring), know RPC communication issues with various back-end services (struct/http/thirft/protobuf, etc.);
can be more familiar with using GCC and GDB to develop compilation and debugging programs, and can quickly trace and solve problems after the online program core is lost. Question;
In terms of general module development, you can accumulate or develop some general tools or libraries (such as asynchronous network frameworks, log libraries, memory pools, thread pools, etc.), but you need to be careful whether to apply them after development. Bury holes to chase bugs;
7. Front-end:Deeply understand the HTTP protocol (including each detailed protocol, special protocol code and the reasons behind it, such as 302 static file cache , 502 means that php behind nginx is down, etc.);
In addition to the previous front-end aspects of various framework application integration capabilities, if you are interested in learning the front-end aspects, you can go more in-depth, and the form is that you can develop it yourself Some front-end frameworks like jQuery, or developing a rich text editor are relatively trivial tests of JavaScript skills;
8. Language learning in other fields:Basically I have basic accumulation in PHP/C/C language. It is recommended that you try to learn different programming languages at the current stage, depending on your personal interests and hobbies. For scripting languages, you can learn Python/Ruby, and for functional programming languages, you can try Lisp. /Haskell/Scala/Erlang and the like. For static languages, you can try Java /Golang. For data statistical analysis, you can learn about the R language. If you want to change your perspective and do back-end business, you can try Node.js and the previously mentioned ones. Nginx combined with Nginx_Lua, etc.
Learning different languages is mainly to improve your own vision and the differences in problem-solving methods. For example, you will understand that in addition to processes/threads, there are also lightweight coroutines; for example, in cross-machine communication scenarios, Erlang’s solution The solution is surprisingly simple; for example, if you don't want to choose C/C, there are similarly efficient Erlang/Golang available, etc.; the main purpose is to improve your horizons.
9. Learning in other professional directions:In this stage, in addition to basic LNMP skills, we will also consider learning knowledge in other fields. These are all Yes, it depends on personal interests and long-term goals.
Currently, there are many fields to choose from, such as cloud computing (distributed storage, distributed computing, virtual machines, etc.), machine learning (data mining, pattern recognition, etc., applied to statistics, personalized recommendations), naturally Language processing (Chinese word segmentation, etc.), search engine technology, graphics and images, speech recognition, etc. In addition to these advanced ones, there are also many places where you can learn more about engineering, such as high-performance systems, mobile development (Android/IOS), computer security, embedded systems, hardware, etc.
10. System design:
Based on the second stage, system design can apply the experience and skills mastered to design relatively complex medium and large systems. It can solve most of the problems of various complex online systems and complete tasks such as browser-> CDN -> load balancing-> access layer-> Nginx PHP -> business cache-> database-> Various complex back-end RPC interactions (storage back-end, logic back-end, anti-cheating back-end, external services) -> More complex back-end business; able to support the normal development of websites with tens to hundreds of millions of traffic every day maintenance work.
The above is the detailed content of What skills do PHP programmers need?. For more information, please follow other related articles on the PHP Chinese website!