Front and rear end of the communication, Stream stream

Front-end communication

  1. Communication (rear end communication) (end with PC) based on a rear end
  • There is a net module Node.js
  • Using a terminal (the shell) as a client
  • Thinking Processes
  1. WebSocket H5 accomplished based on (applied to a mobile terminal)
  2. socket.io low version of the browser used

stream flow

Case: generating a compressed stream using Node.js package
FS
zlib

Separate front and rear ends, front and rear ends are not separated

  1. Market popular:
  2. Separate front and rear ends
  3. Before and after the end of the separation benefits:
  4. Development methodology optimized
  5. Hundreds of millions level data request can be processed concurrently
  6. A long time ago (10 - 13 years) before and after the end of the project is not isolated
    not isolated:
    the front - the "back end -" jsp -> before and after the end of the project integration (success)
    front-end - the "back end -" jsp -> before and after end integration projects (failure) - the front end of the second trans workers - anti back-end work - integrated
  7. Internet project development process
/* 以前老的方式是:
1.产品经理/领导/客户提出需求
2.UI做出设计图
3.前端工程师做html页面
4.后端工程师将html页面套成jsp页面(前后端强依赖,后端必须要等前端的html做好才能套jsp。如果html发生变更,就更痛了,开发效率低)
5.集成出现问题
6.前端返工
7.后端返工
8.二次集成
9.集成成功
10.交付
新的方式是:
1.产品经理/领导/客户提出需求
2.UI做出设计图
3.前后端约定接口&数据&参数 { id,name,age,sex }
4.前后端并行开发(无强依赖,可前后端并行开发,如果需求变更,只要接口&参数不变,就不用两边都修改代码,开发效率高)
5.前后端集成
6.前端页面调整
7.集成成功
8.交付
请求方式
以前老的方式是:
1.客户端请求
2.服务端的servlet或controller接收请求(后端控制路由与渲染页面,整个项目开发的权重大部分在后端)
3.调用service,dao代码完成业务逻辑
4.返回jsp
5.jsp展现一些动态的代码
新的方式是:
1.浏览器发送请求
2.直接到达html页面(前端控制路由与渲染页面,整个项目开发的权重前移)
3.html页面负责调用服务端接口产生数据(通过ajax等等,后台返回json格式数据,json数据格式因为简洁高效而取代xml)
4.填充html,展现动态效果,在页面上进行解析并操作DOM。
(有兴趣的童鞋可以访问一下阿里巴巴等大型网站,然后按一下F12,监控一下你刷新一次页面,他的http是怎么玩的,大多数都是单独请求后台数据,
使用json传输数据,而不是一个大而全的http请求把整个页面包括动+静全部返回过来) */
  1. [Internet architecture,
  2. web server: generally refers to as nginx, apache kind of server, they generally can only parse static resources.
  3. Application server: generally refers to as tomcat, jetty, resin such servers can resolve the dynamic resource can be resolved static resources, but the ability to parse static resources to no good web server. ]
    Generally only Web server can be accessed outside the network, application servers can only access the network.

Guess you like

Origin blog.csdn.net/brighter_1/article/details/93458779