Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What can Node.js do?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about what Node.js can do. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

As an intermediate layer

We usually talk about the front end and the back end, the front end is responsible for the user interface, and the back end is responsible for providing data and business interfaces. Now we add a layer between the two, the front end does not directly request the back-end business interface, but requests to the middle layer. Then the middle layer requests the business interface. Take a look at the schematic diagram:

The whole process can be described as: the client requests the Node service directly to the middle tier, and the Node service analyzes the request to see which page is needed, and then requests the corresponding data. After getting the data, it is combined with the template to make the user see the page, and then give it to the client.

So some people may think that this model is not more troublesome? In fact, let's take a look at the advantages of the middle tier:

1. Reduce client memory, project user experience is good. Unlike projects in mvvm mode, page rendering and data requests are pressed on the client side, but on the server side.

2. SEO is good, unlike mvvm mode pages generated by js, but in the server to render html characters, conducive to web pages to be searched.

3. It maintains the advantage and purpose of the separation of the front and back end, that is, the liberated back end, the back end can continue to write business code in the form of interface.

4. The scope of front-end control has increased, and it can even do server and database-level optimization. for example, nginx,redis is often used in the middle tier to optimize projects to cope with high concurrency.

The middle-tier pattern is an advance in the development model. Why have I never heard of such a good pattern? Because the cost of this model is too high, it is not necessary to adopt it if there is no project of a certain order of magnitude.

At present, many front-line manufacturers are already in use, such as Taobao and Facebook (the middle layer written by php). The trend of the Internet is often the popularity of first-tier Internet companies, first-tier Internet companies begin to adopt on a large scale, and gradually become ordinary companies also begin to popularize, so this is also a necessary skill for us to secure our jobs in the future. However, at present, there are very few materials in the middle layer, and it can be said that there are many difficulties in learning.

Make a project building tool

I believe everyone has used the project building tools mentioned here. For example, webpack, which is the most commonly used tool on the market, is one of them. So while people think that this kind of tools are magical and easy to use, have you ever thought about what language these tools are written in? In fact, they are not difficult, these tools are written in Node.

Many companies will develop their own project building tools to help companies make their projects more standard and more convenient. A good project building tool will greatly accelerate the project development efficiency of the whole company.

This type of project build tools generally require a lot of file operations, and Node's operations on iUnix streams are among the best in the current mainstream back-end languages. So more and more companies choose to use Node as a project building tool.

Do some small website back-end

Using Node as the backend may be what most people think of as Node. In fact, really in the enterprise, rarely let you use Node to do the back end. So generally speaking, it is to do some small or personal station back-end.

Thank you for reading! This is the end of this article on "what can Node.js do?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report