<?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 Murat Keskin on Medium]]></title>
        <description><![CDATA[Stories by Murat Keskin on Medium]]></description>
        <link>https://medium.com/@eng.murat.keskin?source=rss-ff0fad5a3c5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Murat Keskin on Medium</title>
            <link>https://medium.com/@eng.murat.keskin?source=rss-ff0fad5a3c5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 16:04:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eng.murat.keskin/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[Adaptive Recurrent Reasoning: What If AI Could Decide How Long to Think?]]></title>
            <link>https://medium.com/@eng.murat.keskin/adaptive-recurrent-reasoning-what-if-ai-could-decide-how-long-to-think-ba7a3a268de7?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba7a3a268de7</guid>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 02:24:07 GMT</pubDate>
            <atom:updated>2026-10-08T02:24:07.609Z</atom:updated>
            <content:encoded><![CDATA[<p>Large language models have become dramatically better at reasoning over the last few years.</p><p>But there is still something structurally strange about the way most of them operate.</p><p>A trivial question:</p><blockquote><em>What is 2 + 2?</em></blockquote><p>and a difficult problem involving mathematics, planning, code, or scientific reasoning are ultimately processed through the same underlying network architecture.</p><p>The model may generate more tokens for the harder question, but the neural network itself does not fundamentally decide:</p><blockquote><em>“This problem is difficult. I need to run my internal reasoning process another 100 times before answering.”</em></blockquote><p>Humans do exactly that.</p><p>We spend milliseconds on easy problems and minutes, hours, or even days on difficult ones.</p><p>This raises an interesting architectural question:</p><p><strong>What if neural networks could dynamically decide how much internal computation a problem deserves?</strong></p><p>This is the idea behind what I call <strong>Adaptive Recurrent Reasoning Architecture</strong>.</p><h3>The Fixed-Depth Problem</h3><p>A simplified Transformer looks like this:</p><pre>Input<br>  ↓<br>Layer 1<br>  ↓<br>Layer 2<br>  ↓<br>Layer 3<br>  ↓<br>...<br>  ↓<br>Layer N<br>  ↓<br>Output</pre><p>Each input moves through a predefined number of layers.</p><p>Whether the model is solving:</p><pre>2 + 2</pre><p>or:</p><pre>Prove a difficult theorem and verify every intermediate assumption.</pre><p>the base computational graph has roughly the same depth.</p><p>Modern reasoning systems partially work around this problem by generating more tokens.</p><p>The process becomes:</p><pre>Question<br>   ↓<br>Token<br>   ↓<br>Token<br>   ↓<br>Token<br>   ↓<br>Token<br>   ↓<br>...<br>   ↓<br>Answer</pre><p>More difficult problems receive more <strong>test-time compute</strong>, but much of this compute happens through the generation of additional language tokens.</p><p>This works surprisingly well.</p><p>But it may not be the final architecture.</p><h3>Reasoning Should Be Adaptive</h3><p>Consider how a human approaches problems.</p><p>For an easy question:</p><pre>Question<br>↓<br>recognize<br>↓<br>answer</pre><p>For a hard question:</p><pre>Question<br>↓<br>initial hypothesis<br>↓<br>simulate<br>↓<br>find contradiction<br>↓<br>reconsider<br>↓<br>try another approach<br>↓<br>compare alternatives<br>↓<br>verify<br>↓<br>answer</pre><p>The depth of computation changes dynamically.</p><p>The brain does not say:</p><blockquote><em>Every problem gets exactly 96 reasoning steps.</em></blockquote><p>Instead, computation continues until some internal criterion is satisfied.</p><p>An artificial reasoning system could behave similarly.</p><pre>Input<br>                │<br>                ▼<br>          Reasoning Core<br>                │<br>                ▼<br>          Is this solved?<br>             /      \<br>           yes       no<br>            │         │<br>            │         ▼<br>            │   Reasoning Core<br>            │         │<br>            │         ▼<br>            │   Is this solved?<br>            │        / \<br>            │      yes  no<br>            │       │    │<br>            │       │    └─────┐<br>            │       │          │<br>            ▼       ▼          │<br>                   Output ◄────┘</pre><p>The model decides its own computational depth.</p><p>Easy problem?</p><p>Three cycles.</p><p>Hard problem?</p><p>Fifty cycles.</p><p>Extremely hard problem?</p><p>Five hundred cycles.</p><p>That is fundamentally different from simply generating longer answers.</p><h3>Recurrent Reasoning</h3><p>The key mechanism is recurrence.</p><p>Instead of having an enormous sequence of different layers:</p><pre>Layer 1<br>Layer 2<br>Layer 3<br>...<br>Layer 200</pre><p>we could have a powerful reasoning block that processes its own internal state repeatedly.</p><pre>┌────────────────────┐<br>             │                    │<br>             ▼                    │<br>Input → Reasoning Core → State ───┘<br>                           │<br>                           ▼<br>                        Output</pre><p>Mathematically, the idea is conceptually simple.</p><p>Let:</p><pre>h₀ = representation of the problem</pre><p>Then repeatedly compute:</p><pre>h₁ = R(h₀)<br>h₂ = R(h₁)<br>h₃ = R(h₂)<br>...<br>hₙ = R(hₙ₋₁)</pre><p>where R is the reasoning transformation.</p><p>The important question becomes:</p><pre>When should the model stop?</pre><p>We therefore introduce another function:</p><pre>C(hₙ)</pre><p>which estimates whether the reasoning state is sufficient.</p><p>For example:</p><pre>C(hₙ) = confidence that reasoning is complete</pre><p>If:</p><pre>C(hₙ) &gt; threshold</pre><p>the system answers.</p><p>Otherwise:</p><pre>hₙ₊₁ = R(hₙ)</pre><p>and reasoning continues.</p><h3>Why Is This Different From Chain-of-Thought?</h3><p>At first glance this sounds similar to chain-of-thought reasoning.</p><p>There is an important difference.</p><p>Chain-of-thought mainly performs computation through <strong>language tokens</strong>.</p><pre>&quot;The first thing I should consider is...&quot;<br>        ↓<br>&quot;Therefore...&quot;<br>        ↓<br>&quot;However...&quot;<br>        ↓<br>&quot;Let&#39;s try another approach...&quot;</pre><p>Language becomes the scratchpad.</p><p>Adaptive recurrent reasoning could perform much of that work in a <strong>latent representation</strong> instead.</p><p>Instead of:</p><pre>reasoning → text → reasoning → text</pre><p>we could have:</p><pre>latent state<br>    ↓<br>reasoning<br>    ↓<br>latent state<br>    ↓<br>reasoning<br>    ↓<br>latent state<br>    ↓<br>answer</pre><p>The model would not necessarily need to verbalize every intermediate thought.</p><p>This potentially changes both efficiency and capability.</p><h3>Token-Space Reasoning vs Latent Reasoning</h3><p>Today, additional reasoning often looks like:</p><pre>Token<br>Token<br>Token<br>Token<br>Token<br>Token<br>Token</pre><p>Each token has computational cost.</p><p>Each token also commits the model to a particular linguistic representation.</p><p>But some kinds of reasoning may not naturally belong in language.</p><p>Think about rotating an object in your mind.</p><p>You usually do not internally describe every geometric transformation in sentences.</p><p>Similarly, planning may involve comparing many possibilities simultaneously.</p><p>An architecture designed around latent reasoning could potentially manipulate these possibilities directly.</p><pre>Latent World State<br>                       │<br>             ┌─────────┼─────────┐<br>             ▼         ▼         ▼<br>         Hypothesis A  B         C<br>             │         │         │<br>             ▼         ▼         ▼<br>          simulate   simulate  simulate<br>             │         │         │<br>             └─────────┼─────────┘<br>                       ▼<br>                    compare<br>                       │<br>                       ▼<br>                  next state</pre><p>The final explanation could still be converted into language afterward.</p><h3>Dynamic Compute Becomes a First-Class Capability</h3><p>This architecture introduces something important:</p><p><strong>Computation becomes conditional on problem difficulty.</strong></p><p>Instead of:</p><pre>Every request ≈ same neural depth</pre><p>we get:</p><pre>Easy request<br>→ 5 units of compute</pre><pre>Medium request<br>→ 30 units</pre><pre>Difficult request<br>→ 300 units</pre><p>That could significantly change AI economics.</p><p>Today the main scaling dimensions are often:</p><pre>model size<br>training compute<br>context length<br>output tokens</pre><p>Adaptive reasoning introduces another:</p><pre>reasoning depth</pre><p>A relatively compact model could potentially become much stronger by thinking longer when necessary.</p><h3>The System Needs a Halting Mechanism</h3><p>There is an immediate problem.</p><p>If the model can continue thinking, what prevents this?</p><pre>think<br>↓<br>think<br>↓<br>think<br>↓<br>think<br>↓<br>...<br>forever</pre><p>We need a halting policy.</p><p>The system might consider:</p><pre>confidence</pre><pre>consistency</pre><pre>verification results</pre><pre>remaining uncertainty</pre><pre>expected value of additional computation</pre><pre>compute budget</pre><p>A simplified decision could be:</p><pre>Expected improvement from another reasoning cycle<br>                &gt;<br>Cost of another reasoning cycle</pre><p>If true:</p><pre>continue</pre><p>Otherwise:</p><pre>answer</pre><p>Now reasoning becomes an optimization problem.</p><h3>Verification Could Control the Loop</h3><p>A particularly powerful architecture could contain two different components.</p><pre>Reasoner<br>                │<br>                ▼<br>          candidate state<br>                │<br>                ▼<br>             Verifier<br>             /      \<br>        acceptable   insufficient<br>            │              │<br>            ▼              │<br>          Answer           │<br>                           │<br>                           └──→ Reasoner</pre><p>The verifier could ask:</p><pre>Is the solution internally consistent?</pre><pre>Were constraints violated?</pre><pre>Does the code pass tests?</pre><pre>Does the mathematical proof validate?</pre><pre>Does the proposed action match the goal?</pre><p>Reasoning continues until the verifier is sufficiently satisfied.</p><p>This becomes especially useful for coding and mathematical systems because external verification is relatively cheap.</p><p>For example:</p><pre>Generate implementation<br>        ↓<br>Run tests<br>        ↓<br>Failed<br>        ↓<br>Reason again<br>        ↓<br>Patch implementation<br>        ↓<br>Run tests<br>        ↓<br>Passed<br>        ↓<br>Finish</pre><p>At that point, reasoning is no longer simply language generation.</p><p>It becomes a feedback-driven computational process.</p><h3>Add Memory and the Architecture Becomes More Interesting</h3><p>Now imagine combining recurrent reasoning with persistent memory.</p><pre>Memory<br>                           │<br>                           ▼<br>Input → Reasoning Core → Internal State<br>            ▲                  │<br>            │                  │<br>            └──── recurrence ──┘<br>                           │<br>                           ▼<br>                        Output</pre><p>During reasoning the system could recall:</p><pre>similar past problems</pre><pre>failed approaches</pre><pre>successful strategies</pre><pre>known facts</pre><pre>procedural knowledge</pre><p>This allows reasoning to be both iterative and experience-aware.</p><p>The system stops behaving like a stateless question-answering machine.</p><p>It starts behaving more like a persistent problem solver.</p><h3>Add a World Model</h3><p>The architecture becomes even more powerful if reasoning operates over a model of the environment.</p><pre>Current State<br>     │<br>     ▼<br>Reasoning Core<br>     │<br>     ├──── Action A<br>     │        ↓<br>     │   predicted future<br>     │<br>     ├──── Action B<br>     │        ↓<br>     │   predicted future<br>     │<br>     └──── Action C<br>              ↓<br>         predicted future</pre><pre>              ↓<br>            compare<br>              ↓<br>          choose action</pre><p>The system can reason about consequences before taking actions.</p><p>This is particularly important for agents.</p><p>An agent should not only ask:</p><blockquote><em>What action can I execute?</em></blockquote><p>It should ask:</p><blockquote><em>What is likely to happen if I execute it?</em></blockquote><p>Recurrent reasoning gives the model computational space to perform that simulation.</p><h3>This Could Change Agents Dramatically</h3><p>Most current agent systems operate roughly like:</p><pre>LLM<br> ↓<br>decide<br> ↓<br>tool<br> ↓<br>observe<br> ↓<br>LLM<br> ↓<br>tool</pre><p>A stronger future agent could instead operate like:</p><pre>Observe environment<br>        ↓<br>Build internal state<br>        ↓<br>Reason<br> ↺<br>Reason<br> ↺<br>Simulate alternatives<br> ↺<br>Check constraints<br> ↺<br>Verify<br>        ↓<br>Select action<br>        ↓<br>Tool</pre><p>The distinction is significant.</p><p>The agent stops reacting immediately to every observation.</p><p>It gets an explicit <strong>deliberation phase</strong>.</p><h3>Security Also Becomes More Important</h3><p>There is a less obvious consequence.</p><p>If an agent can recursively reason for hundreds of cycles, modify plans, use memory, and generate subgoals, security cannot rely only on checking its initial prompt.</p><p>You need runtime constraints.</p><pre>Adaptive Reasoner<br>       │<br>       ▼<br>   Runtime<br>       │<br>       ├─ permissions<br>       ├─ resource budget<br>       ├─ tool policy<br>       ├─ network access<br>       ├─ memory policy<br>       └─ execution limits</pre><p>The model can think freely.</p><p>But its <strong>authority</strong> remains bounded.</p><p>This creates an important distinction:</p><pre>Intelligence<br>≠<br>Authority</pre><p>A system may be extremely capable while still being allowed to perform only limited actions.</p><p>That separation will likely become increasingly important as reasoning systems improve.</p><h3>The Architecture Could Also Reduce Model Size</h3><p>Another interesting possibility is that we may not always need bigger models.</p><p>The dominant scaling strategy has historically been:</p><pre>More parameters<br>→ better capability</pre><p>Adaptive recurrent reasoning suggests another dimension:</p><pre>Better reasoning process<br>+<br>more adaptive test-time compute<br>→ better capability</pre><p>Instead of training a 10× larger network, perhaps some tasks could be solved by allowing a smaller but highly capable network to iterate intelligently.</p><p>Not all problems will benefit equally.</p><p>But it introduces a potentially important trade-off:</p><pre>Model Size<br>        ↕<br>Reasoning Time</pre><p>A system designer could choose:</p><pre>small model + long reasoning</pre><pre>large model + short reasoning</pre><p>depending on latency, cost, and task complexity.</p><h3>What Would Need to Be Solved?</h3><p>This architecture sounds attractive, but several hard research problems remain.</p><h3>1. When should reasoning stop?</h3><p>Poor halting decisions could cause either:</p><pre>underthinking</pre><p>or:</p><pre>infinite overthinking</pre><h3>2. How do we train the recurrent reasoning state?</h3><p>If the model only receives supervision on the final answer, it may be difficult to learn useful intermediate latent transitions.</p><h3>3. How do we prevent reasoning collapse?</h3><p>Repeated application of the same transformation may cause representations to converge to useless states.</p><h3>4. How do we verify hidden reasoning?</h3><p>Latent reasoning is harder to inspect than text-based reasoning.</p><p>This creates interpretability and safety challenges.</p><h3>5. How should compute be allocated?</h3><p>The system needs to learn whether another 100 milliseconds of thinking is actually worth it.</p><h3>6. How does memory interact with recurrence?</h3><p>Repeated retrieval could create self-reinforcing errors or incorrect memories.</p><h3>7. Can reasoning be parallelized?</h3><p>Instead of:</p><pre>one reasoning trajectory</pre><p>we may want:</p><pre>trajectory A<br>trajectory B<br>trajectory C<br>trajectory D</pre><p>followed by comparison or merging.</p><p>This begins to resemble search.</p><h3>A More Radical Version</h3><p>The architecture could eventually look like this:</p><pre>INPUT<br>                          │<br>                          ▼<br>                ┌─────────────────┐<br>                │ Problem Encoder │<br>                └────────┬────────┘<br>                         ▼<br>                 Internal State<br>                         │<br>                         ▼<br>              ┌────────────────────┐<br>              │ Adaptive Reasoner  │◄────────┐<br>              └──────────┬─────────┘         │<br>                         │                   │<br>                 candidate state             │<br>                         │                   │<br>          ┌──────────────┼──────────────┐    │<br>          ▼              ▼              ▼    │<br>       Memory         World Model     Verifier<br>          │              │              │<br>          └──────────────┼──────────────┘<br>                         │<br>                         ▼<br>                 Continue reasoning?<br>                   /             \<br>                 yes              no<br>                  │                │<br>                  └────────────────┘<br>                                   ▼<br>                                 Output</pre><p>This is no longer simply:</p><blockquote><em>a Transformer that predicts the next token.</em></blockquote><p>It starts looking like a computational system containing:</p><pre>representation<br>memory<br>recurrence<br>simulation<br>verification<br>adaptive compute</pre><p>around a learned reasoning core.</p><h3>Is This the Architecture After Transformers?</h3><p>Probably not in the simplistic sense that:</p><pre>Transformers disappear tomorrow.</pre><p>Transformers are extremely useful and may remain important for a long time.</p><p>A more realistic future may be:</p><pre>Transformer<br>+<br>Recurrence<br>+<br>Memory<br>+<br>Adaptive Compute<br>+<br>Verification<br>+<br>World Models</pre><p>The breakthrough may therefore not come from replacing attention entirely.</p><p>It may come from changing the role of the Transformer.</p><p>Instead of the Transformer being <strong>the entire intelligence system</strong>, it becomes a powerful computational primitive inside a larger reasoning architecture.</p><h3>The Bigger Shift</h3><p>The most interesting change may therefore be conceptual.</p><p>Today we mostly think about AI as:</p><pre>Input<br>↓<br>Model<br>↓<br>Output</pre><p>Future systems may look much more like:</p><pre>Input<br>↓<br>Interpret<br>↓<br>Remember<br>↓<br>Reason<br>↺<br>Simulate<br>↺<br>Verify<br>↺<br>Reason<br>↓<br>Act<br>↓<br>Observe result<br>↓<br>Learn</pre><p>At that point the model is no longer simply generating an answer.</p><p>It is running a <strong>computational process whose depth depends on the problem itself</strong>.</p><p>And that may be one of the most important architectural shifts on the path from language models toward more general reasoning systems.</p><p>The next major breakthrough may not be:</p><blockquote><em>“A model with more parameters.”</em></blockquote><p>It may be:</p><blockquote><strong><em>A model that knows when it has not thought enough yet.</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba7a3a268de7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HSTS (HTTP Strict Transport Security) Nedir ve Neden Hayati Önem Taşır?]]></title>
            <link>https://medium.com/@eng.murat.keskin/hsts-http-strict-transport-security-nedir-ve-neden-hayati-%C3%B6nem-ta%C5%9F%C4%B1r-3bc2b93fb530?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc2b93fb530</guid>
            <category><![CDATA[hsts]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 19:28:04 GMT</pubDate>
            <atom:updated>2025-12-17T19:28:04.422Z</atom:updated>
            <content:encoded><![CDATA[<p>Web uygulamalarında güvenlik çoğu zaman <strong>“HTTPS kullanıyorum, yeterli”</strong> düşüncesiyle geçiştirilir. Ancak HTTPS tek başına her zaman yeterli değildir. İşte tam bu noktada <strong>HSTS (HTTP Strict Transport Security)</strong> devreye girer.</p><p>Bu yazıda HSTS’in ne olduğunu, hangi saldırıları engellediğini, nasıl uygulanması gerektiğini ve yanlış yapılandırıldığında neler olabileceğini net örneklerle anlatacağım.</p><h3>HSTS Nedir?</h3><p><strong>HTTP Strict Transport Security (HSTS)</strong>, bir web sitesinin tarayıcılara şunu söylemesini sağlar:</p><blockquote><em>“Bu siteye artık </em><strong><em>sadece HTTPS</em></strong><em> üzerinden bağlanabilirsin. HTTP’yi tamamen reddet.”</em></blockquote><p>Bu politika, sunucunun response header’larına eklenen Strict-Transport-Security başlığıyla tarayıcıya bildirilir.</p><pre>Strict-Transport-Security: max-age=31536000; includeSubDomains</pre><p>Tarayıcı bu header’ı aldıktan sonra, belirtilen süre boyunca HTTP isteklerini <strong>sunucuya bile göndermeden</strong> HTTPS’e çevirir.</p><h3>HTTPS Varken HSTS’e Neden İhtiyaç Var?</h3><p>Bu soru çok sık sorulur ve cevabı kritiktir.</p><h3>HSTS Olmadan Senaryo</h3><ol><li>Kullanıcı tarayıcıya http://example.com yazar</li><li>Sunucu 301 ile HTTPS’e yönlendirir</li><li><strong>Ancak</strong> bu ilk HTTP isteği ağdan geçer</li><li>Saldırgan (MITM) bu noktada:</li></ol><ul><li>Redirect’i engelleyebilir</li><li>Sahte sertifika gösterebilir</li><li>Session cookie’lerini çalabilir</li></ul><p>Bu saldırı türü <strong>SSL Stripping</strong> olarak bilinir.</p><h3>HSTS Varken Senaryo</h3><ul><li>Tarayıcı daha isteği göndermeden:</li><li>http://example.com ❌ https://example.com ✅</li><li>HTTP isteği <strong>hiç oluşmaz</strong></li><li>SSL Stripping mümkün olmaz</li></ul><h3>HSTS Hangi Saldırıları Engeller?</h3><ul><li>🔒 SSL Stripping</li><li>🕵️ Man-in-the-Middle (MITM)</li><li>🍪 Secure olmayan cookie ile session hijacking</li><li>🔄 HTTP → HTTPS downgrade saldırıları</li></ul><p>Bu yüzden HSTS, <strong>transport-level güvenliğin olmazsa olmazıdır</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc2b93fb530" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EC2 SSH Locked Out? Don’t Delete Your Server. Use the “Root Volume Attach” Rescue Method]]></title>
            <link>https://medium.com/@eng.murat.keskin/ec2-ssh-locked-out-dont-delete-your-server-use-the-root-volume-attach-rescue-method-c4554aadd0b6?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4554aadd0b6</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[disk]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 19:15:01 GMT</pubDate>
            <atom:updated>2025-12-15T19:15:01.778Z</atom:updated>
            <content:encoded><![CDATA[<p>If your EC2 instance status shows “Running” but you suddenly cannot SSH into it, you are not alone.</p><p>Most developers’ first instinct is to panic or terminate the instance to rebuild it from scratch. However, if your server contains uncommitted code, logs, or database files that haven’t been backed up, a rebuild is a disaster.</p><p>The good news is: <strong>You do not need to delete your server.</strong></p><p>In this guide, we will walk through the standard AWS recovery technique known as <strong>“Root Volume Attach Rescue.”</strong> This method is the cloud equivalent of unplugging a hard drive from a broken computer, connecting it to a healthy computer to fix the files, and then plugging it back in.</p><p>Specifically tailored for <strong>Amazon Linux 2023</strong> and <strong>Nitro-based instances</strong> (where disks appear as NVMe devices), this guide will help you regain access to your locked server in about 15 minutes.</p><h3>Why Does SSH Fail?</h3><p>Usually, the hardware is fine, but a configuration error within the file system is blocking access:</p><ol><li><strong>Missing Keys:</strong> The authorized_keys file may have been deleted or overwritten.</li><li><strong>Permissions:</strong> The permissions on the .ssh directory may be incorrect. SSH is extremely strict; if permissions are too open, it will reject the connection.</li><li><strong>Service Failure:</strong> The sshd daemon might not be running.</li><li><strong>Resource Exhaustion:</strong> The server might be frozen due to high RAM usage.</li></ol><p>Regardless of the cause, the solution is the same: repair the disk externally.</p><h3>Prerequisites</h3><p>Before starting, ensure you have:</p><ul><li><strong>The Broken Instance:</strong> The server you cannot access.</li><li><strong>A Rescue Instance:</strong> A temporary instance that must be in the <strong>same Availability Zone (AZ)</strong> as the broken one (e.g., if the broken one is in us-east-1a, the rescue instance must also be in us-east-1a).</li><li><strong>Your PEM Key:</strong> The original key pair file for the server.</li></ul><h3>Step-by-Step Rescue Guide</h3><h3>Step 1: Stop the Broken Instance</h3><p>Go to the AWS Console, select the broken instance, and choose <strong>Instance State &gt; Stop</strong>.</p><blockquote><strong><em>Warning:</em></strong><em> Do not choose “Terminate” (data will be lost) or “Reboot” (this will not fix the issue). The instance must be fully stopped to detach the disk.</em></blockquote><h3>Step 2: Detach the Root Volume</h3><ol><li>Navigate to the <strong>Storage</strong> tab of the broken instance.</li><li>Click the Volume ID for the root device (usually listed as /dev/xvda).</li><li>In the Volumes menu, select <strong>Actions &gt; Detach Volume</strong>.</li><li>Wait until the volume state changes to <strong>“Available.”</strong></li></ol><h3>Step 3: Launch a Rescue Instance</h3><p>If you do not have another working server in the same zone, launch a new one:</p><ul><li><strong>AMI:</strong> Amazon Linux 2023 (Matching the OS makes troubleshooting easier).</li><li><strong>AZ:</strong> Must match the broken instance’s AZ.</li><li><strong>Key Pair:</strong> Select your existing PEM key.</li></ul><h3>Step 4: Attach the Volume to the Rescue Instance</h3><ol><li>Go back to the <strong>Volumes</strong> page and select the detached volume (the one from the broken server).</li><li>Select <strong>Actions &gt; Attach Volume</strong>.</li><li>Select the <strong>Rescue Instance</strong>.</li><li>For the Device Name, enter /dev/sdf.</li></ol><h3>Step 5: Identify the Correct Disk</h3><p>Connect to your Rescue Instance via SSH. On Nitro-based systems, even though you attached the disk as /dev/sdf, Linux will recognize it as an NVMe device. To avoid formatting the wrong disk, run:</p><pre>lsblk -f</pre><p>Or use the nvme-cli tool for a clearer view:</p><pre>sudo dnf install -y nvme-cli<br>sudo nvme list</pre><p>This will map the device names to volume IDs. Typically:</p><ul><li>/dev/nvme0n1: The Rescue instance&#39;s own root disk.</li><li>/dev/nvme1n1: The broken attached disk you need to fix.</li></ul><h3>Step 6: Mount the Disk (The XFS Issue)</h3><p>Create a directory and mount the partition.</p><pre># Create mount point<br>sudo mkdir -p /mnt/rescue</pre><pre># Mount the partition<br>sudo mount -o rw,nouuid /dev/nvme1n1p1 /mnt/rescue</pre><blockquote><strong><em>Why </em></strong><strong><em>nouuid?</em></strong><em> Amazon Linux typically uses the XFS file system. If the disk was created from a snapshot, it may share a UUID with the rescue disk. Mounting will fail due to a UUID conflict unless you use the </em><em>nouuid flag.</em></blockquote><p>Verify the mount:</p><pre>ls /mnt/rescue</pre><p>If you see directories like home, etc, and var, you have successfully accessed the broken server&#39;s file system.</p><h3>Step 7: Fix SSH Access</h3><p>Now that you have access to the files, you can repair the configuration. The most reliable method is to copy a known working key and reset permissions.</p><p>7.1. Copy the working key:</p><p>Since you are successfully logged into the Rescue instance, copy its authorized_keys to the broken disk:</p><p>Bash</p><pre>sudo cp -f /home/ec2-user/.ssh/authorized_keys /mnt/rescue/home/ec2-user/.ssh/authorized_keys</pre><p>7.2. Fix Permissions (Critical):</p><p>Incorrect permissions cause most SSH failures. Run the following commands:</p><pre># Fix ownership<br>sudo chown -R ec2-user:ec2-user /mnt/rescue/home/ec2-user/.ssh</pre><pre># Directory permissions (700)<br>sudo chmod 700 /mnt/rescue/home/ec2-user/.ssh</pre><pre># File permissions (600)<br>sudo chmod 600 /mnt/rescue/home/ec2-user/.ssh/authorized_keys</pre><h3>Step 8: Clean Up and Revert</h3><ul><li><strong>Unmount the disk:</strong></li><li>sudo umount /mnt/rescue</li><li><strong>Detach the volume:</strong> Go to the AWS Console and detach the volume from the Rescue instance.</li><li><strong>Reattach to original:</strong></li><li>Select the volume and click <strong>Attach Volume</strong>.</li><li>Select the original (broken) instance.</li><li><strong>Device Name:</strong> Enter /dev/xvda. (This is crucial; it must be mapped as the root device to boot).</li><li><strong>Start the instance:</strong> Start your original instance.</li></ul><p>After a few minutes, attempt to SSH into the instance using its new Public IP. You should now have access.</p><h3>Conclusion</h3><p>The “Root Volume Attach” rescue method is a powerful example of the flexibility of cloud computing. Treat your instance storage as modular components rather than fixed hardware. By mastering this technique, you can save hours of rebuilding time and ensure your data remains safe, even when SSH fails.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4554aadd0b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding ConcurrentHashMap in Scala: A Deep Dive into Thread-Safe Collections]]></title>
            <link>https://medium.com/@eng.murat.keskin/understanding-concurrenthashmap-in-scala-a-deep-dive-into-thread-safe-collections-bd7d47fc262e?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd7d47fc262e</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[hasmap]]></category>
            <category><![CDATA[concurrent-programming]]></category>
            <category><![CDATA[scala]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 13:35:26 GMT</pubDate>
            <atom:updated>2025-11-06T13:35:26.406Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the world of concurrent programming, data races and thread safety issues can turn a perfectly working application into a nightmare of intermittent bugs. Today, we’ll explore one of Java’s most powerful concurrent data structures — ConcurrentHashMap - and how to leverage it effectively in Scala applications.</p><h3>The Problem: Why Thread Safety Matters</h3><p>Imagine you’re building a rate limiter for a web application. Multiple requests arrive simultaneously, each handled by different threads. Your rate limiter needs to track request counts per IP address:</p><pre>// ❌ The Dangerous Approach<br>val requestCounts = mutable.HashMap[String, Int]()</pre><pre>def checkRateLimit(ip: String): Boolean = {<br>  val count = requestCounts.getOrElse(ip, 0)<br>  if (count &gt;= 100) {<br>    false // Rate limit exceeded<br>  } else {<br>    requestCounts.put(ip, count + 1)<br>    true<br>  }<br>}</pre><p><strong>What’s wrong here?</strong></p><p>Consider this scenario:</p><ul><li>Thread 1 reads count for IP “192.168.1.1”: 99</li><li>Thread 2 reads count for IP “192.168.1.1”: 99 (simultaneously!)</li><li>Thread 1 checks: 99 &lt; 100, writes 100</li><li>Thread 2 checks: 99 &lt; 100, writes 100</li></ul><p><strong>Result:</strong> Two requests passed, but only one was counted. Your rate limiter just got bypassed!</p><h3>The Solution: ConcurrentHashMap</h3><p>ConcurrentHashMap is a thread-safe implementation of the Map interface that provides:</p><ol><li><strong>Lock-free reads</strong> in most cases</li><li><strong>Fine-grained locking</strong> for writes (segment-based)</li><li><strong>No ConcurrentModificationException</strong> during iteration</li><li><strong>Better performance</strong> than synchronized HashMap</li></ol><h3>Real-World Example: Rate Limiter Service</h3><p>Let’s build a production-ready rate limiter using ConcurrentHashMap:</p><pre>import java.time.Instant<br>import java.util.concurrent.ConcurrentHashMap<br>import scala.jdk.CollectionConverters._</pre><pre>class RateLimiterService {<br>  // Configuration<br>  private val maxRequests = 100<br>  private val windowMillis = 60000L // 1 minute<br>  <br>  // Thread-safe storage: IP -&gt; (request_count, window_start_time)<br>  private val ipRequestCounts = <br>    new ConcurrentHashMap[String, (Int, Instant)]().asScala<br>  <br>  def isAllowed(ip: String): Boolean = {<br>    val now = Instant.now()<br>    <br>    ipRequestCounts.get(ip) match {<br>      case Some((count, windowStart)) <br>        if now.isBefore(windowStart.plusMillis(windowMillis)) =&gt;<br>        // Same window - check limit<br>        if (count &gt;= maxRequests) {<br>          false // Rate limit exceeded<br>        } else {<br>          ipRequestCounts.update(ip, (count + 1, windowStart))<br>          true<br>        }<br>      <br>      case _ =&gt;<br>        // New window - reset counter<br>        ipRequestCounts.put(ip, (1, now))<br>        true<br>    }<br>  }<br>}</pre><h3>Why This Works</h3><p><strong>Thread Safety:</strong></p><ul><li>get() operations are atomic</li><li>put() and update() operations are atomic</li><li>No race conditions possible</li></ul><p><strong>Performance:</strong></p><ul><li>Segment-based locking allows concurrent access to different IPs</li><li>Lock-free reads in most scenarios</li><li>Scales well with high concurrency</li></ul><h3>How ConcurrentHashMap Works Internally</h3><h3>Traditional HashMap with Synchronization</h3><pre>┌─────────────────────────────────┐<br>│     Entire HashMap              │<br>│  [Thread 1 locks EVERYTHING]    │ ← Only one thread at a time<br>│  [Thread 2 waits...]            │<br>│  [Thread 3 waits...]            │<br>└─────────────────────────────────┘</pre><p><strong>Problem:</strong> All threads block each other, even when accessing different keys!</p><h3>ConcurrentHashMap: Segment-Based Locking</h3><pre>┌──────────┬──────────┬──────────┬──────────┐<br>│ Segment 0│ Segment 1│ Segment 2│ Segment 3│<br>│ Thread 1 │          │ Thread 2 │          │<br>│ (Lock 0) │ (Free)   │ (Lock 2) │ (Free)   │<br>└──────────┴──────────┴──────────┴──────────┘</pre><p><strong>Benefits:</strong></p><ul><li>Multiple threads can access different segments simultaneously</li><li>Only threads accessing the <strong>same segment</strong> wait for each other</li><li>Dramatically better concurrency</li></ul><h3>Scala Integration: .asScala Magic</h3><pre>// Java ConcurrentHashMap<br>val javaMap = new ConcurrentHashMap[String, Int]()</pre><pre>// Convert to Scala mutable Map<br>val scalaMap = javaMap.asScala</pre><p><strong>Why convert?</strong></p><ul><li>Use Scala’s elegant collection methods: filter, map, collect</li><li>Maintain Java’s thread-safe implementation underneath</li><li>Best of both worlds!</li></ul><h3>Practical Example: Cleanup Operation</h3><pre>def cleanup(): Unit = {<br>  val now = Instant.now()<br>  val cutoff = now.minusMillis(windowMillis * 2)<br>  <br>  // Find expired entries<br>  val expiredIps = ipRequestCounts.collect {<br>    case (ip, (_, start)) if start.isBefore(cutoff) =&gt; ip<br>  }<br>  <br>  // Remove them (thread-safe iteration!)<br>  expiredIps.foreach(ipRequestCounts.remove)<br>  <br>  println(s&quot;Cleaned up ${expiredIps.size} expired IPs&quot;)<br>}</pre><p><strong>Key Points:</strong></p><ul><li>collect() is a Scala method - clean and functional</li><li>Iteration is thread-safe (no ConcurrentModificationException)</li><li>Other threads can still read/write during cleanup</li></ul><h3>Advanced Pattern: Dual Rate Limiting</h3><p>Real applications often need different rate limits for authenticated vs. anonymous users:</p><pre>class AdvancedRateLimiter {<br>  // IP-based limiting (anonymous users)<br>  private val ipCounts = <br>    new ConcurrentHashMap[String, (Int, Instant)]().asScala<br>  private val ipMaxRequests = 10<br>  private val ipWindowMs = 60000L<br>  <br>  // User-based limiting (authenticated users)<br>  private val userCounts = <br>    new ConcurrentHashMap[String, (Int, Instant)]().asScala<br>  private val userMaxRequests = 1000<br>  private val userWindowMs = 60000L<br>  <br>  def isAllowed(ip: String, userIdOpt: Option[String]): Boolean = {<br>    userIdOpt match {<br>      case Some(userId) =&gt;<br>        // Authenticated: use generous user-based limits<br>        checkLimit(userId, userCounts, userMaxRequests, userWindowMs)<br>      <br>      case None =&gt;<br>        // Anonymous: use strict IP-based limits<br>        checkLimit(ip, ipCounts, ipMaxRequests, ipWindowMs)<br>    }<br>  }<br>  <br>  private def checkLimit(<br>    key: String,<br>    counts: scala.collection.mutable.Map[String, (Int, Instant)],<br>    maxReqs: Int,<br>    windowMs: Long<br>  ): Boolean = {<br>    // Implementation similar to earlier example<br>    ???<br>  }<br>}</pre><p><strong>Architecture Benefits:</strong></p><ul><li>Authenticated users aren’t penalized by IP-based limits</li><li>Different limits for different user types</li><li>Both use thread-safe ConcurrentHashMap</li><li>Scales to thousands of concurrent requests</li></ul><h3>Performance Comparison</h3><pre>Benchmark: 1000 concurrent threads, 1 million operations</pre><pre>Synchronized HashMap:<br>  - Throughput: ~50,000 ops/sec<br>  - All threads compete for single lock<br>  <br>ConcurrentHashMap:<br>  - Throughput: ~2,500,000 ops/sec<br>  - Parallel access to different segments<br>  <br>Result: 50x faster! 🚀</pre><h3>Common Pitfalls and Solutions</h3><h3>Pitfall 1: Compound Operations</h3><pre>// ❌ Not atomic!<br>if (map.containsKey(key)) {<br>  val value = map.get(key)<br>  map.put(key, value + 1)<br>}</pre><p><strong>Solution:</strong> Use atomic operations</p><pre>// ✅ Atomic<br>map.compute(key, (k, v) =&gt; <br>  if (v == null) 1 else v + 1<br>)</pre><h3>Pitfall 2: Inconsistent Reads</h3><pre>// ❌ May read stale data<br>val count1 = map.get(&quot;key1&quot;)<br>val count2 = map.get(&quot;key2&quot;)<br>val total = count1 + count2 // Inconsistent!</pre><p><strong>Solution:</strong> Use higher-level synchronization if you need consistency across multiple keys.</p><h3>Pitfall 3: Size() is Expensive</h3><pre>// ❌ Slow for large maps<br>if (map.size &gt; 1000) { ... }</pre><p><strong>Solution:</strong> Track size separately or use approximate methods.</p><h3>When to Use ConcurrentHashMap</h3><p><strong>✅ Use it when:</strong></p><ul><li>Multiple threads read/write shared data</li><li>Performance is critical</li><li>You need lock-free reads</li><li>Operations are mostly on different keys</li></ul><p><strong>❌ Don’t use it when:</strong></p><ul><li>Single-threaded application</li><li>You need transactions across multiple keys</li><li>Memory is extremely constrained (more overhead than HashMap)</li></ul><h3>Monitoring and Debugging</h3><p>Add observability to your concurrent maps:</p><pre>class MonitoredRateLimiter {<br>  private val ipCounts = new ConcurrentHashMap[String, (Int, Instant)]().asScala<br>  <br>  def getCurrentCount(ip: String): Option[Int] = {<br>    val now = Instant.now()<br>    ipCounts.get(ip)<br>      .filter { case (_, windowStart) =&gt;<br>        now.isBefore(windowStart.plusMillis(windowMillis))<br>      }<br>      .map(_._1)<br>  }<br>  <br>  def getActiveIpCount: Int = ipCounts.size<br>  <br>  def getMetrics: Map[String, Any] = Map(<br>    &quot;active_ips&quot; -&gt; ipCounts.size,<br>    &quot;sample_counts&quot; -&gt; ipCounts.take(5).map { <br>      case (ip, (count, _)) =&gt; s&quot;$ip: $count&quot; <br>    }<br>  )<br>}</pre><h3>Conclusion</h3><p>ConcurrentHashMap is a powerful tool for building scalable, thread-safe applications in Scala. By understanding its internal mechanics and proper usage patterns, you can:</p><ul><li>Eliminate race conditions</li><li>Achieve better performance than synchronized collections</li><li>Build production-ready concurrent systems</li></ul><p>The rate limiter example demonstrates real-world usage where thread safety is critical. Whether you’re building rate limiters, caches, session stores, or any shared state management, ConcurrentHashMap should be in your toolkit.</p><h3>Key Takeaways</h3><ol><li><strong>Never use regular HashMap in multi-threaded code</strong></li><li><strong>ConcurrentHashMap provides thread-safe operations without manual synchronization</strong></li><li><strong>Segment-based locking enables high concurrency</strong></li><li><strong>Use </strong><strong>.asScala to get Scala&#39;s collection methods while maintaining Java&#39;s thread safety</strong></li><li><strong>Be careful with compound operations — use atomic methods</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd7d47fc262e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Accumulator in Play Framework (Scala)]]></title>
            <link>https://medium.com/@eng.murat.keskin/understanding-accumulator-in-play-framework-scala-f3487e73df47?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3487e73df47</guid>
            <category><![CDATA[accumulator]]></category>
            <category><![CDATA[scala]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Sat, 20 Sep 2025 23:17:02 GMT</pubDate>
            <atom:updated>2025-09-20T23:17:02.579Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with <strong>Play Framework</strong>, you might stumble across the mysterious Accumulator. If you’ve ever seen something like this:</p><pre>Accumulator.done(<br>  Results.Redirect(routes.TaskController.taskList())<br>    .flashing(&quot;error&quot; -&gt; &quot;Access denied. Admin privileges required.&quot;)<br>)</pre><p>…you may wonder: <em>What exactly is an Accumulator, and why do I need it?</em></p><p>Let’s break it down.</p><h3>🔹 What is an Accumulator?</h3><p>In Play, an <strong>Accumulator</strong> represents a <strong>streaming computation</strong> that consumes incoming request body chunks and eventually produces a result.</p><p>Its type is:</p><pre>Accumulator[E, A]</pre><ul><li>E: the type of incoming chunks (often ByteString)</li><li>A: the final result once the stream completes (often a Result)</li></ul><p>Think of it as a <strong>pipe</strong>:</p><blockquote><em>It gathers chunks of request data → processes them asynchronously → produces a final response.</em></blockquote><h3>🔹 Why Do We Need It?</h3><p>HTTP request bodies can be large:</p><ul><li>Big JSON payloads</li><li>File uploads</li><li>Streaming data</li></ul><p>Instead of loading everything into memory, Play processes the body incrementally (streaming).<br> The Accumulator abstracts this mechanism so developers don’t have to manage the low-level stream handling.</p><h3>🔹 Example 1: Counting Request Body Size</h3><pre>import akka.util.ByteString<br>import akka.stream.scaladsl.Sink<br>import play.api.libs.streams.Accumulator<br>import play.api.mvc._</pre><pre>val countAction: Action[ByteString] = Action { _ =&gt;<br>  val acc: Accumulator[ByteString, Result] =<br>    Accumulator(<br>      Sink.fold(0)((count, chunk: ByteString) =&gt; count + chunk.length)<br>    ).map { totalBytes =&gt;<br>      Results.Ok(s&quot;Request body size: $totalBytes bytes&quot;)<br>    }</pre><pre>  acc<br>}</pre><p>Here:</p><ul><li>Each ByteString chunk is counted.</li><li>At the end, the total byte size is returned.</li></ul><h3>🔹 Example 2: Returning a Result Immediately</h3><p>Sometimes, we don’t care about the request body at all. For instance, if the user lacks admin privileges, we want to reject the request instantly:</p><pre>Accumulator.done(<br>  Results.Redirect(routes.TaskController.taskList())<br>    .flashing(&quot;error&quot; -&gt; &quot;Access denied. Admin privileges required.&quot;)<br>)</pre><p>👉 Accumulator.done(result) creates an already-completed accumulator that ignores the body and directly returns the given result.</p><h3>🔹 Analogy</h3><p>Imagine an <strong>empty jug</strong> that’s supposed to collect water (request body chunks):</p><ul><li>Normally, water drips into the jug until it’s full. Then you process it.</li><li>With Accumulator.done, you’re saying:<br> <em>“No need to fill the jug, I already have the drink ready.”</em></li></ul><h3>🔹 Similar Concepts in Other Languages</h3><h3>Node.js (Express middleware)</h3><p>In Node.js, middleware often reads the request body with streams:</p><pre>app.post(&#39;/upload&#39;, (req, res) =&gt; {<br>  let size = 0;<br>  req.on(&#39;data&#39;, chunk =&gt; {<br>    size += chunk.length;<br>  });<br>  req.on(&#39;end&#39;, () =&gt; {<br>    res.send(`Request body size: ${size} bytes`);<br>  });<br>});</pre><p>This is conceptually similar to Play’s Accumulator: stream chunks in, produce a final result.</p><h3>Python (ASGI / Starlette / FastAPI)</h3><p>Python async frameworks also treat the body as an async stream:</p><pre>from starlette.requests import Request<br>from starlette.responses import JSONResponse</pre><pre>async def count_body(request: Request):<br>    size = 0<br>    async for chunk in request.stream():<br>        size += len(chunk)<br>    return JSONResponse({&quot;body_size&quot;: size})</pre><p>Again: read chunks incrementally → compute → return result.</p><h3>Java (Servlet InputStream)</h3><p>In Java Servlets, you’d manually read the body with an InputStream:</p><pre>BufferedReader reader = request.getReader();<br>StringBuilder sb = new StringBuilder();<br>String line;<br>while ((line = reader.readLine()) != null) {<br>    sb.append(line);<br>}<br>String body = sb.toString();</pre><p>This is the low-level version of what Play’s Accumulator abstracts away.</p><h3>🔹 Key Takeaways</h3><ul><li><strong>Accumulator = streaming pipeline</strong> for request bodies in Play Framework.</li><li>Useful when handling <strong>large or streaming data</strong>.</li><li>Accumulator.done(result) lets you bypass body processing and respond immediately.</li><li>Similar ideas exist in <strong>Node.js streams, Python async streams, and Java Servlets</strong>, but Play provides a more functional &amp; composable abstraction.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3487e73df47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why localhost\SQLEXPRESS Works in .NET]]></title>
            <link>https://medium.com/@eng.murat.keskin/why-localhost-sqlexpress-works-in-net-ef69648d6664?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef69648d6664</guid>
            <category><![CDATA[jdbc]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[mssql]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 09:35:34 GMT</pubDate>
            <atom:updated>2025-09-07T09:35:34.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why localhost\SQLEXPRESS Works in .NET but Fails in JDBC: A Practical Guide to Connecting Java Backends to SQL Server Express</h3><p>If you’ve ever tried to connect your Java/Scala backend (using Slick, Hibernate, or plain JDBC) to <strong>SQL Server Express</strong>, you’ve probably hit the dreaded:</p><pre>com.microsoft.sqlserver.jdbc.SQLServerException:<br>The TCP/IP connection to the host localhost, port 1433 has failed..</pre><p>Meanwhile, the exact same connection string works flawlessly in <strong>.NET</strong> or <strong>SQL Server Management Studio (SSMS)</strong>:</p><pre>Server=localhost\SQLEXPRESS;Database=myDb;User Id=sa;Password=secret;</pre><p>So what’s going on? Let’s break it down.</p><h3>1. Protocol Differences: .NET vs JDBC</h3><ul><li><strong>.NET (SqlClient / SSMS)</strong><br> Uses a <strong>protocol fallback order</strong> when you type localhost\SQLEXPRESS:</li></ul><ol><li>Shared Memory</li><li>Named Pipes</li><li>TCP/IP</li></ol><ul><li>That means even if <strong>TCP/IP is disabled</strong> or the SQL Browser service is off, SSMS can still connect locally via Shared Memory.</li><li><strong>JDBC (Microsoft JDBC Driver for SQL Server)</strong><br> Only supports <strong>TCP/IP</strong>.<br> Named instances like SQLEXPRESS are resolved via the <strong>SQL Server Browser service</strong> on UDP port 1434. If the Browser is off, JDBC cannot figure out which port the instance is listening on.</li></ul><p>👉 That’s why the same connection string succeeds in .NET but times out in JDBC.</p><h3>2. Correct JDBC Connection Strings</h3><p>Instead of localhost\SQLEXPRESS, use one of these approaches:</p><h3>A) Use instanceName (requires SQL Server Browser)</h3><pre>jdbc:sqlserver://localhost;instanceName=SQLEXPRESS;databaseName=myDb;encrypt=true;trustServerCertificate=true</pre><ul><li><strong>Pros</strong>: Looks familiar, works if Browser service is running.</li><li><strong>Cons</strong>: Breaks if Browser is stopped.</li></ul><h3>B) Use a fixed port (recommended for backends)</h3><ol><li>Enable <strong>TCP/IP</strong> for your instance (SQL Server Configuration Manager → Protocols for SQLEXPRESS).</li><li>Either find the <strong>dynamic port</strong> under <strong>IPAll → TCP Dynamic Ports</strong> or assign a <strong>static port</strong> (e.g., 1433).</li><li>Restart the SQL service.</li><li>Use:</li></ol><pre>jdbc:sqlserver://localhost:1433;databaseName=myDb;encrypt=true;trustServerCertificate=true</pre><ul><li><strong>Pros</strong>: No dependency on SQL Browser.</li><li><strong>Cons</strong>: You must manage the port configuration yourself.</li></ul><h3>3. JDBC Driver Versions</h3><p>Pick the right driver build for your JDK:</p><ul><li>JDK 8 → mssql-jdbc:x.y.z.jre8</li><li>JDK 11/17 → mssql-jdbc:x.y.z.jre11</li><li>(Microsoft often doesn’t publish .jre17 artifacts; the .jre11 builds are fully compatible with JDK 17+.)</li></ul><p>Example for sbt/Scala:</p><pre>&quot;com.microsoft.sqlserver&quot; % &quot;mssql-jdbc&quot; % &quot;12.4.2.jre11&quot;</pre><h3>4. Checklist for a Healthy Connection</h3><ul><li>TCP/IP enabled for the instance</li><li>Correct driver version for your JDK</li><li>SQL Authentication mode enabled, sa user active</li><li>SQL Server Browser running (if using instanceName)</li><li>Firewall open for the TCP port</li></ul><h3>5. Quick Test Query</h3><p>Always test with the simplest query first:</p><pre>import slick.jdbc.SQLServerProfile.api._<br>import scala.concurrent.Await<br>import scala.concurrent.duration._</pre><pre>val db = Database.forConfig(&quot;slick.dbs.default.db&quot;)<br>val result = Await.result(db.run(sql&quot;SELECT 1&quot;.as[Int]), 5.seconds)<br>println(result) // should print List(1)</pre><h3>🔑 Takeaway</h3><ul><li>.NET can connect to localhost\SQLEXPRESS without TCP/IP because it falls back to Shared Memory.</li><li><strong>JDBC cannot</strong> — it requires TCP/IP, and either the SQL Browser service or a fixed port.</li><li>For production backends, always prefer <strong>static TCP ports</strong> over named instance resolution.</li></ul><p>By configuring your SQL Server Express instance correctly and adjusting your JDBC URL, you’ll avoid painful “Connection timed out” errors and have a reliable backend-to-database connection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef69648d6664" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Getting Started with Slick in Scala: A Practical Guide for Modern Data Access]]></title>
            <link>https://medium.com/@eng.murat.keskin/getting-started-with-slick-in-scala-a-practical-guide-for-modern-data-access-03c74fa00675?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/03c74fa00675</guid>
            <category><![CDATA[orm]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[slick]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Sat, 06 Sep 2025 15:54:40 GMT</pubDate>
            <atom:updated>2025-09-06T15:54:40.929Z</atom:updated>
            <content:encoded><![CDATA[<p>When building Scala applications, one of the first questions you’ll face is: <em>how should I talk to my database?</em><br> Slick (short for <strong>Scala Language Integrated Connection Kit</strong>) is one of the most widely used libraries in the Scala ecosystem for <strong>functional, type-safe, and composable database access</strong>. It provides a clean DSL for querying SQL databases while staying true to Scala’s functional style.</p><p>In this article, we’ll explore:</p><ul><li>What Slick is and why it matters</li><li>How to set up a Slick environment in a Scala project</li><li>Basic CRUD operations with examples</li><li>Slick in Play Framework vs. standalone Scala apps</li><li>Common pitfalls and best practices</li></ul><h3>🌱 Why Slick?</h3><p>Traditional JDBC requires verbose boilerplate and is error-prone. Slick provides:</p><ul><li><strong>Type safety</strong>: Compile-time checking of queries</li><li><strong>Functional style</strong>: Queries are built using combinators, not string concatenation</li><li><strong>Asynchronous I/O</strong>: Database calls can return Future for non-blocking apps</li><li><strong>Composability</strong>: Queries can be combined like Scala collections</li></ul><p>Think of it as Scala’s answer to “how can I query databases without losing functional purity?”</p><h3>⚙️ Setting Up Slick</h3><p>Add Slick and a database driver (e.g., PostgreSQL) to your build.sbt:</p><pre>lazy val root = (project in file(&quot;.&quot;))<br>  .settings(<br>    name := &quot;slick-example&quot;,<br>    version := &quot;0.1.0&quot;,<br>    scalaVersion := &quot;2.13.14&quot;,<br>    libraryDependencies ++= Seq(<br>      &quot;com.typesafe.slick&quot; %% &quot;slick&quot; % &quot;3.5.0&quot;,            // Slick core<br>      &quot;com.typesafe.slick&quot; %% &quot;slick-hikaricp&quot; % &quot;3.5.0&quot;,   // Connection pool<br>      &quot;org.postgresql&quot; % &quot;postgresql&quot; % &quot;42.7.3&quot;            // DB driver<br>    )<br>  )</pre><p>Configure your database connection in application.conf (for Play) or reference.conf:</p><pre>slick.dbs.default.profile = &quot;slick.jdbc.PostgresProfile$&quot;<br>slick.dbs.default.db {<br>  driver = &quot;org.postgresql.Driver&quot;<br>  url = &quot;jdbc:postgresql://localhost:5432/slick_demo&quot;<br>  user = &quot;postgres&quot;<br>  password = &quot;secret&quot;<br>  connectionPool = &quot;HikariCP&quot;<br>}</pre><h3>📚 Defining a Table</h3><p>Slick requires you to define table schemas as Scala classes:</p><pre>import slick.jdbc.PostgresProfile.api._</pre><pre>case class User(id: Long, name: String, email: String)</pre><pre>class Users(tag: Tag) extends Table[User](tag, &quot;users&quot;) {<br>  def id = column[Long](&quot;id&quot;, O.PrimaryKey, O.AutoInc)<br>  def name = column[String](&quot;name&quot;)<br>  def email = column[String](&quot;email&quot;)</pre><pre>  def * = (id, name, email) &lt;&gt; (User.tupled, User.unapply)<br>}</pre><pre>val users = TableQuery[Users]</pre><h3>🛠️ Running Queries</h3><p>Queries are written like Scala collections but executed asynchronously.</p><h3>Insert</h3><pre>val insertAction = users += User(0, &quot;Alice&quot;, &quot;alice@example.com&quot;)<br>db.run(insertAction)</pre><h3>Select</h3><pre>val allUsers = db.run(users.result)<br>allUsers.map(_.foreach(println))</pre><h3>Update</h3><pre>val updateAction = users.filter(_.id === 1L).map(_.name).update(&quot;Alicia&quot;)<br>db.run(updateAction)</pre><h3>Delete</h3><pre>val deleteAction = users.filter(_.id === 1L).delete<br>db.run(deleteAction)</pre><h3>⚡ Slick in Play Framework</h3><p>Play integrates seamlessly with Slick via the play-slick plugin.<br> Instead of manually creating Database instances, you inject DatabaseConfigProvider:</p><pre>class UserRepository @Inject()(protected val dbConfigProvider: DatabaseConfigProvider)<br>  (implicit ec: ExecutionContext) extends HasDatabaseConfigProvider[JdbcProfile] {</pre><pre>  import profile.api._</pre><pre>  private val users = TableQuery[Users]</pre><pre>  def all(): Future[Seq[User]] = db.run(users.result)<br>  def create(user: User): Future[Int] = db.run(users += user)<br>}</pre><p>This fits neatly into a layered architecture (Controllers → Services → Repositories).</p><h3>🧭 Best Practices</h3><ol><li><strong>Use </strong><strong>TableQuery as a singleton</strong>: Define once, reuse everywhere.</li><li><strong>Favor composable queries</strong>: Build queries step by step instead of raw SQL strings.</li><li><strong>Handle blocking</strong>: Always run db.run on a dedicated ExecutionContext.</li><li><strong>Migration tools</strong>: Pair Slick with Flyway or Liquibase to manage schema evolution.</li><li><strong>Error handling</strong>: Wrap queries in service-level abstractions returning Either or Try.</li></ol><h3>⚠️ Common Pitfalls</h3><ul><li><strong>Forgetting </strong><strong>db.run</strong>: Queries are lazy until executed.</li><li><strong>Mixing blocking and async</strong>: Don’t block on futures inside Play controllers.</li><li><strong>Tight coupling</strong>: Keep repositories thin; don’t put business logic in persistence.</li></ul><h3>🎯 Conclusion</h3><p>Slick brings the power of <strong>type safety, functional programming, and async I/O</strong> into the world of relational databases. Whether you’re building a Play Framework web app or a standalone Scala service, it reduces boilerplate and improves safety.</p><p>For small projects, the learning curve is manageable; for larger systems, Slick scales well when paired with best practices like migrations and service layering.</p><p>If you want the <strong>power of SQL with the elegance of Scala</strong>, Slick is a great choice.</p><p>✍️ <em>What’s your experience with Slick? Do you prefer Slick’s functional style or plain SQL with libraries like Doobie? Share your thoughts in the comments!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03c74fa00675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing Handler Architectures in .NET (MediatR) vs. Java (Spring Boot)]]></title>
            <link>https://medium.com/@eng.murat.keskin/comparing-handler-architectures-in-net-mediatr-vs-java-spring-boot-e1eb08fc171d?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1eb08fc171d</guid>
            <category><![CDATA[mediatr]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[java-spring-boot]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 09:52:55 GMT</pubDate>
            <atom:updated>2025-04-25T10:00:47.740Z</atom:updated>
            <content:encoded><![CDATA[<h3>Comparing Handler Architectures in .NET (MediatR) vs. Java (Spring Boot)</h3><p>Modern backend development demands clean separation of concerns and scalable structures. Both .NET with MediatR and Java with Spring Boot offer robust ways to manage application layers, but their approaches differ subtly. This article compares the two, focusing on handlers, service layers, and DDD alignment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iROQEumMmej6jXIsbiKOMg.png" /></figure><h3>.NET MediatR Architecture</h3><p>MediatR implements the mediator pattern, allowing controllers to delegate work to handlers without knowing the underlying logic.</p><p><strong>Typical Structure:</strong></p><ul><li>API Layer (Controllers)</li><li>Application Layer (Commands, Queries, Handlers)</li><li>Domain Layer (Entities, ValueObjects)</li><li>Infrastructure Layer (Repositories, External Services)</li></ul><p><strong>Key Concepts:</strong></p><ul><li>IRequest&lt;TResponse&gt;: Represents a command or query.</li><li>IRequestHandler&lt;TRequest, TResponse&gt;: Handles the request.</li><li>IMediator.Send(...): Dispatches the request.</li></ul><p>MediatR enforces CQRS by splitting reads and writes, supports middleware pipelines like validation and logging, and promotes loose coupling.</p><h3>Spring Boot Service-Based Architecture</h3><p>Spring Boot typically organizes applications using services and repositories.</p><p><strong>Typical Structure:</strong></p><ul><li>Controllers (@RestController)</li><li>Services (@Service)</li><li>Repositories (@Repository)</li><li>Domain Models (@Entity)</li></ul><p>Controllers delegate directly to services, which encapsulate business logic. Repositories handle database interactions using JPA. However, without clear conventions, services can grow bloated over time.</p><h3>MediatR vs Spring Service: Quick Comparison</h3><ul><li><strong>Command/Query Separation:</strong><br> In .NET with MediatR, command and query responsibilities are strictly separated by design.<br> In Spring Boot, developers must manually enforce this separation through service structuring.</li><li><strong>Mediator Pattern:</strong><br> MediatR natively implements the mediator pattern in .NET.<br> In Spring Boot, if mediation is needed, it must be manually implemented or supported through custom dispatchers.</li><li><strong>Clean Architecture Support:</strong><br> .NET with MediatR naturally fits clean architecture principles, guiding developers to layer their application properly.<br> Spring Boot can support clean architecture, but it relies on developer discipline rather than framework enforcement.</li><li><strong>Pipeline Behaviors:</strong><br> MediatR offers built-in support for pipeline behaviors like validation and logging through IPipelineBehavior&lt;T&gt;.<br> In Spring Boot, similar behaviors must be achieved using AOP (Aspect-Oriented Programming) or filters.</li><li><strong>Testability:</strong><br> Both MediatR handlers and Spring services are easy to unit test when structured correctly.<br> However, MediatR encourages smaller, more focused handlers, improving granularity in testing.</li></ul><h3>DDD Alignment</h3><p>MediatR encourages strict separation: each command or query has a dedicated handler.<br> Spring Boot can match this structure if developers manually create command/query classes and handlers, but it’s not enforced by the framework itself.</p><p>In practice, Spring’s services often serve both application logic and domain orchestration unless explicitly split by design.</p><h3>Bringing CQRS to Spring Boot</h3><p>To implement a MediatR-style CQRS architecture in Spring Boot:</p><ul><li>Create Command and Query objects.</li><li>Build dedicated Handler classes.</li><li>Use a Dispatcher (or simple service locator) to route them.</li><li>Optionally integrate frameworks like Axon for advanced CQRS/Event Sourcing.</li></ul><h3>Conclusion</h3><p>Both ecosystems can support clean, scalable architectures.<br> MediatR simplifies handler-driven designs in .NET by enforcing separation out of the box.<br> Spring Boot relies more on developer discipline to maintain clean layering but provides flexibility for various project sizes and styles.</p><p>Ultimately, good architecture depends more on consistent patterns and discipline than on specific tool</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1eb08fc171d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft’s Majorana 1: A Quantum Leap or Just Hype?]]></title>
            <link>https://medium.com/@eng.murat.keskin/microsofts-majorana-1-a-quantum-leap-or-just-hype-6a17ebfd3fb1?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a17ebfd3fb1</guid>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 20:20:28 GMT</pubDate>
            <atom:updated>2025-02-28T20:20:28.042Z</atom:updated>
            <content:encoded><![CDATA[<p>Microsoft’s Majorana 1: A Quantum Leap or Just Hype?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*qKb9qmpd6KhvWb1FQ-Vvqg.jpeg" /><figcaption>https://www.bloomberg.com/news/articles/2025-02-19/microsoft-unveils-quantum-computing-chip-for-future-data-centers</figcaption></figure><p>After nearly two decades of research, Microsoft has unveiled the Majorana 1, a quantum computing chip that could mark a significant milestone in the field. This breakthrough centers around topological qubits, a theoretical approach that aims to reduce quantum computing errors, making large-scale quantum calculations more feasible. But is this really the moment quantum computing enters the mainstream, or is it another case of exaggerated progress?</p><p>Understanding the Majorana 1 Chip</p><p>Quantum computing relies on qubits, which differ from classical bits by existing in a superposition of states rather than being strictly 0 or 1. However, qubits are notoriously unstable, making it difficult to build large-scale, error-free quantum computers. Microsoft’s solution? Topological qubits, which leverage the exotic properties of Majorana particles, a type of theoretical particle first proposed by physicist Ettore Majorana in 1937.</p><p>Unlike traditional qubits that are highly susceptible to external disturbances, topological qubits are designed to be more stable, potentially offering a clearer path toward practical quantum computing. Microsoft claims that Majorana 1 is built using a &quot;topoconductor&quot;—a special class of material that enables the formation of Majorana particles, creating a new, more robust quantum state.</p><p>With this innovation, Microsoft envisions a future where quantum computing isn’t decades away but just a few years from commercialization.</p><p>The Potential and the Skepticism</p><p>If the claims about Majorana 1 hold, the implications are vast. Quantum computers could revolutionize healthcare, cryptography, material science, and artificial intelligence by solving complex problems exponentially faster than classical computers. Drug discovery, climate modeling, and encryption methods could all see rapid advancements.</p><p>However, not everyone is convinced. Quantum computing has a history of grand claims that fail to materialize in real-world applications. Eli Levenson-Falk, a physicist at USC, warns that Microsoft&#39;s results &quot;show behavior consistent with a qubit but also consistent with more trivial explanations.&quot; While Microsoft has provided experimental evidence, full-scale validation is still needed.</p><p>Additionally, quantum computing giants like IBM and Google have been investing heavily in different architectures, leading to a fragmented landscape where no single approach has yet proven dominant.</p><p>What’s Next for Quantum Computing?</p><p>Even if Majorana 1 isn’t an immediate game-changer, it represents an important step in the quantum computing race. Microsoft is already working with DARPA to refine and scale its technology, signaling its long-term commitment to quantum research.</p><p>For now, the scientific community remains cautiously optimistic. While Majorana 1 may not immediately deliver on all its promises, its development keeps quantum computing at the forefront of technological advancement—bringing us one step closer to an era where quantum machines reshape the digital world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a17ebfd3fb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How DeepSeek is Redefining the AI Landscape]]></title>
            <link>https://medium.com/@eng.murat.keskin/how-deepseek-is-redefining-the-ai-landscape-c84b88bb9452?source=rss-ff0fad5a3c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c84b88bb9452</guid>
            <category><![CDATA[deepseek]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[deepseek-r1]]></category>
            <category><![CDATA[deepseek-v3]]></category>
            <category><![CDATA[deepseek-ai]]></category>
            <dc:creator><![CDATA[Murat Keskin]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 11:52:39 GMT</pubDate>
            <atom:updated>2025-01-28T11:52:39.044Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s Tuesday, January 28, 2025, and the world of artificial intelligence has been shaken. DeepSeek’s AI Assistant has skyrocketed to the top of Apple’s App Store, grabbing the attention of developers, tech enthusiasts, and financial markets alike. While the AI giants like OpenAI, Anthropic, and Google have dominated the space for years, a new challenger has emerged with models that are faster, more efficient, and — most importantly — less resource-intensive.</p><p>The AI race just got interesting.</p><h3>What Sets DeepSeek Apart?</h3><p>At the core of DeepSeek’s success lies a paradigm shift in how AI is designed. Unlike its competitors, who have prioritized building colossal models with ever-increasing numbers of parameters, DeepSeek’s engineers asked a simple but profound question:</p><p><strong>What does an AI actually need to do?</strong></p><p>Instead of building models that solve every possible problem — be it scientific reasoning, creative writing, or even artistic rendering — DeepSeek’s engineers focused on specialization. Their “mixture of experts” architecture divides the AI into departments, akin to a university. When a query comes in, it is routed to the most relevant part of the model, allowing the rest of the system to remain idle. This approach dramatically reduces computational requirements and energy consumption, leading to a model that is both efficient and effective.</p><p>Consider this: DeepSeek-V3, their latest flagship model, operates with 671 billion variables. That’s massive, but it’s dwarfed by OpenAI’s GPT-4, which boasts 1.76 trillion parameters. Despite this, DeepSeek achieves comparable performance while requiring significantly less computational power. The result? High-quality AI outputs at a fraction of the cost.</p><h3>The Technical Magic Behind DeepSeek</h3><p>DeepSeek’s innovation stems from both its architecture and its training philosophy. Here are some of the key highlights:</p><h4>1. Efficient Reinforcement Learning</h4><p>DeepSeek’s approach to reinforcement learning (RL) is refreshingly unique. Instead of focusing on intermediate rewards for every token generation, their reward model evaluates the accuracy of the final outcome. This eliminates unnecessary computational overhead and aligns the training process more closely with real-world needs.</p><h4>2. Skipping Few-Shot Prompting</h4><p>In a surprising departure from the norm, DeepSeek’s research highlights that few-shot prompting often degrades performance. Instead, they recommend users provide zero-shot prompts with clear problem descriptions and output formats. This zero-shot optimization not only simplifies interactions but also enhances efficiency.</p><h4>3. Cold Start with Human-Curated Outputs</h4><p>For RL training, DeepSeek employs a clever mix of few-shot prompting and chain-of-thought (CoT) examples. By gathering detailed responses and refining them with human annotators, they generate high-quality cold-start datasets. This process ensures the AI learns to reason effectively while maintaining practical relevance.</p><h3>Lessons from the Market Reaction</h3><p>The implications of DeepSeek’s innovations extend far beyond technical achievements. In a single day, Nvidia — the GPU titan — saw a $600 billion drop in market value. Why? Because DeepSeek proved that cutting-edge AI doesn’t require the most powerful GPUs. Instead, their models are designed to run on gaming-grade hardware, making AI development accessible to a broader audience.</p><p>This development challenges the prevailing market logic that “more compute equals better AI.” By demonstrating that efficiency can rival brute force, DeepSeek has forced the industry to rethink its priorities.</p><h3>What This Means for Developers</h3><p>DeepSeek’s open-source approach makes it an attractive option for developers. Its efficiency and cost-effectiveness enable startups and small teams to integrate state-of-the-art AI without breaking the bank. For tasks like software engineering, DeepSeek’s future versions aim to include asynchronous evaluations and rejection sampling, further optimizing RL processes.</p><p>Additionally, the AI’s ability to reason without unnecessary complexity sets a new standard for user interactions. Simple queries like “hello” avoid over-engineered reasoning, while complex tasks benefit from detailed, reflective responses.</p><h3>The Broader Implications</h3><p>DeepSeek’s rise is a wake-up call for the AI industry. While OpenAI’s GPT-5 and similar models may still push the boundaries of general intelligence, DeepSeek has shown that practical AI solutions don’t need to rely on brute force. Their mixture-of-experts architecture and emphasis on efficient learning are likely to influence future AI development across the globe.</p><p>As the AI arms race continues, one thing is clear: innovation doesn’t always require more power — sometimes, it requires smarter design.</p><h3>Conclusion</h3><p>DeepSeek’s approach is a masterclass in engineering ingenuity. By focusing on efficiency, specialization, and accessibility, they’ve redefined what’s possible in AI development. Whether you’re a tech enthusiast, a developer, or a business leader, DeepSeek’s success is a reminder that the future of AI is as much about innovation as it is about computation.</p><p>The game has changed. The question now is: can the titans of AI keep up?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c84b88bb9452" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>