Home  >  Article  >  Summary of back-end technology analysis in 2018

Summary of back-end technology analysis in 2018

小云云
小云云Original
2018-02-01 14:01:012142browse

We have previously shared with you a summary of front-end technology trends in 2018. In this article, we will share with you a summary of back-end technology analysis in 2018. We hope it will be useful to everyone.

Node.js

Although Node.js is also very popular and popular, it is still rarely seen Enterprises use Node.js as the primary programming language for the back-end side of the company. C++, Java, PHP, and Python languages ​​also have some similar solutions, including Swoole-1.0, which is also based on an asynchronous callback mode similar to Node.js.

The essential reason is that the technical solution of asynchronous callback and some optimization solutions made on it, including Promise, Future, Yield/Generator, Async/Await, etc., have changed the program Development style and habits. If you want to use these technologies, engineers need to additionally learn how to use these keywords and functions.

Using these technical solutions is not compatible with existing programs. It can be said that R&D costs are huge and it is difficult to make a smooth transition. Influenced the popularity of asynchronous callback technology stack. This programming model is difficult for everyone to accept.

Asynchronous Mode

Go language is becoming more and more popular, and many large Internet companies are turning to GO for their backends. Dubbo, a well-known service-oriented framework in the Java circle, also announced its transformation to asynchronous mode. This is a major trend, and the asynchronous model has been verified and recognized by the market.

In terms of web server selection, most people began to choose asynchronous non-blocking Nginx instead of synchronous blocking Apache a few years ago. It is because of asynchronous programs like Nginx that it has better adaptability and stronger concurrency capabilities. Now in terms of back-end business development programming, teams with strong technical capabilities have begun to switch the technology stack from synchronous mode to asynchronous mode.

Synchronous blocking mode has many defects, including weak concurrency, poor adaptability, and slow requests, which lead to service unavailability. For example: in the scenario of calling third-party API in the background interface, the synchronization mode has extremely poor effect. In the past, fewer and fewer people used the synchronous blocking mode frameworks developed using Java, PHP, C++, Python, and Ruby languages.

Coroutine

The coroutine mode takes into account the maintainability of synchronous blocking and the high concurrency capability of asynchronous non-blocking. It will become the mainstream technical solution in the field of back-end development in the future.

The most important thing is that the coroutine mode only requires a few adjustments to the existing project code to run, and is even fully compatible with old projects. Only the framework layer is required for compatibility. This allows for a smooth transition for the team.

Using the coroutine mode, developers do not need to learn additional keywords and function usage at all. The coding style is exactly the same as in synchronous mode.

Among various coroutine technologies, <span style="font-size: 14px;">GO</span> is the most dazzling one. Coroutines, channels, static languages, performance, rich compilation, rich standard libraries, complete ecology, Google, etc. There are too many advantages. GO language, I personally think is the most worth learning among all current programming languages.

<span style="font-size: 14px;">Swoole 2.x</span># Let PHP, a veteran backend programming language with a history of more than 20 years, also have coroutine capabilities. Compared with technologies like <span style="font-size: 14px;">Go</span>, the technology stack of <span style="font-size: 14px;">PHP + Swoole</span>, More suitable for rapid development, rapid iteration, and business-driven scenarios. After all, dynamic languages ​​are more flexible and more efficient in development than static languages. And <span style="font-size: 14px;">Go</span># is more suitable for writing system-level software and core business.

In 2018, I reconstructed swoole framework, a very old project. The bottom layer supports <span style="font-size: 14px;">Swoole 2.x</span> protocol program mode. The main reason is that there are many projects within the wheel company based on this framework, especially the service layer, which all uses the swoole framework. We hope that the business code will not change a single line and can be switched to coroutine mode with one click. Theoretically, other synchronous blocking PHP frameworks, such as Laravel and Yii, can only modify the underlying layer to be compatible with the <span style="font-size: 14px;">Swoole 2.x</span> coroutine to achieve seamless project code Switch coroutine mode.

After using coroutines, the performance, concurrency, and stability of the entire system have been greatly improved. In the past, the problem that a slow request often caused the entire server to get stuck online no longer exists.

PHP & Swoole

Although Swoole 2.0 is only less than two years old, compared to the 10 years of hard work of the Go language, there is still a long way to go. But compared to static languages ​​like GO, PHP + Swoole still has many advantages. PHP is simpler and easier to use. PHP is a dynamic language and is more flexible to use.

Of course, if it is a new project, it is recommended to use Swoft, a framework specially designed for <span style="font-size: 14px;">Swoole 2.x</span>. has less historical baggage and therefore greater stability.

Now with Swoole 2.0 coroutines, we are still confident in the future of PHP.

Related recommendations:

19 useful JavaScript abbreviation techniques to share

2018 web developers must not Unknown technical trend analysis

php technology improvement experience and methods


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