<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: EH FAHIM</title>
    <description>The latest articles on DEV Community by EH FAHIM (@fahimeshti).</description>
    <link>https://dev.to/fahimeshti</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F662098%2F9b68dbf2-190a-4aad-8960-be62244daed9.jpeg</url>
      <title>DEV Community: EH FAHIM</title>
      <link>https://dev.to/fahimeshti</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fahimeshti"/>
    <language>en</language>
    <item>
      <title>Understanding the CAP Theorem: A Cornerstone of Distributed Systems</title>
      <dc:creator>EH FAHIM</dc:creator>
      <pubDate>Fri, 04 Jul 2025 19:09:43 +0000</pubDate>
      <link>https://dev.to/fahimeshti/understanding-the-cap-theorem-a-cornerstone-of-distributed-systems-5el3</link>
      <guid>https://dev.to/fahimeshti/understanding-the-cap-theorem-a-cornerstone-of-distributed-systems-5el3</guid>
      <description>&lt;p&gt;The &lt;strong&gt;CAP Theorem&lt;/strong&gt; is a fundamental concept in the field of distributed computing, describing the trade-offs that system designers face when building distributed data stores. In this article, we’ll explain what the CAP Theorem states, why it’s important, and how it shapes the design of modern distributed systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the CAP Theorem?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;CAP Theorem&lt;/strong&gt; formulated by Eric Brewer in 2000 states that in a distributed system, it is impossible to simultaneously guarantee all three of the following properties:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consistency (C):&lt;/strong&gt; Every read receives the most recent write or an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability (A):&lt;/strong&gt; Every request (read or write) receives a (non-error) response without guarantee that it contains the most recent write.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Tolerance (P):&lt;/strong&gt; The system continues to operate despite arbitrary partitioning (network failures that split communication between nodes).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The theorem tells us that a distributed system can only provide at most &lt;strong&gt;two of these three guarantees at the same time&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Geometric Intuition
&lt;/h2&gt;

&lt;p&gt;Imagine a triangle where each corner represents one of the three properties: Consistency, Availability, and Partition Tolerance. When a network partition occurs which is inevitable in distributed systems you can only choose between &lt;strong&gt;Consistency&lt;/strong&gt; and &lt;strong&gt;Availability&lt;/strong&gt;, because &lt;strong&gt;Partition Tolerance&lt;/strong&gt; becomes a necessity.&lt;/p&gt;

&lt;p&gt;This forces system designers to make hard choices depending on the specific requirements of their applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  Proof Sketch
&lt;/h2&gt;

&lt;p&gt;The theorem is not mathematically proved in the traditional sense but demonstrated through thought experiments and practical examples. When a partition happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To maintain &lt;strong&gt;Consistency&lt;/strong&gt;, nodes must agree on the same value before responding which might require rejecting some requests (thus sacrificing Availability).&lt;/li&gt;
&lt;li&gt;To maintain &lt;strong&gt;Availability&lt;/strong&gt;, nodes respond immediately even if their data is stale or inconsistent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thus, it is impossible to guarantee all three when a partition exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Examples
&lt;/h2&gt;

&lt;p&gt;Here are examples of distributed databases and their design choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CP Systems (Consistency &amp;amp; Partition Tolerance):&lt;/strong&gt; Examples include HBase and MongoDB (in some configurations), where consistency is prioritized over availability during a partition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AP Systems (Availability &amp;amp; Partition Tolerance):&lt;/strong&gt; Systems like Cassandra and DynamoDB prioritize availability over strict consistency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CA Systems (Consistency &amp;amp; Availability):&lt;/strong&gt; This is only possible if the system assumes no partitions which is unrealistic in distributed systems.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Applications and Impact
&lt;/h2&gt;

&lt;p&gt;The CAP Theorem has guided the design of many modern technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud databases&lt;/li&gt;
&lt;li&gt;Distributed file systems&lt;/li&gt;
&lt;li&gt;Data replication strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It helps engineers decide what trade-offs make sense given their needs whether they prioritize data correctness (Consistency), uninterrupted service (Availability), or resilience to failures (Partition Tolerance).&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The CAP Theorem reminds us that distributed systems cannot be perfect. Understanding its implications allows developers to make informed decisions about the architecture of their systems. When designing or choosing a distributed database, always ask: which two of the three properties are most important to me?&lt;/p&gt;




</description>
    </item>
    <item>
      <title>Versioning technic in short</title>
      <dc:creator>EH FAHIM</dc:creator>
      <pubDate>Thu, 21 Apr 2022 12:57:24 +0000</pubDate>
      <link>https://dev.to/fahimeshti/versioning-technic-in-short-3k5p</link>
      <guid>https://dev.to/fahimeshti/versioning-technic-in-short-3k5p</guid>
      <description>&lt;p&gt;If you ever noticed the version of a software, you must have noticed something like v1.1.0. Today we’ll see how they work. Versioning system like this is called a semantic versioning. In this system there are three numbers, the first one is called the Major version and the second one is called the minor version, and the third one is called the patch version or release.  Let’s explain:&lt;/p&gt;

&lt;p&gt;The patch version or patch release is for bug fixing, let’s say we have version 4.13.6 of a software and a bug was found, after fixing the bugs the version would be 4.13.7. So, when the developers fix a bug, they will increase the patch version. The Minor version is used for adding new features that will not break the existing software. So, after a minor update the version would be 4.14.0, notice the patch version is reset to 0? It’s because no bugs were found on this version yet, so it could be unstable and as soon as they find a bug, they will increase the patch version. Now if the update contains a breaking change in the software or If it’s a big update they will increase the Major version, so it’ll be 5.0.0.&lt;/p&gt;

&lt;p&gt;Extra: In the node package file you will see something like "^4.12.6", this '^' is called the caret character, this means the PM is allowed to install update version of that software as long as the major version is 4. For example, when someone downloads a git repo long after it was uploaded and does npm install, the PM might install newer version like 4.21.6 keeping the major version same. Sometimes the '~' (tilde) character is also used to tell the PM to keep the major and minor version same. So if old version was like 4.12.6 it might install 4.12.16 depending on the software update. So the caret is used to denote 4.x.x and tilde is used to denote 4.12.x.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
