基于热替换技术推想未来的 Web 开发技术 - 题叶, JiyinYiyong - SegmentFault



基于热替换技术推想未来的 Web 开发技术 - 题叶, JiyinYiyong - SegmentFault

另外 Time Travel Debugging 还有存储每个数据操作方便重演的机制
相关的资料较多, 应该已经都注意到吧

后端代码

比如 Webpack 也能做后端代码的打包和热替换
也就能做到在 WebSocket 不关闭而情况下直接替换代码
因此结合两点之后, 实际上已经能做前后端同时热替换代码
好处就是不需要整个重载程序, 重新连接 WebSocket, 更快更方便

我后端经验不多, 前面试验的代码是用前端 MVC 的思路写的
也就是抽象出内存中的一份 Database 作为我的 Model,
同时把客户端对应的 Store 作为 View, 而 View 是容易替换的
那么代码更新过程中, Model 不受影响, View 部分轻松替换
Webpack 替换的代码是局部的, 所以说 WebSocket 不受干扰

之前问过, 后端开发对热替换似乎兴趣不大, 毕竟本身就做了解耦
数据都在 DB 当中, 不受程序的重启而影响, 所以整个重启就好
所以说不受影响, 即便生成环境所有服务器进程进行重启, 也正常
我觉得这种方式毕竟, 各种 IO 都要重新创建, 有点开销, 而且有点慢
再者, 有 WebSocket 的话, 还是需要方案来保证 WebSocket 稳定


Read full article from 基于热替换技术推想未来的 Web 开发技术 - 题叶, JiyinYiyong - SegmentFault


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts