The actual situation, with Nodejs run the business, very fast, as long as the use of its non-blocking and callback this two points, the processing speed is really the leverage. From the beginning of the year, I used Nodejs to build a similar C + + server backstage, but also want to do the same thing with friends to share, the service platform because it has been actually commercial, so the structure is relatively simple, please understand ~
First talk about the framework: 1. NET or WebSocket as the basis of communication protocol; 2. Multi-process, with parent process as daemon, child process as business process; 3. Database with MySQL, master and slave; 4. Use JSON as the primary data format.
In this way, complex business processing can be modularized, for tight coupling is put together to deal with, for loose coupling is placed in different server groups for processing. In fact, there are a lot of Java or C + + development of code, its logical structure is the same, and for many people say the efficiency problem, is actually very simple thing. How many so-called scientific operations can be found in the normal business process logic? Most of them are run logic code.
The schema diagram resembles the following:
Use Nodejs to build a server background similar to C + +. Similar to NetEase pomelo