基于Node.js的基礎(chǔ)框架設(shè)計(jì)與實(shí)現(xiàn)
發(fā)布時(shí)間:2018-03-21 15:15
本文選題:Node.js 切入點(diǎn):高并發(fā) 出處:《北京郵電大學(xué)》2017年碩士論文 論文類型:學(xué)位論文
【摘要】:隨著互聯(lián)網(wǎng)的快速發(fā)展,Web應(yīng)用變得與人們的衣食住行息息相關(guān),逐漸面臨著越來越大的高并發(fā)訪問壓力。傳統(tǒng)的Java語言、PHP語言編寫的Web應(yīng)用因?yàn)槠涠嗑程的特征并不能很好的滿足高并發(fā)、高性能的需求,因此2009年出現(xiàn)的Node.js獲得了人們的關(guān)注。Node.js的事件驅(qū)動(dòng)、異步I/O等特性使其天生具備處理高并發(fā)請(qǐng)求的能力,能夠極大提升Web服務(wù)器的并發(fā)性能。但是與Node.js的火熱程度相比,基于Node.js的Web開發(fā)框架并不成熟,因此研究基于Node.js的高性能基礎(chǔ)框架具有重要意義。本文分析了 Web開發(fā)技術(shù)的發(fā)展歷史,指出了當(dāng)前Web應(yīng)用所面臨的挑戰(zhàn),并結(jié)合當(dāng)前針對(duì)高并發(fā)、高性能的解決方案對(duì)一些大型網(wǎng)站技術(shù)架構(gòu)做了總結(jié)。為了與實(shí)踐相結(jié)合,本文設(shè)計(jì)并實(shí)現(xiàn)了一個(gè)基于Node.js基礎(chǔ)框架的量化交易系統(tǒng)。首先對(duì)量化交易系統(tǒng)做了詳細(xì)的需求分析,然后在此基礎(chǔ)上對(duì)系統(tǒng)做了詳細(xì)設(shè)計(jì)和實(shí)現(xiàn),詳細(xì)闡述了 Node.js基礎(chǔ)框架的組成結(jié)構(gòu)、系統(tǒng)的數(shù)據(jù)庫和重點(diǎn)功能模塊,最后對(duì)系統(tǒng)進(jìn)行了部署。Node.js基礎(chǔ)框架不僅具備處理高并發(fā)的能力,同時(shí)還可以滿足Web應(yīng)用對(duì)于快速開發(fā)和性能的要求。該基礎(chǔ)框架主要從以下幾點(diǎn)加強(qiáng)了 Node.js服務(wù)器的性能。第一,使用負(fù)載均衡技術(shù)彌補(bǔ)Node.js默認(rèn)的單進(jìn)程單線程運(yùn)行模式所帶來的不足,使其能夠充分利用多核處理器。第二,集成了局域NPM倉庫、緩存、RabbitMQ消息隊(duì)列等技術(shù),把Web應(yīng)用縱向拆分為多個(gè)基于REST風(fēng)格的微服務(wù),極大地提升了 Web應(yīng)用的性能和并發(fā)能力。第三,采用基于Token的鑒權(quán)機(jī)制替代session-cookie機(jī)制,實(shí)現(xiàn)了請(qǐng)求的無狀態(tài)性,使基礎(chǔ)框架更適應(yīng)微服務(wù)的部署方式。為了驗(yàn)證基礎(chǔ)框架的性能和處理高并發(fā)的能力,本文在真實(shí)環(huán)境中對(duì)基于基礎(chǔ)框架實(shí)現(xiàn)的量化交易系統(tǒng)進(jìn)行了壓力測(cè)試,并與傳統(tǒng)技術(shù)實(shí)現(xiàn)的Web服務(wù)做了對(duì)比,證明了本文的基礎(chǔ)框架具有更好的處理高并發(fā)的能力,同時(shí)對(duì)可能成為系統(tǒng)性能瓶頸的RabbitMQ消息隊(duì)列做了性能測(cè)試。最后,對(duì)基礎(chǔ)框架開發(fā)過程中出現(xiàn)的問題和不足進(jìn)行了總結(jié),并給出了對(duì)于下一步工作的規(guī)劃和展望。
[Abstract]:With the rapid development of the Internet, Web applications have become closely related to people's clothing, food, housing and transportation. The traditional Java language is written in Web because its multithreading features can not meet the needs of high concurrency and high performance. So in 2009, Node.js got the attention of event-driven .Node.js, features such as asynchronous I / O that gave it the natural ability to handle high concurrent requests and greatly improved the concurrent performance of Web servers. But compared with the popularity of Node.js, The Web development framework based on Node.js is not mature, so it is of great significance to study the high performance basic framework based on Node.js. This paper analyzes the development history of Web development technology, and points out the challenges that Web applications are facing. Combined with the current solutions for high concurrency and high performance, the technical architecture of some large websites is summarized. This paper designs and implements a quantitative trading system based on Node.js framework. The structure of Node.js basic framework, the database of the system and the key function modules are described in detail. Finally, the system is deployed. Node.js basic framework not only has the ability to deal with high concurrency. At the same time, it can meet the requirements of Web application for rapid development and performance. This basic framework mainly enhances the performance of Node.js server from the following points. First, Load balancing technique is used to make up for the shortage of Node.js 's default single-process single-thread running mode, which makes it make full use of multi-core processors. Secondly, it integrates local NPM warehouse, cache RabbitMQ message queue and so on. The vertical split of Web application into several microservices based on REST style greatly improves the performance and concurrency ability of Web application. Thirdly, the authentication mechanism based on Token is used instead of session-cookie mechanism to realize the statelessness of request. In order to verify the performance of the infrastructure and its ability to deal with high concurrency, the quantitative trading system based on the basic framework is tested in real environment. Compared with the Web services implemented by traditional technology, it is proved that the basic framework of this paper has better ability to deal with high concurrency, and at the same time, the performance test of RabbitMQ message queue which may become the bottleneck of system performance is made. The problems and shortcomings in the development of the basic framework are summarized, and the planning and prospect of the next work are given.
【學(xué)位授予單位】:北京郵電大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2017
【分類號(hào)】:TP393.09
【參考文獻(xiàn)】
相關(guān)期刊論文 前4條
1 許會(huì)元;何利力;;NodeJS的異步非阻塞I/O研究[J];工業(yè)控制計(jì)算機(jī);2015年03期
2 高原;;服務(wù)器端javascript技術(shù)研究[J];信息與電腦(理論版);2012年01期
3 賀琛,陳肇雄,黃河燕;Web緩存技術(shù)綜述[J];小型微型計(jì)算機(jī)系統(tǒng);2004年05期
4 王婉菲,王欣,張志浩;數(shù)據(jù)庫集群系統(tǒng)的研究與實(shí)施[J];微型電腦應(yīng)用;2003年10期
相關(guān)碩士學(xué)位論文 前2條
1 陳瑤;基于Node.js高并發(fā)web系統(tǒng)的研究與應(yīng)用[D];電子科技大學(xué);2014年
2 于洋;基于Ajax/REST風(fēng)格的Web Service的設(shè)計(jì)與實(shí)現(xiàn)[D];北京交通大學(xué);2010年
,本文編號(hào):1644415
本文鏈接:http://sikaile.net/guanlilunwen/ydhl/1644415.html
最近更新
教材專著