iv - 2
1. Difference Java app using Apache server vs JS app using NodeJS server?
NodeJS
V8-based runtime environment -> non-blocking I/O
single-threaded runtime / single call stack
JAVA
multi-threaded, blocking I/O
2. Performance of handling the incoming request?
I/O bound (ex: file processing) (NodeJS faster than JAVA)
CPU bound (ex: complicated algorithm, compression) (NodeJS slower than JAVA)
IO bound = it would go faster if the I/O subsystem was faster.
CPU bound = it would go faster if the CPU were faster.
3. ReactJS
JQuery -> DOM mixed with data, and it is difficult to manage for larger projects.
ReactJS
lifecycle, do something in some specific stages.
re-render changing parts by computation, without full DOM re-rendered.
4. Redux
FLUX ([a]separate DOM from data, [b]a global data without passing into layers of props)
Predictable
2.1. action is pure object -> make recording and time traveling possible
2.2. reducer is pure function -> with no side effect
2.3. single store is read-only. Update it only by firing an action.
checks whether the state has been changed by doing shallow comparison.
state = reducer(action, state)
5. ReactJS compile all of JS into one BIG file.
Webpack provides many kinds of feature for code splitting, and lazy loading feature.
Server-Side-Rendering
6. why Elasticsearch
Full-Text searching function provided by SQL-Server is inadequate.
Elasticsearch ships with a wide range of built-in analyzers.
7. scale a NodeJS server?
Run a NodeJS process on every CPU core and load balance all requests among them through NodeJS's cluster mode.
Load-Balancing HTTP Server is another solution.
micro-service
Last updated
Was this helpful?