iv - 2

1. Difference Java app using Apache server vs JS app using NodeJS server?

NodeJS

  1. V8-based runtime environment -> non-blocking I/O

  2. single-threaded runtime / single call stack

JAVA

  1. 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

  1. lifecycle, do something in some specific stages.

  2. re-render changing parts by computation, without full DOM re-rendered.

4. Redux

  1. FLUX ([a]separate DOM from data, [b]a global data without passing into layers of props)

  2. 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.

  3. 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?

  1. Run a NodeJS process on every CPU core and load balance all requests among them through NodeJS's cluster mode.

  2. Load-Balancing HTTP Server is another solution.

  3. micro-service

Last updated

Was this helpful?