Home  >  Article  >  Backend Development  >  Which one is easier to develop, swoole or workerman?

Which one is easier to develop, swoole or workerman?

WBOY
WBOYOriginal
2016-12-01 00:01:174114browse

I don’t know much about PHP. I just want to implement my own small project. Performance is not the most important. The ease of development is more important to me. Which framework is easier to develop?

Reply content:

In terms of performance, Swoole is developed in C language after all. In some areas such as memory management, data structure, and communication protocol analysis, it is definitely higher than Workerman developed by PHP.

Functionally, swoole provides many advanced features, let’s list a few that workerman does not have, such as SSL/TLS tunnel encryption, http2.0, asynchronous mysql driver, asynchronous redis driver, asynchronous http/websocket client, process, lock, atomic, table. In addition, Swoole 2.0 has built-in support for PHP's native coroutines. PHP code can also use coroutines similar to the Go language to implement high-concurrency network servers.

In terms of external dependencies, Workerman needs to rely on many additional third-party PHP extensions, which has relatively large limitations. These extensions are not officially maintained by PHP, and the maintainability is mixed. Some extensions are not even supported by PHP7 and have not been maintained for several years. . Swoole has basically no dependencies, and all the underlying code is controllable.

In terms of development and maintenance, Swoole's development team currently has about 18 people. The developers are basically from domestic first-tier Internet companies such as Tencent, Baidu, Alibaba, Didi, Weibo, etc. The team that supports maintenance is more stable.

Of course, the advantage of Workerman is that it is completely implemented using PHP code, and developers can directly view its source code. If you have special needs, you can also directly modify the source code to implement them. It's not that simple if you switch to swoole. Workerman does more things, including frameworks, tools and complete solutions. It will indeed be much easier for programmers who do not have much back-end programming skills. Swoole is actually just a low-level library, not a complete product that can be used. There are many PHP frameworks and programs based on swoole, such as tsf, zan php framework, hprose-swoole, zphp, swoole/framework, blink, dorarpc, SwooleDistributed, etc. etc. Ordinary developers can develop directly based on these projects.

Swoole is for experts. The threshold is relatively high and requires users to have deep skills. There is no way to answer your question about which one is easier to develop. It depends on what you want to develop and the actual situation of the team or individual. The appropriate one is the best. As someone said above, swoole will definitely become an essential skill for PHPer.
In the future, applications will use more and more interactions, and it will be difficult for PHP to keep up. However, PHP's low threshold and high development efficiency will still retain a large number of applications. And swoole can solve the shortcomings of PHP very well. If you find it difficult to use swoole directly, you can use hprose-swoole, so that you only need to focus on business implementation, and you can immediately gain cross-language and cross-platform capabilities. Use swoole. As a technological improvement. As Boss Han said: Swoole is for masters. Don't you want to be a master? Or have you always wanted to curd?
I was also struggling with how to choose between these two? Looking at the example on Workerman’s official website is very cool. I also downloaded and played it for a few days. After that it was nothing more.
Later I changed to learn swoole. To be honest, she inspires me to keep learning. . If you don’t understand something, quickly look for the official wiki, or google it if it doesn’t exist. Until you figure it out. . From the perspective of my own development and the expansion and performance in the later stages of the project, I think that as a PHPer, I think swoole is a necessary skill. Our company has used swoole extensively in various businesses of all sizes without any discomfort. Recommend swoole. Workerman's documentation is very good and has many examples. I think Workerman is easier to get started and is much more stable than Swoole.

Personal opinion. If you want to get started quickly, use workman, if you want to get more in-depth, use swoole. The swoole documentation is quite confusing. It is recommended to use Workerman, otherwise it will take you a long time to learn. It is easier to develop and choose "workerman".

When I was working on a project to interact with the WeChat Html5 page and the big screen at the beginning of the year, I faced swoole and workerman. After reading the document, I selected "workerman". It was really easy to develop! I have never been exposed to workman, but I have been exposed to swool. I feel it is very good and the function is very powerful. If the function you want to implement is not troublesome, swool can also be implemented, and if it is easy, swool is recommended.
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