Writing good code requires an understanding of how the language’s features fit together. Writing great code requires an understanding of how the code will actually run underneath. If you don’t, your code could cause huge hidden issues.
When we first started implementing our socket logic in Node.js, we didn’t have much experience with doing real-time operations with Node.js. We quickly learned that our socket experience with other stacks was of little use. The more we investigated, the less we understood. To find the solution, we first had to understand Node.js itself.
To start, let me give a brief explanation of how Node.js runs. Node.js is single-threaded, but to enable it to do many different things at any given time, it uses the “
... read the whole story at runnable.com.