<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sumit Yadav on Medium]]></title>
        <description><![CDATA[Stories by Sumit Yadav on Medium]]></description>
        <link>https://medium.com/@sumityadav_73751?source=rss-8e7846cbcddd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*f_BwM0zWyAOWFI3p.</url>
            <title>Stories by Sumit Yadav on Medium</title>
            <link>https://medium.com/@sumityadav_73751?source=rss-8e7846cbcddd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 11:24:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sumityadav_73751/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Most Common DB Performance Issue]]></title>
            <link>https://medium.com/@sumityadav_73751/most-common-db-performance-issue-ecb22b0aea0d?source=rss-8e7846cbcddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecb22b0aea0d</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[sailsjs]]></category>
            <category><![CDATA[meteor]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Sumit Yadav]]></dc:creator>
            <pubDate>Sun, 21 Apr 2019 06:54:04 GMT</pubDate>
            <atom:updated>2019-04-21T07:02:52.213Z</atom:updated>
            <content:encoded><![CDATA[<p>Assuming your code is optimized.<br>Assuming your query is optimized using indexes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZuTt0Jt1Sh2nlG7r-8X2-A.jpeg" /></figure><p>One case across most of the business apps which require <strong>multiple find query hits</strong> under the same input request don’t let you sleep overnights due to the following challenges -<br>1. Memory overflow issue due to multiple find query hits for the same input request - leads to throwing an error<br>2. If there are millions of records then paginating the find query will make you wait for a long time till it gets completed - leads to wait &amp; wait till the process is not completed</p><p><strong>Therefore, how to get rid off this?<br></strong>There are two ways to see this situation like why it’s happening, e.g. -</p><ol><li>The developer may want to accumulate or calculate some values through all records &amp; display the total outcome.<br><strong>Solution - </strong>Go with aggregate functions</li><li>The developer wants to read each record &amp; update it so that if the user visits it through any UI he doesn’t miss the update.<br><strong>Solution - <br></strong>Take this snippet away inside into any cronjob that runs periodically on n records &amp; updates it.<br>OR<br>Make it triggerable &amp; run when the user is willing to see the changes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5hhblS9ePsayTz8KWbHJQ.png" /><figcaption>List of posts</figcaption></figure><p>Let’s consider the above list is rendered after calculating views through other x-collection whose reference has been taken so far where multiple find queries have been used.<br>Remember, as this list is rendered only limited x-collection records had been read to make changes to respective posts &lt;views&gt;.<br>Similarly, the rest of (n-requested) records will be updated once the user is requesting for it to visit.</p><p>Note - Scheduler here just makes sure that it runs in background &amp; keep updating those changes so that user comes across it, he finds posts already updated. Scheduler just to make sure that it’s not necessary to wait for user’s request to visit the page or any UI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecb22b0aea0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>