Skip to content

Commit 4985400

Browse files
updated
1 parent 0c99a4f commit 4985400

28 files changed

+969
-306
lines changed
100 KB
Loading
76.8 KB
Loading
7.91 KB
Loading
25.2 KB
Loading

index.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
<description>Last 10 notes on 🧠 Second Brain</description>
77
<generator>Quartz -- quartz.jzhao.xyz</generator>
88
<item>
9-
<title>How we Accidentally delete the production elastic search</title>
10-
<link>https://programmerraja.github.io/post/2025/How-we-Accidentally-delete-the-production-elastic-search</link>
11-
<guid>https://programmerraja.github.io/post/2025/How-we-Accidentally-delete-the-production-elastic-search</guid>
12-
<description>Hey Hai everyOne i am back with another interseting story and gli.</description>
13-
<pubDate>Sat, 08 Mar 2025 13:16:34 GMT</pubDate>
9+
<title>From Heroku to Kubernetes Lessons Learned in Our Migration Journey</title>
10+
<link>https://programmerraja.github.io/post/2025/From-Heroku-to-Kubernetes-Lessons-Learned-in-Our-Migration-Journey</link>
11+
<guid>https://programmerraja.github.io/post/2025/From-Heroku-to-Kubernetes-Lessons-Learned-in-Our-Migration-Journey</guid>
12+
<description>Migrating from Heroku to Kubernetes is no small feat. While Heroku provided a straightforward Platform-as-a-Service (PaaS) environment that handled many operational aspects for us, Kubernetes offers greater flexibility, scalability, and control.</description>
13+
<pubDate>Sun, 23 Mar 2025 10:07:39 GMT</pubDate>
14+
</item><item>
15+
<title>DSA</title>
16+
<link>https://programmerraja.github.io/notes/2025/DSA</link>
17+
<guid>https://programmerraja.github.io/notes/2025/DSA</guid>
18+
<description>Patterns sliding window pattern subset pattern → no reptttion and repetttion Modified binary search top k elements → use heap binary tree dfs toplogical sort two pointer two moving ...</description>
19+
<pubDate>Mon, 17 Mar 2025 14:54:19 GMT</pubDate>
1420
</item><item>
1521
<title>Sherlock Holmes: The Case of the Invalid HeloHost Error</title>
1622
<link>https://programmerraja.github.io/post/2025/Sherlock-Holmes-The-Case-of-the-Invalid-HeloHost-Error</link>
@@ -48,9 +54,9 @@
4854
<description>PROJECT ARISTOTLE Google conducted one of the best-known studies on effective software engineer- ing teams, known as Project Aristotle. The project aimed to identify the factors that make some teams more successful than others.</description>
4955
<pubDate>Mon, 13 Jan 2025 13:21:01 GMT</pubDate>
5056
</item><item>
51-
<title>Lessons from 2 Years of PR Reviews: 9 Costly Coding Mistakes</title>
52-
<link>https://programmerraja.github.io/post/2025/Lessons-from-2-Years-of-PR-Reviews--9-Costly-Coding-Mistakes</link>
53-
<guid>https://programmerraja.github.io/post/2025/Lessons-from-2-Years-of-PR-Reviews--9-Costly-Coding-Mistakes</guid>
57+
<title>Lessons from 2 Years of PR Reviews: 8 Costly Coding Mistakes</title>
58+
<link>https://programmerraja.github.io/post/2025/Lessons-from-2-Years-of-PR-Reviews-8-Costly-Coding-Mistakes</link>
59+
<guid>https://programmerraja.github.io/post/2025/Lessons-from-2-Years-of-PR-Reviews-8-Costly-Coding-Mistakes</guid>
5460
<description>Hey everyone! If you’re a regular follower, you might already know a bit about me. But if not, let me quickly introduce myself: I’m a full-stack developer, and I’ve been working at a startup for the past two years.</description>
5561
<pubDate>Sun, 12 Jan 2025 12:09:14 GMT</pubDate>
5662
</item><item>
@@ -59,12 +65,6 @@
5965
<guid>https://programmerraja.github.io/post/2025/Sherlock-Holmes-and-The-Case-Redis-Overload-During-a-DDoS-Attack</guid>
6066
<description>It was a calm day until disaster struck. We received alerts about DDoS and brute-force attacks originating from random bot IPs. Our team quickly mobilized to mitigate the attacks.</description>
6167
<pubDate>Sun, 05 Jan 2025 01:12:19 GMT</pubDate>
62-
</item><item>
63-
<title>Generative AI: A Personal Deep Dive My Notes and Insights Part -2</title>
64-
<link>https://programmerraja.github.io/post/2024/Generative-AI--A-Personal-Deep-Dive--My-Notes-and-Insights-Part--2</link>
65-
<guid>https://programmerraja.github.io/post/2024/Generative-AI--A-Personal-Deep-Dive--My-Notes-and-Insights-Part--2</guid>
66-
<description>Welcome back to part 2 of my series, Personal Deep Dive: My Notes and Insights. If you found the first post useful, you’re in for more today. If you missed it, don’t worry — you can catch up here.</description>
67-
<pubDate>Wed, 18 Dec 2024 00:57:31 GMT</pubDate>
6868
</item>
6969
</channel>
7070
</rss>

notes/2023/MongoDB-Performance-Tuning.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ <h4 id="optimizing-network-round-trips">Optimizing Network Round Trips<a role="a
9191
<figure data-rehype-pretty-code-figure><pre tabindex="0" data-language="js" data-theme="github-light github-dark"><code data-language="js" data-theme="github-light github-dark" style="display:grid;"><span data-line><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">db.millions.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">find</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({},{n:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,_id:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">batchSize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(batchsize);</span></span></code></pre></figure>
9292
<h4 id="overriding-the-optimizer-with-hints">Overriding the Optimizer with Hints<a role="anchor" aria-hidden="true" tabindex="-1" data-no-popover="true" href="#overriding-the-optimizer-with-hints" class="internal"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></a></h4>
9393
<p>We can change force this query to use a collection scan by adding a hint. If we
94-
append .<code>hint({$natural:1})</code>, we instruct MongoDB to perform a collection scan to
95-
resolve the query:</p>
94+
append .<code>hint({$natural:1})</code>, we instruct MongoDB to perform a collection scan to resolve the query:</p>
9695
<h4 id="optimizing-sort-operations">Optimizing Sort Operations<a role="anchor" aria-hidden="true" tabindex="-1" data-no-popover="true" href="#optimizing-sort-operations" class="internal"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></a></h4>
9796
<p><strong>Blocking sort</strong></p>
9897
<p>The sorting that doing without using any index is called blocking sort because the it need fetch all doc to memory and need to do sorting and return the doc to the user</p>
99-
<p>if you are going to to do a blocking sort on a large amount of data, you may need to
100-
allocate more memory for the sort. You can do this by adjusting the internal parameter
98+
<p>if you are going to to do a blocking sort on a large amount of data, you may need to allocate more memory for the sort. You can do this by adjusting the internal parameter
10199
<code>internalQueryExecMaxBlockingSortBytes</code>.</p>
102100
<figure data-rehype-pretty-code-figure><pre tabindex="0" data-language="js" data-theme="github-light github-dark"><code data-language="js" data-theme="github-light github-dark" style="display:grid;"><span data-line><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">db.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getSiblingDB</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;admin&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">runCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
103101
<span data-line><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{ setParameter: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span></span>
@@ -121,6 +119,7 @@ <h4 id="automatic-pipeline-optimizations">Automatic Pipeline Optimizations<a rol
121119
<h4 id="indexed-aggregation-sorts">Indexed Aggregation Sorts<a role="anchor" aria-hidden="true" tabindex="-1" data-no-popover="true" href="#indexed-aggregation-sorts" class="internal"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></a></h4>
122120
<ul>
123121
<li><code>$sort</code> can be utilized the index only if it in early enough the pipeline to be rolled into the initial data access operation.</li>
122+
<li></li>
124123
</ul>
125124
<figure data-rehype-pretty-code-figure><pre tabindex="0" data-language="js" data-theme="github-light github-dark"><code data-language="js" data-theme="github-light github-dark" style="display:grid;"><span data-line><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">aggregate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([</span></span>
126125
<span data-line><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{ $sort:{  d:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }},</span></span>

notes/2024/Design-pattern.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,16 @@ <h2 id="structural-design-patterns"><strong>Structural Design Patterns:</strong>
307307
</code></pre>
308308
<h2 id="design-pattern-from-project">Design pattern from project<a role="anchor" aria-hidden="true" tabindex="-1" data-no-popover="true" href="#design-pattern-from-project" class="internal"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></a></h2>
309309
<h3 id="pipeline-flow-from-pipecat">Pipeline flow from (pipecat)<a role="anchor" aria-hidden="true" tabindex="-1" data-no-popover="true" href="#pipeline-flow-from-pipecat" class="internal"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></a></h3>
310-
<p>Where used how the router in networking works</p>
310+
<p>Where used how the router in networking works where they have frame with type and each router will pass the frame to next one and check the type if they have type handle in there processor they handle and push to next one where they have direction also</p>
311+
<p>Where they push to queue
312+
sample frame</p>
313+
<figure data-rehype-pretty-code-figure><pre tabindex="0" data-language="js" data-theme="github-light github-dark"><code data-language="js" data-theme="github-light github-dark" style="display:grid;"><span data-line><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Frame</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
314+
<span data-line> </span>
315+
<span data-line><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">TYPE</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;LLM_CALL&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> -> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">each</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> router</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> will</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> check</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> and</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> if</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> they</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> have</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handler</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> for</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> this</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> they</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> will</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> else</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> push</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> to</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> next</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> one</span></span>
316+
<span data-line><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
317+
<span data-line> </span>
318+
<span data-line> </span></code></pre></figure>
319+
<p><img src="../.././../Images/Screenshot-from-2025-03-20-08-21-11.png" alt/></p>
311320
<figure data-rehype-pretty-code-figure><pre tabindex="0" data-language="js" data-theme="github-light github-dark"><code data-language="js" data-theme="github-light github-dark" style="display:grid;"><span data-line><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Step</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
312321
<span data-line><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> constructor</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
313322
<span data-line><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> this</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.fn </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fn; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Function to apply at this step</span></span>

notes/2024/Elastic-search.html

Lines changed: 7 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)