Technical summary

Record several main technical blocks used in the project

1 swig template

Official website http://node-swig.github.io/swig-templates/

  • Works with node.js  and major web browsers!
  • Uses a similar approach to the Django, Jinja2 and Twig template engines.
  • Express compatible.
  • Object-oriented template inheritance.
  • Apply filters and transformations to output in templates.
  • All output is automatically escaped for safe HTML rendering.
  • Supports a large number of iterations and conditions.
  • Robust without bloat.
  • Extensible and customizable.
  • Code coverage is great .

2 doT.js Template   The fastest + clean JavaScript template engine for Node.js and browsers

Official website http://olado.github.io/doT/index.html

It is characterized by being small and fast. It can be used with ajax and use template rendering to replace data to reduce the complexity of stringing.

3 modJS

modJS is a lightweight module loader provided by Baidu fex-team, similar to requirejs. But modJS is not fully compatible with canonical amd/cmd, in fact, only supports very simple global method define(id, factory). In addition factory provides 3 parameters need/export/module for referencing and exporting modules.

4 pm2 

pm2 is a process manager for Node applications with load balancing.
PM2 is perfect when you want your standalone code to utilize all CPUs on all servers, and keep processes alive forever, with 0 seconds of reload . It is very suitable for IaaS structure, but do not use it for PaaS solutions (Paas solutions will be developed later).

Note: SaaS, PaaS and IaaS are cloud service models.
        SaaS software as a service, such as Google's Gmail mailbox service. For application users.
        PaaS platform as a service. For example, Google's GAE, for development users

        IaaS Infrastructure as a Service, such as Amazon's AWS, IaaS is very useful for startups that don't know how successful a newly launched application/website will be

Main features:

built-in load balancing (using Node cluster cluster module)
running in the background for
0 seconds downtime and reloading, I understand that it means no downtime during maintenance and upgrades.
Startup scripts with Ubuntu and CentOS
stop unstable processes (avoid infinite loop)
console detection
provides HTTP API

Remote control and real-time interface API (Nodejs module, allows interaction with PM2 process manager)

5 Node's template rendering data after node-ral node requests the php interface

node-ralNode It is an industrial-grade back-end service management library  specially designed for  server-side applications. Exception handling and logging.

At present  , it node-ral has been used and verified inside and outside Baidu for a long time,  Node providing back-end service management functions for multiple products or frameworks based on it, and its performance is very stable and reliable.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325522000&siteId=291194637