大量数据转移

by BerkeleyTrue

由BerkeleyTrue

大量数据 (A Flood of Data)

Free Code Camp’s data has been doubling each month, thanks to a flood of highly-active campers. This rising tide of data has exposed several weaknesses in our codebase.

由于大量活跃的露营者,免费代码营的数据每个月都在增加一倍。 数据的上涨趋势暴露了我们代码库中的一些弱点。

What started out 15 months ago as a small effort has since grown into a vibrant open source community. Nearly 300 contributors have stepped in to help us rapidly build features.

从15个月前开始做起,到现在已经发展成为一个充满活力的开源社区。 近300位贡献者已介入以帮助我们快速构建功能。

As usual, maintaining that break-neck speed of development comes at a price. We’ve incurred a lot of technical debt.

像往常一样,保持发展的瓶颈速度是有代价的。 我们承担了很多技术债务。

Taking on technical debt is like playing Jenga — you can build your tower taller and taller, but at a cost of stability. Sooner or later, you have to pay down your technical debt, or your tower will come crashing down.

承担技术债务就像玩积木-您可以建造越来越高的塔楼,但要付出稳定的代价。 迟早,您必须还清技术债务,否则塔楼将倒塌。

Last week, our technical debt come back to bite us in our back end — both literally and figuratively.

上周,无论从字面上还是在形象上,我们的技术债务都再次给我们带来了痛苦。

During peak times, our MongoDB servers maxed out their capacity, and the rate at which they sent data back and forth to our Node servers slowed to a crawl. We needed fix this, and fast. But first, we had to figure out what was causing the issue to begin with.

在高峰时段,我们的MongoDB服务器将其容量最大化,并且将数据来回发送到Node服务器的速度减慢了爬网速度。 我们需要尽快解决此问题。 但是首先,我们必须弄清楚是什么导致了问题的开始。

We originally wrote most of our back end in a bleary-eyed crunch mode. We didn’t take the time to optimize our queries. Instead we chose to focus on features that we thought would more immediately impact our user experience.

最初,我们大多数后端都是以盲目的紧缩模式编写的。 我们没有花时间来优化查询。 相反,我们选择专注于我们认为会立即影响我们的用户体验的功能。

We audited our codebase and found a lot of frequent, inefficient writes to our databases. For instance, every time a camper completed a challenge, we would make the appropriate changes to their user instance, then call the “save” action. This caused the entire user object to be sent from our Node servers to our MongoDB servers, which then had to reconcile all of the data.

我们审核了代码库,发现对数据库的频繁,低效的写入。 例如,每次露营者完成一项挑战时,我们都会对其用户实例进行适当的更改,然后调用“保存”操作。 这导致整个用户对象从我们的节点服务器发送到我们的MongoDB服务器,然后必须协调所有数据。

This wasn’t a problem initially, because most of our user objects where small. But as we added features, user objects ballooned in size, causing lots more data to flow back and forth.

最初这不是问题,因为我们的大多数用户对象很小。 但是,随着我们添加功能,用户对象的大小Swift膨胀,导致更多的数据来回流动。

We also used to save every solution that a camper submitted. This resulted in even larger completedChallenge arrays, which further exacerbated the back-and-forth.

我们还曾经保存过露营者提交的所有解决方案。 这样就产生了更大的已完成挑战数组,这进一步加剧了前后关系。

On top of that, this meant some campers had to search through multiple solutions for the same challenge to find the one they wanted to reference. While this may have been interesting exercise for some, it was a distraction from actually coding and building projects.

最重要的是,这意味着一些露营者必须针对同一挑战搜索多个解决方案,以找到他们想参考的解决方案。 尽管对于某些人来说这可能是有趣的练习,但实际上却分散了对代码和项目的构建的注意力。

Our fix involved taking two steps:

我们的修复包括两个步骤:

  1. finding the heavily trafficked API endpoints that caused the database write, and changing them from a “save” action to an “update” action (which minimizes the volume of data sent over the wire).查找导致数据库写操作的流量大的API端点,并将其从“保存”操作更改为“更新”操作(这样可最大程度地减少通过网络发送的数据量)。
  2. transitioning the way we store completed challenges away from a giant array, and over to a key-value map.从巨大的阵列转变为存储完成的挑战的方式,然后过渡到键值图。

This way, a camper could only have one solution for each challenge. This dramatically reduced the size of the completedChallenges object.

这样,对于每个挑战,露营者只能有一个解决方案。 这大大减少了完成的挑战对象的大小。

We pushed up our fix in the middle of a Thursday afternoon, even though we had about 400 concurrent campers at the time. It was a gamble, but it paid off. We immediately saw an improvement in our CPU usage.

即使我们当时有大约400名并发露营者,我们还是在星期四下午中旬提高了定位。 这是一场赌博,但有回报。 我们立即看到CPU使用率的提高。

The big takeaway is this: if your application seems to be getting slower, there’s a good chance that this is caused by inefficient database queries.

最大的收获是:如果您的应用程序看起来越来越慢,则很有可能是由于数据库查询效率低下引起的。

If you can find these and fix them, you’ll be able to postpone expensive expansions to your infrastructure, while maintaining the speed your users have come to expect.

如果可以找到并修复它们,则可以将昂贵的扩展推迟到基础架构中,同时保持用户期望的速度。

翻译自: https://www.freecodecamp.org/news/a-flood-of-data-714f287d75a0/

大量数据转移

大量数据转移_大量数据相关推荐

  1. 新旧电脑无流量数据备份_电脑数据转移_电脑数据同步_不需要流量的电脑数据同步_将旧电脑的数据同步到新电脑

    今日入手了一台新电脑--旧电脑是啥参照我之前的博客https://blog.csdn.net/Mr_liu_666/article/details/102139752 联想G50实在是撑不住了,主要是 ...

  2. 苹果新旧手机数据转移_换手机必备软件:转移手机便签数据的APP可用敬业签

    换手机对于大家来讲,有人欢喜有人忧.为什么这么说呢?新手机带给人们的那种新鲜感足以让大家欢喜,这是毋庸置疑的,不管是什么品牌的新手机,大家都会对换手机感到开心.高兴,可是在转移手机数据时,有些人就开始 ...

  3. 数据增强_浅析数据增强

    与计算机视觉中使用图像进行数据增强不同,NLP中文本数据增强是非常罕见的.这是因为图像的一些简单操作,如将图像旋转或将其转换为灰度,并不会改变其语义.语义不变变换的存在使增强成为计算机视觉研究中 举个 ...

  4. 如何成为数据科学家_成为数据科学家的5大理由

    如何成为数据科学家 目录 (Table of Contents) Introduction介绍 Variety of Skills各种技能 Uniqueness独特性 Impact影响力 Remote ...

  5. 趣味数据故事_坏数据的好故事

    趣味数据故事 Meet Julia. She's a data engineer. Julia is responsible for ensuring that your data warehouse ...

  6. 数据创造价值_展示数据并创造价值

    数据创造价值 To create the maximum value, urgency, and leverage in a data partnership, you must present th ...

  7. 如何成为数据科学家_成为数据科学家需要了解什么

    如何成为数据科学家 Data science is one of the new, emerging fields that has the power to extract useful trend ...

  8. 什么是大数据口子_大数据分析师年薪几十万,学什么专业才能从事大数据?

    近几年,大数据为各个领域带来了全新的变革,大数据的重要性越来越被企业和国家所看到,大数据工作者的需求再次被无限放大,他们的薪资和社会地位也在不断上涨.马云在演讲中就提到,未来的时代将不是IT时代,而是 ...

  9. echart 数据视图_关于数据可视化图表的制作,你需要关注的30个小技巧

    优秀的数据可视化图表只是罗列.总结数据吗?当然不是!数据可视化其真正的价值是设计出可以被读者轻松理解的数据展示,因此在设计过程中,每一个选择,最终都应落脚于读者的体验,而非图表制作者个人. 今天就给大 ...

最新文章

  1. 路径,文件,目录,I/O常见操作汇总
  2. 快速排序算法(基于Java实现)
  3. 今天已经算一下过来有一个礼拜了,还是感觉是在熬日子似的
  4. Swift实现Touch ID验证
  5. Python第五、六种数据类型——Set(集合) and Dictionary(字典)
  6. 查看linux网络带宽
  7. Android近场通信---NFC基础(一)
  8. Liferay Dynamic CSS Filter方法的研究 - 总体过程
  9. 《21世纪英汉汉英双向词典》《朗文当代英语辞典第五版》《牛津高阶英汉双解词典第7版》...
  10. ASP.NET MVC 重点教程一周年版 第七回 UrlHelper
  11. CSDN出品,必是精品:CSDN浏览器助手!
  12. 整站下载工具 webzip
  13. shell脚本教程--Bash shell--4.流控、循环
  14. 科普知识------世界洋流[地球上有哪些洋流]
  15. 你不知道的水浒好汉,在这里!
  16. 一个无经验的大学毕业生,可以转行做程序员吗?我的真实案例
  17. 计算机usb接口指什么,端口是什么?USB口、COM1、COM2、COM3等等又是什么?
  18. 计算灰度共生矩阵GLCM
  19. Surface不占市场主导但仍关键
  20. Effective C++读书摘要--Accustoming Youself to C++

热门文章

  1. [微信小程序]计算自己手机到指定位置的距离
  2. xCode BuildSetting 设置
  3. .NET 程序设计实验 含记事本通讯录代码
  4. 从理论到实践 全面理解HTTP/2
  5. keepalived and heartbeat
  6. jfinal框架下使用c3P0连接池连接sql server 2008
  7. 获取文件最后修改时间的VC代码
  8. Swoft 2 Beta 发布,基于 Swoole 的云原生协程框架
  9. 新疆兵团开展迎新春“送文化下基层”慰问演出活动
  10. Android 应用程序集成Google 登录及二次封装