<?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 Ivan Duhov on Medium]]></title>
        <description><![CDATA[Stories by Ivan Duhov on Medium]]></description>
        <link>https://medium.com/@duhov?source=rss-b4a82f3a41dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dFkkfKM7P4bBAp_EsETNSg.jpeg</url>
            <title>Stories by Ivan Duhov on Medium</title>
            <link>https://medium.com/@duhov?source=rss-b4a82f3a41dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 04:39:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@duhov/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[Demystifying Database Indexes: How Clustered and Non-Clustered Work]]></title>
            <link>https://medium.com/@duhov/demystifying-database-indexes-how-clustered-and-non-clustered-work-ffed8b7b9b65?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffed8b7b9b65</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 19:24:31 GMT</pubDate>
            <atom:updated>2025-07-07T19:24:31.263Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide to data organization, query performance, and making the right choice for your database.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*-nAaKrHOgVoEphR8.png" /></figure><p>Ever walked into a massive library without a plan? Finding one specific book could take forever. Databases face the same challenge. When a table grows to millions of rows, finding data quickly becomes a critical problem. That’s where <strong>indexes</strong> come in — they are the database’s cheat sheet to locate data without scanning every single row.</p><p>However, not all indices are created equal. The two most fundamental types are <strong>clustered</strong> and <strong>non-clustered</strong>. Understanding the difference is crucial for designing databases that are not only functional but also fast and scalable.</p><h3>The Librarian’s Shelf: Clustered Indexes</h3><p>Imagine a library where all the books are physically arranged on the shelves in alphabetical order by title. If you’re looking for a book titled “Dune,” you can quickly walk to the ‘D’ section and find it. If you want all the books between “Dracula” and “Dune,” they’ll all be sitting right there next to each other.</p><p>This is exactly how a <strong>clustered index</strong> works. It defines the <strong>physical order</strong> of the data rows in a table. The data isn’t just indexed; the table <em>is</em> the index.</p><p>Because the rows on the disk can only be stored in one physical order, a table can have <strong>only one clustered index</strong>.</p><ul><li>In <strong>MySQL and MariaDB</strong> (when using the default InnoDB storage engine), the clustered index is tied directly to the <strong>PRIMARY KEY</strong>. When you declare a primary key, you are creating the clustered index.</li><li>In <strong>PostgreSQL</strong>, the concept is a bit different. A PRIMARY KEY creates a unique non-clustered index. To physically re-order the table like a true clustered index, you use the CLUSTER command, which resorts the table&#39;s data based on a specified index. This is a one-time operation.</li></ul><p><strong>How it looks:</strong> The actual data rows are sorted and stored based on the clustered index key (e.g., UserID).</p><p>This physical arrangement makes clustered indexes incredibly efficient for queries that retrieve a range of data, like finding all employees hired in a specific month.</p><h3>The Card Catalog: Non-Clustered Indexes</h3><p>Now, what if you wanted to find all the books by the author “Frank Herbert”? The books aren’t physically sorted by author. Searching through the entire library would be a nightmare. Instead, you’d go to the card catalog. The catalog has a sorted list of authors, and each card points you to the exact shelf where the book is located.</p><p>This is a <strong>non-clustered index</strong>.</p><p>A non-clustered index is a <strong>separate structure</strong> that is stored away from the data rows. It contains the indexed column values in sorted order, but each entry has a <strong>pointer</strong> (or “row locator”) that tells the database where to find the corresponding actual data row.</p><p>Since this index is just a separate lookup table, you can have <strong>multiple non-clustered indexes</strong> on a single data table.</p><p><strong>How it works:</strong> The non-clustered index is a sorted list of keys (e.g., Email) with pointers that map back to the physical data rows, which are themselves sorted by the clustered index (UserID).</p><h4>How to Create a Non-Clustered Index</h4><p>Creating a non-clustered index is straightforward and the syntax is nearly identical across all three databases. Let’s say we have a users table and want to speed up lookups on the email column.</p><p>SQL</p><pre>-- This syntax works for MySQL, MariaDB, and PostgreSQL<br>CREATE INDEX idx_users_email ON users(email);</pre><p>This command creates a new index named idx_users_email on the email column of the users table.</p><h3>How-To: Changing the Clustered Index</h3><p>What if your application’s needs change? For example, you might initially use an auto-incrementing id as the primary key, but later find that you almost always look up users by a unique username. Changing the clustered index can improve performance, but it&#39;s a heavy operation.</p><h4>For MySQL and MariaDB</h4><p>To change the clustered index, you must drop the existing primary key and add a new one. This forces the database to physically rebuild the entire table, which can lock the table and take a long time for large datasets.</p><p>SQL</p><pre>-- Let&#39;s assume &#39;id&#39; is the current primary key<br>-- and we want to change it to &#39;username&#39;.<br>ALTER TABLE users<br>  DROP PRIMARY KEY,<br>  ADD PRIMARY KEY (username);</pre><h4>For PostgreSQL</h4><p>Since PostgreSQL’s CLUSTER is a manual command, &quot;changing&quot; the clustered order simply means running it on a different index.</p><p>First, ensure an index exists on the column you want to cluster by (e.g., username).</p><p>SQL</p><pre>-- 1. Create an index on the new column if it doesn&#39;t exist<br>CREATE INDEX idx_users_username ON users(username);</pre><pre>-- 2. Run the CLUSTER command to physically re-sort the table<br>--    based on the new index.<br>CLUSTER users USING idx_users_username;</pre><p><strong>Note:</strong> The CLUSTER command in PostgreSQL only re-sorts the data at that moment. New data isn&#39;t automatically kept in that order. You would need to re-run CLUSTER periodically to maintain the physical order.</p><h3>The Inevitable Trade-Off</h3><p>As with everything in computer science, choosing an index strategy is a game of <strong>trade-offs</strong>. Neither approach is a silver bullet; the right choice depends entirely on how you plan to use your data.</p><p><strong>Number Per Table</strong></p><ul><li><strong>Clustered index:<br>Only one</strong>. The physical data can only have one sort order.</li><li><strong>Non-clustered index:<br>Multiple</strong>. You can create many different “card catalogs.”</li></ul><h4><strong>Data Storage</strong></h4><ul><li><strong>Clustered index: <br></strong>Doesn’t use extra space. The index <em>is</em> the table.</li><li><strong>Non-clustered index: <br></strong>Requires <strong>extra storage space</strong> for the index structure itself.</li></ul><h4><strong>Query Speed</strong></h4><ul><li><strong>Clustered index:<br></strong>Extremely fast for <strong>range queries</strong> (e.g., WHERE ID &gt; 100 AND ID &lt; 200).</li><li><strong>Non-clustered index:<br></strong>Fast for <strong>specific lookups</strong>. Slower for ranges, as it may require jumping back and forth between the index and the table.</li></ul><h4><strong>Modifications</strong></h4><ul><li><strong>Clustered index:<br></strong>Inserts/updates can be <strong>slower</strong> if a row needs to be physically moved to maintain sort order. This can cause page splits.</li><li><strong>Non-clustered index:<br></strong>Inserts/updates are faster in this regard, but the non-clustered index (or indexes) must also be updated, which adds overhead.</li></ul><p>The biggest cost of non-clustered indexes is the extra write overhead and storage space. Every time you insert, update, or delete a row, the database must update not only the table but <em>every single non-clustered index</em> that exists on it.</p><h3>Conclusion: Making the Choice</h3><p>So, which should you use? The answer is almost always <strong>both</strong>.</p><ul><li>Use a <strong>Clustered Index</strong> on the column that is most frequently accessed, especially via range queries. This is why the <strong>primary key</strong> is the default choice — it’s unique and often sequential (INT or BIGINT), making it a perfect candidate.</li><li>Use <strong>Non-Clustered Indexes</strong> on other columns that are frequently used in WHERE clauses for lookups, or in JOIN conditions to speed up connections between tables (e.g., a user_email column or a foreign key).</li></ul><h3>A Key Question: Can the Clustered Index Be Different From the Primary Key?</h3><p>This is a common point of confusion, and the answer <strong>depends entirely on the database system you are using.</strong></p><h4>For MySQL &amp; MariaDB (InnoDB)</h4><p><strong>No.</strong> In MySQL and MariaDB, the <strong>clustered index is the primary key</strong>. They are one and the same.</p><p>When you define a PRIMARY KEY on a table, the database automatically uses those columns to create the clustered index, which physically sorts the data on the disk. You cannot have a primary key on one column and a clustered index on another.</p><h4>For PostgreSQL</h4><p><strong>Yes.</strong> In PostgreSQL, the clustered index and primary key can be completely different.</p><ul><li>A <strong>PRIMARY KEY</strong> is simply a constraint that ensures a column&#39;s values are unique and not null. It uses a regular (non-clustered) index to enforce this rule.</li><li>A <strong>clustered index</strong> is created by running the CLUSTER command, which physically re-sorts the table based on <em>any existing index you choose</em>.</li></ul><p>This means you can have your PRIMARY KEY on an id column but choose to CLUSTER the table is based on an index of a created_at date column if that better suits your query patterns.</p><h4>Conclusion</h4><p>It all comes down to this: use clustered indexes for sorting and non-clustered indexes for searching. Go check your tables — a well-placed index is the easiest performance win you’ll get all day.</p><p><em>I wrote a query on a table without an index. Now it’s a feature, not a bug — it’s called a “coffee break.”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffed8b7b9b65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IPC: How Processes Communicate]]></title>
            <link>https://medium.com/@duhov/ipc-how-processes-communicate-430720a98cfe?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/430720a98cfe</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[ipc]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Tue, 01 Apr 2025 20:14:24 GMT</pubDate>
            <atom:updated>2025-04-01T20:14:24.642Z</atom:updated>
            <content:encoded><![CDATA[<h4>What are the inner workings of the Inter Process Communication protocol?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NOnwPBIV50WZbex-_hEACw.png" /></figure><p>In my previous articles, we established that a process is an isolated execution of a program. But if each process runs independently, how do they communicate? And more importantly, why do they need to?</p><h3>Why Do Processes Need to Communicate?</h3><p>Processes can be categorized into two types:</p><ul><li><strong>Cooperative processes</strong> — interact with other processes to share data or coordinate tasks.</li><li><strong>Independent processes</strong> — run in isolation without needing to communicate.</li></ul><p>Communication between processes is essential for many reasons:</p><ul><li><strong>Data sharing</strong> — A web browser process might communicate with a background download manager to display progress.</li><li><strong>Synchronization</strong> — In databases, multiple processes coordinate to prevent conflicts when writing data.</li><li><strong>Modular system design</strong> — Microservices architecture relies on separate processes communicating efficiently.</li></ul><h3>Inter-Process Communication (IPC)</h3><p>To enable this communication, the Inter-Process Communication (IPC) protocol was introduced in 1989. It has since become the standard for facilitating interactions between processes.</p><h4>1. Shared Memory</h4><p>Processes use a common memory space to exchange data efficiently. Think of it as a shared notebook where multiple people can write and read. This method is fast but requires careful synchronization to avoid conflicts.</p><h4>2. Message Passing</h4><p>Instead of sharing memory, processes send messages to each other through predefined channels. This approach is safer and more structured but comes with added overhead. It’s commonly used in distributed systems and microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0-ayWvhS50NKrQVWfNDQw.png" /><figcaption>Shared memory vs message passing</figcaption></figure><h3>Shared memory</h3><p>Imagine two processes that need to communicate. Each process has its own address space, protected by the OS, meaning one process cannot directly access another’s memory. So how do they share data?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*SZuJWwWRAJz-Oq4dg04WNQ.png" /><figcaption>The two processes can not access each others address space.</figcaption></figure><p>The solution: <strong>a common memory space</strong> that both processes can access.</p><h4>How Does It Work?</h4><ol><li>One process requests a shared memory segment, which the OS sets up.</li><li>The other process attaches to this memory segment.</li><li>Both processes can now read and write to the shared space.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vnt0K3w49lm2ksQDEVL3-w.png" /><figcaption>How processes establish a shared memory sapce</figcaption></figure><p>This shared memory typically resides in the address space of the process that initiated the communication.</p><h4>The Challenge: Message Formatting</h4><p>Now that the processes have established a common memory space, they both can access it.</p><p>Since the OS doesn’t enforce any structure, the two processes must agree on a format for their communication. Without a predefined structure, they could misinterpret the data, leading to errors or even unpredictable behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*0CvbkH3Br8OG5Af5RPomSQ.png" /><figcaption>How communicating via shared memory looks like</figcaption></figure><p>Think of it like passing notes in class — if one person writes in English and the other expects Spanish, things will get messy.</p><p>Shared memory is fast because it bypasses the OS, but it requires careful coordination to prevent issues like race conditions or data corruption.</p><p>That’s where synchronization mechanisms like mutexes and semaphores come into play — but more on that later ;)</p><h3>Message passing</h3><p>Shared memory is fast but <strong>risky</strong> — it puts a lot of responsibility on developers to manage synchronization and avoid data corruption.</p><p>For a more <strong>structured</strong> approach, we use <strong>message passing</strong>. Of course, structure comes at a cost — there’s more overhead, but in return, the OS handles much of the complexity.</p><h4>How Does It Work?</h4><p>Instead of sharing memory, processes send and receive messages through a dedicated communication channel. A message-passing facility provides a standard set of operations to manage this exchange.</p><p><strong>Common Implementations:</strong></p><ul><li><strong>Pipes</strong> — Simple one-way communication (e.g., shell commands chaining with |).</li><li><strong>Sockets</strong> — Used for communication between processes.</li><li><strong>Remote Procedure Calls (RPC)</strong> — Allow processes to invoke functions remotely, as if they were local.</li></ul><p>While message passing is slower than shared memory due to OS involvement, it’s safer and easier to manage, making it ideal for distributed systems and microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*V8CW9AmHFBQiXEPUIRsSWA.png" /><figcaption>How logical link is established by the OS.</figcaption></figure><p>Process 1 makes a system call to the OS, signaling its intent to communicate with Process 2. The OS then establishes a logical link between them, acting as an intermediary to manage the data exchange.</p><p>But what exactly does this “logical link” look like in memory?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NyVuuwdKRSMcoOJJ6t4pmg.png" /><figcaption>Memory snapshot of a message passing between two processes.</figcaption></figure><p>Now, here’s something interesting: since the mailbox doesn’t reside in either process’s address space but in the kernel’s memory, how do processes read from and write to it? 🤔</p><p>The answer lies in system calls. Both processes must interact with the OS via system calls to access the kernel’s memory space, where the mailbox resides. Of course, this comes with performance overhead compared to shared memory, as every interaction requires OS intervention.</p><p>In some operating systems, the mailbox is referred to as a port. Instead of specifying the exact process they want to communicate with, processes simply read from or write to a port — effectively decoupling them from one another.</p><p>Starting to sound familiar? Yes, this is how network sockets and IPC mechanisms like Mach ports work. Processes don’t need to know each other directly — they just need to know where to send the message.</p><h4>Where the beauty is in the message passing</h4><p>Now the best part about message passing is that since the ports don&#39;t reside in either process address space, they don&#39;t even need to be on the same computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*9litQ9WkUSgm2IOI08cR-w.png" /></figure><p>Processes send and receive messages through ports, meaning they can exist on the same system or be distributed across different machines. Of course, making this work across networks requires a more complex implementation, involving:</p><ul><li>A network layer to handle communication.</li><li>Device drivers to manage data transmission.</li><li>Network cards are used to physically send and receive messages.</li></ul><p>This is exactly how network sockets and distributed systems operate. Whether two processes are running side by side on a local machine or across different continents, message passing makes communication seamless and scalable.</p><h3>Final Thoughts</h3><p>Inter-Process Communication (IPC) is what allows processes — whether on the same machine or across a network — to work together efficiently. While shared memory offers speed and direct access, it demands careful synchronization to avoid chaos. Message passing, on the other hand, provides structure and flexibility, enabling communication even between remote systems, though at the cost of performance overhead.</p><p>Understanding these mechanisms is essential for system design, whether you’re working on low-level OS development, databases, microservices, or distributed systems. Choosing the right IPC method depends on your use case: do you prioritize speed, safety, or scalability?</p><p>In the end, IPC is the glue that holds modern computing together — so next time you browse the web, use a database, or run a distributed app, remember: there’s a whole world of processes talking behind the scenes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=430720a98cfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Process vs Program vs Thread: What Every Developer Should Know About OS Fundamentals]]></title>
            <link>https://medium.com/@duhov/process-vs-program-vs-thread-what-every-developer-should-know-about-os-fundamentals-4a687a8a3cc9?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a687a8a3cc9</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[computing]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 15:05:52 GMT</pubDate>
            <atom:updated>2025-03-30T15:05:52.404Z</atom:updated>
            <content:encoded><![CDATA[<h4>Whether you’re preparing for a tech interview or just curious, understanding processes, threads, and programs is a must.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*owbIeUIU3qpI2K3s" /></figure><h3><strong>Program</strong></h3><p>Imagine a program as the blueprint the processor uses for running different processes. It’s essentially a set of instructions written in a programming language, which gets translated into machine code so the CPU can execute it.</p><p>But here’s the thing — just because you have a program doesn’t mean it’s running yet. A program is just stored code sitting on disk, waiting to be loaded into memory and executed. Think of it like a recipe: until someone starts cooking, it’s just words on a page.</p><p>The memory footprint of a program consists mainly of two sections:</p><ul><li><strong>Text</strong> → The actual code that gets executed by the CPU.</li><li><strong>Data</strong> → All the variables, constants, and other static information the program needs.</li></ul><p>At this stage, the program isn’t doing anything. It’s just potential energy, waiting to be turned into a running process. That’s where the OS steps in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*EOXUyycwYxN5HuzdzAHqCQ.png" /></figure><h3>Process</h3><p>Now, when we run a program, it becomes a <strong>process</strong>. A process is essentially a running instance of a program, managed by the operating system. Since CPUs have limited cores, multiple processes must share CPU time, taking turns based on the OS scheduler.</p><p>For example, every tab you open in Chrome is a separate process. Even though they’re running the same program (Chrome), each tab has its own memory space and runs independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1krgl5h0M9oxisYJ0Gi0Q.png" /><figcaption>Example of different Chrome processes</figcaption></figure><p>When a program is loaded into memory, it needs more than just the <strong>text</strong> (code) and <strong>data</strong> (variables) to run. It also gets:</p><ul><li><strong>Stack</strong> → Stores function calls and local variables.</li><li><strong>Heap</strong> → Stores dynamically allocated memory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8AQ6hWgv_KWoquHRjCviUQ.png" /><figcaption>Memory allocations of a program and a process</figcaption></figure><p>This entire memory structure is called the <strong>address space</strong> of a process.</p><p>But a process is more than just its memory — it needs CPU time to execute. Since multiple processes are competing for CPU resources, the OS has to manage them efficiently. It does this by <strong>saving the current state</strong> of a process (its registers, program counter, etc.) so it can pause one and resume another later. This is called a <strong>context switch</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQvcvba21swm06IrhPyTPA.png" /><figcaption>A CPU state of a process</figcaption></figure><p>Your OS is juggling hundreds (or even thousands) of processes every second using <strong>scheduling algorithms</strong> to decide which process gets CPU time next. But more on that in another article. 😉</p><h3>Threads</h3><p>A thread is the smallest unit of execution within a process. Unlike a process, a thread doesn’t have its own address space — it shares the same memory (code, data, heap) with other threads of the same process. This makes thread creation lighter and faster than creating a whole new process.</p><p>Think of a process as a team working on a project. Each thread is like a team member handling a specific task, but they all share the same workspace and resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*e6hFh62IgUXuhop2.png" /><figcaption>How threads look like and what resources they have</figcaption></figure><p>Since threads belong to a process, they cannot run independently — they exist only within a process. However, they can run in parallel on different CPU cores (if available), allowing programs to do multiple things at once.</p><p>For example, a web browser might use:</p><ul><li>One thread to handle user input (clicks, scrolls).</li><li>Another to render a webpage.</li><li>Another to to download resources in the background.</li></ul><p>Just like processes, threads need CPU time, and the OS scheduler decides which thread gets to run. Since threads share memory within a process, context switching between threads is often faster than switching between processes, but the actual speed depends on factors like CPU architecture and kernel involvement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/0*S1wd5wGfPeB2Pu5C" /><figcaption>How threads are getting scheduled</figcaption></figure><p>Threads are powerful but come with their challenges — since they share memory, they can run into <strong>race conditions</strong> or <strong>deadlocks</strong> if not properly managed.</p><h3>Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clsR6xzpD_a1y1glck_CSA.png" /><figcaption>Author comparison of a program, process and a thread</figcaption></figure><p><em>Understanding the difference between programs, processes, and threads is fundamental for OS concepts and performance tuning. Whether you’re preparing for an interview or just curious about how your computer works, these concepts shape how modern operating systems handle multitasking and efficiency.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a687a8a3cc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Distributed Systems: An Overview of Google’s MapReduce Paper]]></title>
            <link>https://medium.com/@duhov/demystifying-distributed-systems-an-overview-of-googles-mapreduce-paper-00b664481fc3?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/00b664481fc3</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 18:35:52 GMT</pubDate>
            <atom:updated>2025-03-30T14:14:48.011Z</atom:updated>
            <content:encoded><![CDATA[<h4>How Google’s 2004 MapReduce Paper Revolutionized Distributed Data Processing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJbA0ADWXGvfbOkAY7E9Rg.png" /></figure><p>Today, we’re diving into Google’s 2004 MapReduce paper — a groundbreaking work that shaped modern distributed systems. If you haven’t read it, don’t worry! I’ll walk you through its core concepts, why it was revolutionary, and how it applied fundamental distributed system principles in a way that made large-scale data processing accessible to everyday engineers.</p><h3>Abstract</h3><p>In 2004, Google needed a way to unlock the full power of its data centers for software engineers. Every day tasks involved scanning and processing terabytes of data, and they had to make it work in minutes or hours, not days or weeks.</p><p>To do that, they knew a distributed system was the answer — but it had to be simple and accessible so that every engineer in the company could use it without becoming a distributed systems guru.</p><p>The solution? A system where ordinary, day-to-day programmers only needed to implement two functions — map and reduce — to harness 100x performance and scale effortlessly across thousands of machines.</p><p>Remember how we talked about abstractions in the first article? Well, this is where that idea shines.</p><h3>What Problem Does It Solve?</h3><p>Back then — and even now — Google had to tackle massive data processing challenges, including:</p><ul><li>Searching petabytes of crawled web pages and extracting insights</li><li>Data mining at an enormous scale</li><li>Machine learning on vast datasets</li><li>Sorting ridiculously large amounts of data</li></ul><p>For problems like these, Google needed a better way — so they introduced the MapReduce paradigm.</p><p>To put it in perspective, imagine you have a petabyte of crawled web data and need to count how many times a given hyperlink appears to determine a website’s popularity. Doing this efficiently across thousands of machines isn’t trivial.</p><p>Google built hundreds of special-purpose computations to process raw data, like web request logs and crawled documents, to generate useful insights:</p><ul><li>Inverted indices for search</li><li>Graph structures of web links</li><li>Summaries of crawled pages per host</li><li>The most frequent queries in a given day</li></ul><p>While these computations were conceptually simple, the real challenge was scaling them across hundreds or thousands of machines and ensuring they finished in a reasonable time. That’s exactly the problem MapReduce solved.</p><h3>The interface</h3><p>Once after they have fit the various problems they need to solve into a paradigm — a Map/Reduce one.</p><blockquote>MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key.</blockquote><p>They needed to come up with the architecture of their distributed system in a way that&#39;s resilient and performant.</p><p>Again, if we reference the last article, they needed the performance out of it.</p><p>They made a library, where the user can define their own map and reduce functions and run them on thousands of computers. The paper says that the most of the test they have executed ran on nearly 2000 commodity PCs in their data center.</p><p>Once the programmers has implemented a simple interface:</p><pre>map(String key, String value):<br>// key: document name<br>// value: document contents<br>  for each word w in value:<br>    EmitIntermediate(w, &quot;1&quot;);<br><br>reduce(String key, Iterator values):<br>// key: a word<br>// values: a list of counts<br>int result = 0;<br>  for each v in values:<br>    result += ParseInt(v);<br>Emit(AsString(result));</pre><p>Here is an example of counting words in documents.</p><p>The execution was scheduled.</p><h3>Architecture</h3><p>Before continuing with the magic behind the scenes, we first need to say what GFS is.</p><h4>Prerequisites — GFS (Google File System)</h4><p>Google File System was an in-house built distributed, highly available, resilient file system that has chunked large files into 64MB pieces stored in a cluster of computers with different replication factors.</p><p>The Map / Reduce framework was run on a cluster of computers that has already run GFS on them, meaning that the files the Map Reduce was run against were already stored in the local disk of these PCs.</p><h4>Overview</h4><p>The cluster was organized in the following way: a master node and worker nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bicftR5ilG2HPGQCjkmD0w.png" /><figcaption>Overview diagram from the paper</figcaption></figure><p>The master node responsibility was to orchestrate the whole execution of the map-reduce operation. It assigned the map operations for the specific files to specific PCs and after they were completed it scheduled the reduce operations.</p><p>The programmer would define the number of nodes they would like to use when running the processing of the map-reduce function.</p><p>So image this: we want to count all the word occurrences in a petabyte-sized file. What do we need to do?</p><ol><li>Define our map and reduce functions. Their implementation is like the pseudo-code I shared above.</li><li>Provide the parameters of the map reduce operations: the number of map and reduce tasks. A task is a single computer executing either a map or reduce function. Give the file name.</li><li>The system would start scheduling the map operations.</li><li>Each map opeartion is going to produce an intermediate files, containg the result of the map function in the local disk of the PC running the task.</li><li>Once all map functions are completed, the reduce functions are going to get scheduled.</li><li>Each reduce function would then save the final output file, containing the reduce operation back to the GFS.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gGvvoYErmUtFpgHG7l8DOQ.png" /><figcaption>Author diagram</figcaption></figure><p>What you see in the above diagram is the so-called reshuffling as called in the paper. It is the synchronization that the master does in order to provide the results from the map tasks to the reduce tasks. That&#39;s the most expensive operation in the whole system since it required a ton of network traffic in order to move files to the right nodes.</p><p>Back then one of the biggest constraints was the network bandwith they had avaialbe in the datacenter, but more on that later.</p><p>I hope this gives you a nice overview of the whole architecture and the idea behind the paper and what they implemented.</p><p>Now, let&#39;s get into the more interesting details, complementing the distributed system and how they manage to overcome some blockers along the way and achieve high performance.</p><h3>Data Locality Optimization</h3><p>One of the key optimizations in MapReduce is <strong>data locality</strong>. Since Google File System (GFS) stores data in 64MB chunks replicated across different machines, the MapReduce master schedules tasks on machines that already contain the data. This drastically reduces network congestion because data doesn’t need to be transferred across the cluster. If a local copy isn’t available, it assigns the task to a machine close to the data in the network topology, minimizing latency.</p><p>This optimization significantly improves performance because:</p><ul><li>Reads happen from local disks, avoiding costly network transfers.</li><li>Bandwidth is conserved, which is crucial for large-scale data processing.</li><li>Tasks complete faster, as computation happens near the data.</li></ul><h3>Fault Tolerance in MapReduce</h3><p>MapReduce was designed to handle frequent machine failures gracefully. The system employs multiple fault-tolerance mechanisms:</p><h4><strong>Worker Failure Handling</strong></h4><ul><li>The master pings workers periodically to check for failures.</li><li>If a worker fails, all its in-progress and completed map tasks are reassigned because their intermediate data was stored on its local disk.</li><li>Completed reduce tasks are not re-executed, as their output is already stored in GFS.</li></ul><h4><strong>Master Failure Handling</strong></h4><p>The master does not replicate itself; if it fails, the job is aborted. However, clients can retry the MapReduce job.</p><h4><strong>Atomic Task Commit</strong></h4><p>Map and Reduce tasks write to temporary files first and only rename them upon completion to prevent partial results from corrupting the output.</p><h4><strong>Backup (Speculative) Tasks</strong></h4><p>To address stragglers (slow machines due to hardware issues, resource contention, etc.), the master launches duplicate executions of slow tasks. The first to finish is used, and the other is discarded.</p><p>This was a genius move, since in a thousand-machine cluster, you could always expect some hardware or network issues strangling the whole execution.</p><p>This reduces job completion time by up to 44%, as seen in Google’s benchmarks.</p><h3>Why MapReduce Was Revolutionary</h3><p>Many people don’t realize how revolutionary MapReduce was for its time (2004). Before MapReduce, distributed computing required manual fault handling, scheduling, and load balancing. Google turned parallel computation into a simple API.</p><p>It inspired modern systems like Apache Hadoop, Spark, and even Kubernetes batch jobs.</p><p>📌 <strong>Why it’s cool?</strong> <br>This was a paradigm shift — instead of worrying about how to distribute work, engineers could just focus on writing business logic.</p><h3>What Came After MapReduce?</h3><p>While MapReduce was revolutionary for large-scale distributed processing, the industry eventually moved beyond it due to its batch-oriented nature and limitations in iterative and real-time processing. Google’s engineers recognized these drawbacks and developed successor systems that addressed them.</p><p>One major limitation of MapReduce is that it writes intermediate data to disk after every stage, causing significant I/O overhead. This makes it inefficient for tasks requiring multiple iterations, such as machine learning and graph processing. To overcome this, Google introduced Percolator, Dremel, and Pregel, which enable incremental updates, interactive querying, and efficient graph computations.</p><p>Hope you enjoyed today’s summary. I plan on summarizing such influential papers on distributed systems topics in the article series I’m preparing about the topic.</p><p>Please let me know whether you liked and and maybe give me some suggestions on papers you would like summarized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00b664481fc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Distributed Systems: The Foundations of Scalable Computing]]></title>
            <link>https://medium.com/@duhov/demystifying-distributed-systems-the-foundations-of-scalable-computing-4f0c2dbf1681?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f0c2dbf1681</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Sun, 16 Mar 2025 16:29:49 GMT</pubDate>
            <atom:updated>2025-03-17T18:42:51.840Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding the Fundamentals, Challenges, and Key Design Principles of Distributed Systems</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nbjuw2nq67slIMCI" /></figure><h3>What is a distributed system?</h3><p>At its core, a distributed system is a collection of computers working together over a network to accomplish a shared task. Instead of relying on a single machine, these systems distribute computation, storage, or processing across multiple nodes, making them more scalable, resilient, and efficient.</p><p>Common examples include:</p><ul><li>Big data processing frameworks like Apache Hadoop and Spark</li><li>Peer-to-peer file-sharing networks</li><li>Global cloud infrastructure powering applications we use daily</li></ul><p>With the increasing complexity of modern computational challenges, distributed systems are not just useful — they’re becoming the standard.</p><p><em>Every time you use Netflix, Google, or Facebook, you’re interacting with a distributed system. But what makes them so powerful — and so tricky to build?</em></p><h3>When Should You Use a Distributed System?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mpx1Qfi8z4mBzQHD.jpg" /></figure><p>Before diving into distributed systems, exhaust all other options. They are notoriously complex to design, debug, and maintain. Many problems can be efficiently solved on a single machine, so always start there before reaching for the so-called “silver bullet” of distributed computing.</p><p>That said, distributed systems become essential in cases like:</p><ul><li><strong>High performance &amp; parallelism</strong> — When tasks need to be processed concurrently across multiple machines for speed and scalability.</li><li><strong>Fault tolerance</strong> — Ensuring a system remains operational even if individual components fail.</li><li><strong>Geographical distribution</strong> — When data and services need to be physically close to users across different locations.</li><li><strong>Security &amp; isolation</strong> — Segregating workloads for compliance, risk reduction, or protection against localized failures.</li></ul><p>If your system doesn’t require these properties, a well-optimized single-machine solution is often the simpler and more maintainable choice.</p><h3>What are the challenges of distributed systems?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4iSDkLUxgEngJSeb.jpg" /></figure><p>Building a distributed system means dealing with all the headaches of concurrent computing — plus the added complexity of multiple machines communicating over a network. This introduces a whole new world of failure patterns, some of which can be unpredictable and difficult to diagnose.</p><p>Some key challenges include:</p><ul><li><strong>Failure Handling</strong> — In a distributed system, failures are not binary; they can be partial or complete. A single node may crash, a network link may degrade, or, in more extreme cases, nodes may behave inconsistently (<em>see Byzantine Fault Tolerance</em>). Designing for these scenarios is critical.</li><li><strong>Scalability vs. Performance</strong> — Simply adding more machines doesn’t guarantee a linear performance boost. Efficient scaling requires careful system design to minimize bottlenecks and optimize resource utilization.</li><li><strong>Network Complexity</strong> — Unlike a single-machine system, distributed systems must handle unreliable communication, latency issues, and data consistency challenges across nodes.</li><li><strong>Consistency vs. Availability</strong> — The well-known CAP theorem states that a distributed system cannot achieve perfect consistency, availability, and partition tolerance at the same time. Trade-offs must be carefully managed.</li></ul><p>Getting the most out of a distributed system requires thorough architecture, deep knowledge of failure modes, and well-thought-out scaling strategies. Otherwise, you might end up with more complexity than benefit.</p><h3>Infrastructure in distributed systems</h3><p>Before diving into distributed systems, you’ll need a solid understanding of infrastructure. Since one of the main reasons for building a distributed system is performance, squeezing out every bit of efficiency requires choosing the right infrastructure for the problem at hand.</p><p>Some key infrastructure components that play a crucial role in distributed systems:</p><ul><li><strong>Storage</strong> — Distributed databases, object storage, and file systems.</li><li><strong>Computation</strong> — Scalable compute clusters, parallel processing, and container orchestration.</li><li><strong>Communication</strong> — Networking, message queues, and protocols for efficient data exchange.</li></ul><p>A major design goal in distributed systems is to <strong>hide</strong> their complexity behind abstractions, making them easier to build upon. Ideally, developers should work with a system as if it were a single, unified entity, rather than dealing with the messy details of distributed storage, computation, and communication.</p><p>Fortunately, modern cloud providers offer <strong>high-performance, highly available, and resilient</strong> infrastructure solutions that simplify this process. A great example is <strong>AWS S3 (Simple Storage Service)</strong> — it abstracts away the complexity of distributed storage, allowing users to store and retrieve data without worrying about replication, fault tolerance, or scaling.</p><p>Choosing the right infrastructure can make or break a distributed system, so understanding these components is key to designing a robust and efficient architecture.</p><h3>Implementation Techniques in Distributed Systems</h3><p>To build the abstractions needed for a well-structured distributed system, we rely on several key programming techniques. These tools help hide the complexity of distribution, improve performance, and ensure correctness in a system where multiple components operate in parallel.</p><p>Some essential implementation techniques include:</p><ul><li><strong>Remote Procedure Calls (RPC)</strong> — Since distributed systems involve communication between machines, we want to make remote calls feel as seamless as local function calls. RPC frameworks (like gRPC, Thrift, or RMI) help abstract away network communication, reducing the friction of working with distributed components.</li><li><strong>Threads &amp; Parallelism</strong> — High-performance systems need to maximize CPU utilization. Threads allow us to run tasks concurrently within a single machine, improving efficiency and responsiveness. Given that distributed systems rely heavily on parallel processing, effective threading models are crucial.</li><li><strong>Concurrency Control</strong> — Synchronization across nodes is a fundamental challenge. Distributed systems need mechanisms to coordinate shared state and avoid race conditions. Classic concurrency controls like <strong>locks, leader election, and quorum-based mechanisms</strong> (e.g., Paxos, Raft) play a significant role in ensuring consistency.</li></ul><p>Each of these techniques comes with its own trade-offs, and applying them correctly requires a deep understanding of distributed computing principles. Managing concurrency across multiple nodes, for example, is far trickier than handling it within a single machine, as issues like <strong>distributed deadlocks, network partitions, and clock synchronization</strong> introduce new layers of complexity.</p><h3>Requirements of a Distributed System</h3><p>A well-designed distributed system must meet several key requirements to be scalable, reliable, and consistent while handling the inherent complexity of running across multiple machines.</p><h4>1. Performance (Scalability)</h4><p>When adding more machines to a distributed system, the ideal scenario is <strong>linear scalability</strong> — meaning that doubling the number of nodes should double the processing speed or throughput. However, in reality, the scaling factor is often lower due to overhead like communication delays and coordination efforts.</p><p>For example, in big data processing, adding a second server should ideally halve the processing time for a large dataset, but in practice, factors like network latency and synchronization reduce the actual performance gain.</p><h4>2. Fault Tolerance</h4><p>In a system with a single computer, failures are rare. In a distributed system with thousands of machines, failures are an everyday reality — something is always broken, whether it’s a server crash, network failure, or disk corruption.</p><p>To handle this, distributed systems rely on:</p><ul><li><strong>Availability</strong> — Ensuring services remain accessible, often through replication.</li><li><strong>Recoverability</strong> — Automatic self-healing mechanisms, such as state persistence (checkpointing, non-volatile storage) and replication, to ensure minimal manual intervention.</li></ul><p>For instance, cloud storage solutions like <strong>Amazon S3</strong> replicate data across multiple locations, so if one data center goes down, the system remains operational.</p><h4>3. Consistency</h4><p>One of the biggest challenges in distributed systems is maintaining a consistent view of data across multiple nodes. Unlike single-machine systems where there is a single source of truth, distributed systems often have multiple copies of the same data that may be temporarily out of sync.</p><p>Different consistency models define how strictly data should be synchronized:</p><ul><li><strong>Strong Consistency</strong> — Every read returns the most recent write. This ensures accuracy but is expensive in terms of performance.</li><li><strong>Weak Consistency</strong> — Some reads may return stale data, which is faster and more scalable but can lead to temporary inconsistencies.</li><li><strong>Eventual Consistency</strong> — Over time, all replicas converge to the latest state, striking a balance between performance and correctness.</li></ul><p>Example: <strong>DNS (Domain Name System)</strong> follows eventual consistency — when a record is updated, it takes time for the change to propagate across all DNS servers, meaning some users might see outdated data temporarily.</p><p>Balancing performance, fault tolerance, and consistency is the core challenge of designing a distributed system. The right trade-offs depend on the specific use case and system requirements.</p><h3>Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*-pZbNJ-ydWwA158u.jpg" /></figure><p>Distributed systems have become an essential part of modern computing, enabling scalable, fault-tolerant, and high-performance solutions to complex problems. However, they come with significant design challenges and trade-offs that must be carefully considered.</p><p>This article covered the fundamentals of distributed systems, including:</p><ul><li><strong>What they are</strong> — A collection of interconnected computers working together to accomplish a shared task.</li><li><strong>When to use them</strong> — Only when necessary, as their complexity often outweighs the benefits unless scalability, fault tolerance, or geographical distribution is required.</li><li><strong>Key challenges</strong> — Handling failures, maintaining consistency, and optimizing performance while dealing with network communication and concurrency issues.</li><li><strong>Infrastructure considerations</strong> — Choosing the right storage, computation, and networking solutions to abstract the complexity of distribution.</li><li><strong>Implementation techniques</strong> — Using tools like RPC, threading, and concurrency control to manage distributed workloads effectively.</li><li><strong>Essential system requirements</strong> — Ensuring performance, fault tolerance, and consistency through well-designed architectures and scaling strategies.</li></ul><p>While distributed systems provide immense power and flexibility, they are not a one-size-fits-all solution. Designing them requires a deep understanding of trade-offs between performance, availability, and consistency. By carefully evaluating the need for distribution and leveraging the right tools and infrastructure, developers can build robust and efficient systems that meet modern computational demands.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f0c2dbf1681" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database Fundamentals: Understanding WAL for Data Integrity and Efficiency]]></title>
            <link>https://medium.com/@duhov/database-fundamentals-understanding-wal-for-data-integrity-and-efficiency-0fb97f9513d2?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fb97f9513d2</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 21:28:53 GMT</pubDate>
            <atom:updated>2025-01-10T21:28:53.655Z</atom:updated>
            <content:encoded><![CDATA[<h4>Explore how Write-Ahead Logs (WAL) ensure data durability and consistency in databases while making it faster</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FvZL8XMpJ4QQ0u2F.jpeg" /></figure><h3>Why is it important?</h3><p>In the ever-evolving landscape of databases, ensuring <a href="https://medium.com/@duhov/decoding-acid-for-database-choice-a-guide-to-data-integrity-performance-46eb6cc03f13">data integrity and durability is crucial</a>, especially in the face of unexpected crashes or power outages. One of the key mechanisms that databases use to maintain these properties is the Write-Ahead Log (WAL). This article delves into what WAL is, how it functions, and why it is a cornerstone of modern database reliability.</p><h4>What is it?</h4><p>WAL is an <strong>append-only</strong> structure stored on disk. This means new changes are simply added to the end of the log, and existing entries are never altered. This append-only nature makes writing to the log efficient and reliable.</p><h4>Key Characteristics:</h4><ul><li><strong>Append-Only:</strong> New data can be appended, but existing data is immutable. This design is efficient for disk I/O, as sequential writes are faster than random ones.</li><li><strong>Disk-Resident:</strong> WAL logs are stored on disk, making them durable. Even if a power outage occurs, the WAL entries remain intact.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*u_YUIdUCWffeaYQz.png" /><figcaption>Append only image</figcaption></figure><h3>When do we create a WAL log?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*17EiWSTxUfsH-COAz6T6sg.png" /><figcaption>Author image displaying the steps to complete a transaction.</figcaption></figure><p>Imagine we have an insert transaction. When does the DB marks it as completed and returns success to the client:</p><ol><li>The data to be inserted is <strong>written to in-memory structures</strong> (like the database cache or buffer pool). This is faster than writing directly to disk and makes the data servable, although it might not be yet persisted on disk.</li><li>Before the data is physically inserted into the table, the changes are recorded in the WAL. Remember that this is an append-only operation, meaning new entries are added sequentially, which is efficient for disk I/O.</li><li>When you issue a COMMIT command, the database must ensure that all changes made by the transaction are safely stored, even if a crash happens immediately after. This happens by flushing the WAL change on disk.</li></ol><ul><li>The WAL flush is a critical step because it guarantees durability. Once the WAL entries are safely on disk, the system can acknowledge the commit.</li></ul><p>Once the change is recorded as WAL log on the disk the database can determine when to apply the change on the data files. If anything happens of the DB before that, it can easily reconstruct the changes by replaying the WAL logs from the previous checkpoint, thus promising consistency and durability.</p><h4>What happens on rollback?</h4><ul><li><strong>No WAL Flushing:</strong> WAL entries for a rolled-back transaction are not flushed to disk since they are not part of a committed transaction.</li><li><strong>Rollback and Recovery:</strong> In case of a crash, the database will not replay WAL entries for rolled-back transactions, maintaining consistency.</li><li><strong>Log Management:</strong> Uncommitted WAL entries from rolled-back transactions are eventually discarded during routine database maintenance processes like log truncation and checkpointing.</li></ul><h3>What is checkpointing?</h3><p>We’ve mentioned checkpointing a few times, so let’s break it down.</p><p>Checkpointing is a process designed to optimize both performance and crash recovery. It creates a consistent snapshot of the database at a specific moment in time. This snapshot helps minimize recovery work by reducing the number of transactions that need to be replayed from the WAL during a crash.</p><p>Imagine your database crashes? How does it maintain consistency and durability?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/0*h5sDy_TFrO_8BoZW.png" /><figcaption>Checkpointing process</figcaption></figure><p>Simply by processing the WAL files flushed on disk since the last known processing. Imagine it like a save — the DB remembers which WAL files have been applied on disk and in case of a recovery, it processes only the non checkpointed ones. This way it maintains performance and efficiency upon a crash recovery needed.</p><h3>How to Turn On WAL?</h3><p>In most modern databases, WAL is enabled by default. Here’s how you can manage WAL settings in some popular databases:</p><ul><li><strong>PostgreSQL:</strong> WAL is enabled by default. You can configure it through the postgresql.conf file with parameters like wal_level, wal_buffers, and checkpoint_timeout.</li><li><strong>MySQL (InnoDB):</strong> WAL-like behavior is provided by the redo log, which is also enabled by default.</li><li><strong>SQLite:</strong> WAL mode is not enabled by default. You can enable it by executing PRAGMA journal_mode=WAL;.</li></ul><h3>Conclusion</h3><p>Write-Ahead Logging is a fundamental feature that ensures the durability and consistency of data in databases. By understanding how WAL works, when it’s used, and how to configure it, you can better appreciate the robustness of modern database systems. Whether you’re managing a small SQLite database or a large-scale PostgreSQL deployment, WAL plays a critical role in keeping your data safe and consistent.</p><h3>Best Practices for WAL Management:</h3><ul><li><strong>Optimize WAL Size:</strong> Configure the WAL size appropriately to balance performance and disk usage.</li><li><strong>Regular Checkpoints:</strong> Ensure checkpoints are set at optimal intervals to prevent excessive WAL buildup while maintaining recovery efficiency.</li><li><strong>Monitor and Archive:</strong> Regularly monitor WAL usage and archive old logs to avoid running out of disk space.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fb97f9513d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Extreme Responsibility Can Enhance Your Career]]></title>
            <link>https://medium.com/@duhov/how-extreme-responsibility-can-enhance-your-career-aded29f9b158?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/aded29f9b158</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[career-development-tips]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Sun, 24 Nov 2024 17:03:10 GMT</pubDate>
            <atom:updated>2024-11-24T17:03:10.931Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is extreme responsibility and how can it elevate your career?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MWuKU3hP87tOI9dz" /><figcaption>AI generated image</figcaption></figure><h3>💥 Extreme Responsibility: The Origin</h3><p>The term <em>extreme responsibility</em>, or as Jocko Willink calls it, <em>extreme ownership</em>, has gained significant popularity in recent years, especially in leadership and professional development circles. Jocko, a former U.S. Navy SEAL, introduced the concept in his impactful TED Talk and book <em>Extreme Ownership</em>.</p><p>The idea stems from a personal experience in 2008 during a high-stakes military operation in Iraq. A critical miscommunication led to a tragic instance of friendly fire between two of his units. Instead of deflecting blame, Jocko took full responsibility for the incident — acknowledging that, as the leader, it was his duty to ensure such mistakes didn’t happen. This pivotal moment shaped his philosophy: leaders are accountable for everything under their command, no matter how complex or chaotic the situation.</p><h3>🤔 Who Is Extreme Responsibility For?</h3><p>In Jocko’s example, the principle is clearly directed at leaders. But here’s the thing: <em>everyone</em> is the leader of their own life and work.</p><p>This means you don’t have to hold a formal leadership or management position to embrace extreme responsibility. Whether you’re a junior developer, a designer, or a QA engineer, you can apply these principles to your day-to-day life and career.</p><p>In this article, I’ll focus on how <em>non-leaders</em> or <em>individual contributors</em> can apply extreme responsibility to elevate their work, gain trust, and fast-track their career growth.</p><h4>👩‍💻👨‍💻 What Do We Lead as Non-Leaders?</h4><p>If you’re asking yourself, <em>“How can I lead if I’m not a manager or team lead?”</em>, the answer is simple: <em>you lead yourself</em>.</p><p>When you take ownership of your work, your outcomes, and even your mistakes, you become the executor of your own will. You can view your role as one of self-leadership, where you’re responsible for driving your own progress, learning, and results.</p><p>Let’s explore the core principles of extreme responsibility and how you can embody them in your career.</p><h3>🛡️ Take FULL Responsibility</h3><p>The essence of extreme responsibility is this: <em>take as much responsibility as you can handle — and then some</em>.</p><p>Your career progress is often measured by the scope of responsibilities you manage. More responsibility means more seniority, more trust, and yes, more work. But it also means more opportunities to grow, learn, and lead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*e9qQ_aBDc--gzuK5P8Q8Sg.png" /></figure><h4>How to Take Responsibility</h4><ol><li>💪 <strong>Start With Self-Honesty</strong><br>Taking responsibility starts with admitting to yourself where you went wrong. If you can’t be honest about your mistakes, you can’t own them. Look inward whenever something goes wrong and ask yourself: <em>What role did I play in this? What could I have done differently?</em></li><li>📈 <strong>Take Ownership Publicly</strong><br>Once you’ve acknowledged your part in a situation, take it a step further: own it publicly. Many people struggle with this due to fear of judgment or criticism. But here’s the twist: <strong>the more you take responsibility, the more you’re trusted with greater responsibilities.</strong></li></ol><p>In today’s world, taking responsibility is rare, which makes it an incredibly valuable trait. It’s a quality that sets you apart and signals maturity, integrity, and leadership potential.</p><h3>😌 Why You Shouldn’t Worry About Taking Responsibility</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6wQ6QS50-S6cUQJNNgy3g.png" /></figure><p>It’s natural to feel hesitant about owning up to mistakes, but here’s why you shouldn’t worry, and why you should view it as an exciting opportunity instead of a burden:</p><ol><li>🤝 <strong>It Builds Trust and Credibility</strong><br>When you take responsibility, you demonstrate integrity. People respect those who face challenges head-on rather than deflect blame. This strengthens trust with your peers, managers, and team members.</li><li>🌱 <strong>You Inspire Others</strong><br>Responsibility is contagious. When someone takes ownership, it encourages others to do the same. It fosters a culture of accountability where everyone strives to perform better instead of hiding behind excuses.</li><li>🚫 <strong>It Frees You From Excuses</strong><br>Constantly deflecting blame or making excuses is exhausting and counterproductive. Owning your part in a situation liberates you and allows you to focus on solutions instead of dwelling on problems.</li><li>🏅 <strong>It’s a Path to Respect and Leadership</strong><br>Leaders aren’t born — they’re made through actions that inspire others. Taking responsibility is one of those actions. Even if you’re not in a formal leadership role, this behavior signals your readiness to lead when the opportunity arises.</li></ol><h3>🌟 All Said and Done</h3><p>Give extreme responsibility a try. Start by taking ownership of small tasks, then gradually expand your scope. You’ll quickly notice the difference: you’ll feel more in control, gain the trust of those around you, and progress faster in your career.</p><p><strong>When you embrace responsibility, you’ll find it’s not a burden but a gateway to growth, trust, and achievement.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aded29f9b158" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is a Software Engineering Degree Worth It in 2025? My Journey and Advice]]></title>
            <link>https://medium.com/@duhov/is-a-software-engineering-degree-worth-it-in-2025-my-journey-and-advice-a4d64c75a3b0?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4d64c75a3b0</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[univeristy]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 06:32:26 GMT</pubDate>
            <atom:updated>2025-03-30T14:11:18.368Z</atom:updated>
            <content:encoded><![CDATA[<h4>Are you wondering if a bachelor’s degree in software engineering is still worth it? Let me share my experience as a recent graduate who worked throughout my studies.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgPHFHHByr5P8CVCqd2vrw.png" /></figure><h3>📚 <strong>Background</strong></h3><p>Before getting into the start of the bachelor&#39;s degree, I think it is just fair to offer you some background information about myself so you can understand my position better.</p><p>Since high school, I knew what degree I wanted to pursue and the specific field, even the company, I wanted to work in. I have participated in many coding competitions, olympiads, developed side projects, and games. During my final year in high school, I started freelancing as a software engineer and manual QA tester. One of the coolest projects was developing a series of educational mobile games for a client who managed a platform for kids, focusing on memory, arithmetic, and English skills.</p><p>Every day before school, I woke up at 5:45 a.m. so I could freelance, then went to school, and when I got back, I continued working until 6:00 p.m. From this experience, I learned invaluable skills in multitasking, prioritizing, and, most importantly, time management—skills that proved invaluable multiple times later in my career.</p><h3>📚 💁‍♂ Pre-bachelor</h3><p>In my final year in high school, I was super invested in choosing “the best” university. Sadly, at a later stage, I understood that such a unicorn doesn’t exist, but that&#39;s another topic. I was probably asking myself all the questions you are asking yourself right now if you are in the same position as this huge choice — deciding which university to study.</p><p>💡 <strong>Here’s my first piece of advice</strong>: attend as many university fairs as possible, and speak to people with similar goals or those already in your dream field. They will all give you an invaluable insight into all the tiny details you never thought about and break some romantic expectations you might have.</p><h3>🏫 Bachelor</h3><p>After much thought and evaluation, I chose to attend the Technical University of Sofia, or at least that’s where I have ended up. Although it wasn’t my dream university, I later realized it was one of the best choices I could have made.</p><p>I enrolled during the peak of the COVID pandemic, so it wasn’t the regular university experience. Most of the lectures were online and remote, I was going to the university mostly to the cafeteria for the food it offered.</p><p>I will admit that I had greater expectations about the quality of education and in general about my bachelor&#39;s degree, and at first was a bit disappointed. However, soon enough, I learned how to use these cons at first in my advantage. I decided that I could again manage both work and study and started applying for my first full-time job.</p><p>Finally, I managed to land my dream job at VMware Carbon Black as a full-time junior software engineer. My previous freelancing experience and managing work and high school were the game-changers that convinced my hiring manager back then. Maybe that’s another topic for another great story.</p><p>💡 <strong>Here’s my next advice: </strong>if you want to work early in your bachelor’s degree, start preparing as soon as possible. Don’t rely on the university to teach you everything or secure a job for you.</p><p>Even since I was at the start of my high school, my father always said that high school is for studying hard and university is more for the connections you make. Back then, I didn’t like what he was constantly saying to me since I had more romantic expectations for the university way of life and dynamics. However, once again he turned out to be completely right.</p><p>💡 <strong>My next piece of advice</strong>: network as much as possible while you’re there.</p><p>Especially for me, it was really important since I was from another town and had almost zero connections in the new city, except for the friends who also decided to study in Sofia. <strong>Meet as many people as possible</strong>. The friendships and connections are what truly last after a degree; you might forget how to calculate triple integrals, but the friends you made learning them will remain.</p><h3>🎓Post-bachelor</h3><p>It has been a few months since I finished my bachelor&#39;s degree. Not much has changed in terms of my career, except now I can check off ‘bachelor’s degree’ on forms, and my grandmother is happier than ever.</p><h4>✅ Takeaways:</h4><p>📌 I have met a lot of colleagues with better university education than mine — some with the same as my engineering level, some with higher, some with lesser — the degree doesn’t matter.</p><p>📌 If you’re determined to learn, nothing can stop you.</p><p>📌 University is the best place for networking and making new friends!</p><p>📌 Don’t take anything for granted. You never know when something’s for the best, as in my case!</p><p>Now that I have shared with you my experience, it is time to answer the question from the title.</p><h4>📅 Is it worth pursuing a software engineering degree in 2025?</h4><p>So, is it worth pursuing a software engineering degree in 2025? It depends on your goals and your background. Ultimately, the decision — and the responsibility — is yours!</p><p>If you have also completed your bachelor&#39;s degree, let me know what your take is on the value of a degree in software engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4d64c75a3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimistic vs. Pessimistic Locking in Databases]]></title>
            <link>https://medium.com/@duhov/optimistic-vs-pessimistic-locking-in-databases-c32a52aeadfe?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c32a52aeadfe</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 08:31:58 GMT</pubDate>
            <atom:updated>2024-11-11T08:31:58.659Z</atom:updated>
            <content:encoded><![CDATA[<h4>When to expect the best, and prepare for the worst</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yll47Mp4kBeSdMu7pYrGKw.png" /></figure><h3><strong>Real-World Etymology</strong></h3><p>To get a better handle on optimistic and pessimistic locking, let’s break down the origins of these terms and how they reflect each approach.</p><ul><li><strong>Optimistic Locking</strong>: Rooted in the concept of <em>optimism</em> — expecting minimal conflict. Imagine setting out on a hike without serious equipment like heavy-duty boots, detailed maps, or a flashlight, because you expect everything to go smoothly: good weather, well-marked trails, and water available when needed. You’re confident in a conflict-free experience, so you pack light and move quickly.</li><li><strong>Pessimistic Locking</strong>: Derived from <em>pessimism</em> — preparing for the worst-case scenario. Now picture yourself heading out with a backpack full of supplies: maps, durable clothing, extra water, a shovel, and even a camping kit. You’re not certain what challenges the hike may bring, so you plan for any possible obstacle.</li></ul><h3><strong>Concurrency Control</strong></h3><p>When multiple transactions try to access the same resources simultaneously, effective concurrency control is essential to determine the order and scope of each transaction. Concurrency control ensures that transactions execute in a balanced and orderly manner, helping you maintain data integrity and manage conflicts.</p><p>For <strong>read transactions</strong>, isolation levels are at your disposal — <a href="https://medium.com/@duhov/decoding-acid-for-database-choice-a-guide-to-data-integrity-performance-46eb6cc03f13"><strong><em>check out my article on ACID principles</em></strong></a> where I delve into these in more detail. By leveraging concurrency control, you can make transactions behave as intended, minimizing conflicts and ensuring data consistency.</p><p>If you’re unsure what would happen if two transactions attempt to write at the same time while a third reads from the same resource, <strong>this could signal a design flaw</strong>.</p><p>As you write queries and design databases, always consider isolation and locking mechanisms — they’re the backbone of robust transaction handling.</p><h3><strong>Pessimistic locking</strong></h3><h4><strong>How Pessimistic Locking Works</strong></h4><p>Imagine a row in a database containing two fields: name and cash. Now picture multiple transactions trying to access this row at the same time — two attempting to write and one trying to read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*Xuu-PiE58D9_zDDLm3tBAA.png" /><figcaption>Multiple transactions trying to access the same resources.</figcaption></figure><p>What would happen with pessimistic locking enabled?</p><p>With <strong>pessimistic locking</strong> enabled, the first transaction to access the row (say, Transaction 1) acquires an <strong>exclusive lock</strong>. This lock ensures that no other transactions can modify the row until Transaction 1 completes its update. Consequently, any other write or read transactions must wait until the lock is released, guaranteeing that the read transaction sees only the latest committed value, neatly serialized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*CMnhLQf8cX4pFGBFZU09sQ.png" /><figcaption>Transaction 1 successfully acquiring the lock and modifying the row.</figcaption></figure><p>Once Transaction 1 completes and releases the lock, the other two transactions race to acquire it. Whichever transaction locks the row next will see the updated cash value, ensuring consistency and order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*Vba9P-WN8c_71aR7icNaHA.png" /><figcaption>T1 finished and the other two will try to acquire the lock.</figcaption></figure><h4>Advantages and Trade-Offs of Pessimistic Locking</h4><p>As everything in software engineering, <strong>the pessimistic lock comes with a cost — the time the row is locked.</strong></p><p>Though the locking time for a row occurs in microseconds or milliseconds, this delay can become significant when scaling up. If you’re dealing with hundreds of transactions on a single row, you might need to revisit the database design to prevent bottlenecks, as high contention on a single row could signal a design issue.</p><h4>How to?</h4><p>To enable pessimistic locking in SQL, you typically use the SELECT ... FOR UPDATE.</p><h3>Optimistic locking</h3><h4>How Optimistic Locking Works</h4><p>It might sounds a little confusing but with optimistic locking there is no actual lock involed.</p><p>If we observe the above scenario with the three transactions, this time we won’t have a lock meaning that all transactions would be able to access the row simultaneously.</p><p>With <strong>optimistic locking</strong>, each transaction retrieves the data without acquiring a lock on the row. Each transaction reads the current state of the row, typically tracking the row’s version number (or timestamp) along with the data.</p><p>The optimistic lock may heavily depend on the implementation, it can be either implemented on the applicaiton level or on the DB level.</p><p>Below is a classic DB implementation using version:</p><ol><li><strong>Transaction Begins:<br></strong>Each transaction reads the row, including a version number column or timestamp to track the data state.</li><li><strong>Update Attempt</strong>: When a transaction is ready to update the row, it checks the version number (or timestamp) to see if another transaction has modified the data since it first read it.</li><li><strong>Commit or Retry</strong>:</li></ol><ul><li>If the version number matches what the transaction initially read, it means no other transaction has modified the row. The transaction updates the row, increments the version number, and commits.</li><li>If the version number has changed, another transaction has already updated the row. This transaction then rolls back and retries, re-reading the row with the new version number.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/0*Mv7Qz_kQNkgh1bsx.png" /><figcaption>Flow of optimistic locking.</figcaption></figure><h3>Summary: Making the Choice</h3><ul><li>Use <strong>pessimistic locking</strong> for high-conflict, write-heavy environments where data integrity is critical and lock contention is manageable.</li><li>Use <strong>optimistic locking</strong> for high-concurrency, read-heavy, or low-conflict environments where retries are acceptable and performance is a priority.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c32a52aeadfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Code: Why Understanding Infrastructure Matters for Software Engineers]]></title>
            <link>https://medium.com/@duhov/beyond-code-why-understanding-infrastructure-matters-for-software-engineers-3cfa2900ffb2?source=rss-b4a82f3a41dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cfa2900ffb2</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ivan Duhov]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 21:57:45 GMT</pubDate>
            <atom:updated>2024-11-09T21:57:45.264Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why should I care how and where our code is deployed? Why bother learning about the infrastructure behind our applications</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8vsyV7byu60hNcciRdrHw.png" /></figure><p>If you’ve ever asked yourself these questions, you might be missing out on a key skill that can transform your effectiveness as an engineer. Let me give you some examples, share my perspective on the topic, and offer some advice on how this understanding can dramatically improve both your operational efficiency and your software engineering skills.</p><h3><strong>Why should I care?</strong></h3><p>In the real world, writing code alone isn’t enough to get a product into the hands of users. Every product must pass through multiple phases — planning, defining business requirements, testing, deployment, and scaling — before it can effectively serve its users.</p><p>The more you understand each phase of the SDLC, the better. Each of these phases impacts how your code performs in the real world, and understanding them will make you a better <strong><em>software engineer</em></strong>.</p><p>That’s why many big tech companies adopt the “You build it, you test it, you run it” principle, emphasizing end-to-end ownership of the product. In companies like Palantir, for example, they even have dedicated “deploying engineers” who engage deeply across the SDLC to ensure that software not only works but also operates smoothly. The more you know about the product’s journey, the more capable and prepared you are to tackle issues as they arise.</p><p>In one of my previous companies, we had a staff engineer who didn’t realize we’d been running our workload on Kubernetes instead of ECS — until <em>two months</em> later. And when he did find out, Kubernetes was still “KubernetICs” to him! You can imagine the operational efficiency that resulted.</p><p>This knowledge isn’t just useful for tackling production issues; it can make your day-to-day work significantly easier, letting you make informed decisions and respond quickly when things go wrong.</p><h3><strong>How much should I care?</strong></h3><p>Every engineer should understand the <em>basics</em> of how services are deployed and run in production, even if infrastructure isn’t their main focus. This includes knowing what Kubernetes, ECS, or any other orchestrator does as a container orchestrator, why RDS is often chosen for managed databases, and when EC2 might be preferred for certain workloads. Additionally, engineers should have a working knowledge of their cloud provider’s offerings. This way, when designing and architecting applications, they’ll know what tools are available and make informed choices.</p><p>This foundational understanding enables engineers to discuss infrastructure with other teams, recognize when configurations might be misaligned, and communicate more effectively with DevOps or SRE teams. Effective communication is critical; to sync successfully with other teams, you need to be able to clearly explain issues and propose viable solutions.</p><p>For example, in one of my recent projects, we used a self-hosted TimescaleDB. After multiple application-level optimizations, we realized that the performance bottleneck was the disk. Effectively communicating this and planning a solution required knowledge of the disk options available, allowing us to strategize and plan infrastructure changes with confidence.</p><h3><strong>In summary</strong></h3><p>Understanding infrastructure isn’t just a “nice-to-have” skill for software engineers; it’s essential for creating resilient, scalable, and efficient software. Knowing the basics of how services run and the tools available for deployment, scaling, and maintenance can significantly enhance your productivity and collaboration with other teams. As the tech landscape continues to evolve, engineers who invest time in learning about infrastructure will not only be more effective but also more adaptable to new challenges.</p><p>So, the next time you’re building or deploying, take a moment to think beyond the code — understanding the environment your applications live in might just make all the difference.</p><p><strong>Infrastructure may feel like background knowledge, but it’s often the difference between a good engineer and a great one</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cfa2900ffb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>