龙枪传承 發表於 2025-3-3 08:00:00

MongoDB 8.0这个新功能碉堡了,比商业数据库还牛

<h1 style="text-align: center;">MongoDB 8.0这个新功能碉堡了,比商业数据库还牛</h1>
<h3 style="-webkit-tap-highlight-color: transparent; margin: 30px 0px 15px; padding: 0px; outline: 0px; font-weight: 400; font-size: 16px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: unset; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; visibility: visible; border: 1px none #000000;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px 0px 0px 10px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 18px; color: #222222; line-height: 1.8em; letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 2px; border-color: #000000 #000000 #000000 #009688; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">引言</span></span></h3>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify; visibility: visible;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">MongoDB 8.0已经推出有一段时间了,相比之前的版本推出的新功能,8.0版本的新功能集中在提升性能和可维护性上面,可以说是目前性能最好的一个版本。</span></p>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify; visibility: visible;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">具体来说,按照官方说法通过基准测试工具</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">YCSB</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">(通用数据库基准测试工具)验证,MongoDB 8.0展现出显著的性能提升。 相较于7.0版本,&zwnj;写入密集型场景&zwnj;(YCSB 批量写入测试)速度提升最高达&zwnj;</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">54%&zwnj;&zwnj;</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">。 &zwnj;读取性能&zwnj;方面,纯读场景(100%读取)提升&zwnj;</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">27%&zwnj;</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">,混合读写场景(95%读 + 5%写)提升</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">25%&zwnj;&zwnj;</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">。 其他场景测试中,Linkbench性能提升</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">18%&zwnj;</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">,时序数据场景(TSBS)更实现</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">60%&zwnj;</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">的加速&zwnj;。</span></p>
<span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;"><img src="https://img2024.cnblogs.com/blog/257159/202503/257159-20250302144740243-1500796773.png" alt="" /></span>
<p id="1740898062095">&nbsp;</p>
<h3 style="-webkit-tap-highlight-color: transparent; margin: 30px 0px 15px; padding: 0px; outline: 0px; font-weight: 400; font-size: 16px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: unset; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; visibility: visible; border: 1px none #000000;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px 0px 0px 10px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 18px; color: #222222; line-height: 1.8em; letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 2px; border-color: #000000 #000000 #000000 #009688; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">降级限流新功能</span></span></h3>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify; visibility: visible;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">MongoDB 8.0本人认为比较牛逼的功能是提供了</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px; visibility: visible;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">setQuerySettings</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">新命令, setQuerySettings命令可以为不同的查询模式做一些定制,其中一个功能是&ldquo;</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">拒绝查询</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">&nbsp; &rdquo;,这个功能的场景是我们的数据库有时候会遇到失控的慢查询或异常线程,设想运行过程中发现一个没命中索引的查询语句,消耗了大量资源,作为DBA你要怎么做? 第一想法肯定是要Kill掉造成问题的查询语句来缓解问题,但这并不足够,因为不断会有新的同样的查询语句涌进来,直到应用方重新修改查询语句并上线来停止这个查询,或者创建合适的索引来解决了问题,显然前者依赖应用方重新上线新查询语句,不是短时间能够完成的工作。</span></p>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">而且前者&nbsp;</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">(改语句)</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">&nbsp;没有彻底解决问题的情况下,大量资源消耗在慢查询上又会造成后者&nbsp;</span><strong style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #009688; font-weight: bold; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">(加索引)</span></strong><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">&nbsp;难以完成,而且在整个完成过程当中系统的效率会变低,因为建索引本身也是一个消耗极大的任务,即使是使用background:true在后台运行。当然也有一些简单粗暴的方案,比如禁用登录用户、 修改表名、修改数据库实例的最大连接数、杀语句等等。</span></p>
<span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;"><img src="https://img2024.cnblogs.com/blog/257159/202503/257159-20250302144759096-1439259509.png" alt="" /></span></span>
<p id="1740898080685">&nbsp;</p>
<span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">这些方案大部分都不够完美,或者说不够丝滑,基于这种情况,MongoDB 8.0提供了一个迅速拒绝某种查询模式的功能来暂时规避这种问题,所有符合查询模式或者queryHash的查询都会被直接拒绝,以此立即缓解线上问题。</span>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">这个功能通过setQuerySettings的reject实现。一点需要注意的情况是,这个配置只对新查询有效。如果一个慢查询已经在执行中,不会被立即杀掉,你仍然需要等它执行完,或人工kill掉语句。</span></p>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">查询语句拦截配置,通过queryShapeHash实现&zwnj;零代码改造的异常查询语句拦截&zwnj;&zwnj;</span></p>
<pre class="highlighter-hljs" data-tool="mdnice编辑器"><code>db.adminCommand({
&nbsp; setQuerySetting:&nbsp;'xxxxxx',
&nbsp; Settings: { Reject:&nbsp;true&nbsp;}
})
</code></pre>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">通过这个功能,就能很方便的实现数据库的降级限流,确实是非常方便。目前来看,即使是商业数据库也鲜有这种功能。</span></p>
<h3 style="-webkit-tap-highlight-color: transparent; margin: 30px 0px 15px; padding: 0px; outline: 0px; font-weight: 400; font-size: 16px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: unset; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; border: 1px none #000000;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px 0px 0px 10px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 18px; color: #222222; line-height: 1.8em; letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 2px; border-color: #000000 #000000 #000000 #009688; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">总结</span></span></h3>
<p style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; color: #000000; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0em; orphans: 2; text-indent: 0em; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; line-height: 1.8em; text-align: justify;" data-tool="mdnice编辑器"><span style="-webkit-tap-highlight-color: transparent; margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">MongoDB 8.0版本的宗旨在加强性能上,相较7.0版本,某些类型的查询和更新性能甚至提供了25%以上。 MongoDB 8.0相关的新功能还包括:时间序列增强功能、命令路径优化、使用tcmalloc内存碎片化大小减少18%、局定义读超时、持久化查询设置、高级分片功能、可查询加密增强功能等等。</span></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2024.cnblogs.com/blog/257159/202409/257159-20240908204310924-1005667056.png" alt="" class="medium-zoom-image" /></p>
<p><strong>本文版权归作者所有,未经作者同意不得转载。</strong></p><br><br>
来源:https://www.cnblogs.com/lyhabc/p/18746199/mongodb-8-0-breakthrough-performance-query-control
頁: [1]
查看完整版本: MongoDB 8.0这个新功能碉堡了,比商业数据库还牛