Joke Collection Website - Mood Talk - Why should I recommend NodeJS to back-end engineers?
Why should I recommend NodeJS to back-end engineers?
"Node.js is a JavaScript running environment on the server side, which is non-blocking and event-driven. Node.js uses V8 engine. Similarly, Node.js implements Web services similar to Apache and nginx, allowing you to build a JavaScript-based web application through it. "
I think it's not just Node.js Before we introduce any new technology, we must be clear about several issues:
What problems have we encountered?
What problems has this new technology solved, and does it fit our problems?
What are the advantages of this new technology in various solutions to our problems?
What are the new problems brought by using new technologies? Are they serious? Can we solve them?
Our problem: server-side congestion
Node.js aims to solve the problem of server blocking. Here is a simple code to explain what blocking is:
Js code:
//According to the ID, find the name in the Persons table of the database.
Var name = db.query ("Select names from people with id= 1");
//The process waits for the data query to complete, and then uses the query results.
Output (Name)
The problem of this code is that between the above two statements, during the whole data query process, the current program process is often just waiting for the return of the results, resulting in the process being blocked. For network applications with high concurrency and I/O-intensive lines, on the one hand, the process is waiting for a long time. On the other hand, in order to cope with new requests, new processes are constantly added. Such a waste will cause the QPS supported by the system to be far less than that supported by the back-end data service, which will become the bottleneck of the system. Moreover, such a system is particularly vulnerable to slow link attacks (the client deliberately does not receive or slow down the received data, thus prolonging the waiting time of the process).
- Related articles
- What about the petals of Xie Zao Lan?
- Today, because the teacher punished me for not finishing the homework I copied, the teacher made me squat in every math class. What if I can't squat well? .
- What kind of boys do post-80s girls like best? Tell me your opinion.
- When driving in the countryside at night, old drivers often say, "Don't take the gray one, but park in the dark". What does that mean?
- Beautiful Lantern Festival sentences
- A sentence expressing one's injured self-esteem
- What do you mean, let it go?
- What is the purpose and significance of marriage?
- Poetry, famous sayings and epigrams about sports
- A 4-year-old girl shouted in public, and a female college student kicked her when she got up. Who do you think has a problem with this matter?