<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged low</title>
<link>https://coderlegion.com/tag/low</link>
<description>Powered by Question2Answer</description>
<item>
<title>Why can't we just use one storage technology for everything?</title>
<link>https://coderlegion.com/21639/why-cant-we-just-use-one-storage-technology-for-everything</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt; to help more developers discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;Modern computers use multiple storage and memory technologies because no single medium can simultaneously provide massive capacity, ultra-low latency, high bandwidth, and low cost. &lt;/p&gt;

&lt;p&gt;Every level of the memory hierarchy represents a tradeoff between these characteristics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is there a memory hierarchy?
&lt;/h2&gt;

&lt;p&gt;This is because each storage technology has its own advantages and disadvantages. We can't use one storage technology for all the purposes. &lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks18859at0gs6ki8iaf2.png&quot; class=&quot;article-body-image-wrapper&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks18859at0gs6ki8iaf2.png&quot; alt=&quot;&quot; width=&quot;800&quot; height=&quot;400&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main characteristics to consider are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capacity&lt;/li&gt;
&lt;li&gt;Latency&lt;/li&gt;
&lt;li&gt;Bandwidth&lt;/li&gt;
&lt;li&gt;Cost&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each Storage technology is optimized for a specific purpose.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
Imagine you have to travel from one place to another.&lt;br&gt;
You can go with walking, bicycle, car, train, or plane.&lt;/p&gt;

&lt;p&gt;Each mode of transport has its own advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;Another better example is think of using LLM model.&lt;/p&gt;

&lt;p&gt;Depending on task complexity and size of data we can choose the model.&lt;/p&gt;

&lt;p&gt;If we mess up with choosing model we will not get the desired output wheather cost will rise, or response will be very low quality.&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkbezlinq0263gq2jrs2.png&quot; class=&quot;article-body-image-wrapper&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkbezlinq0263gq2jrs2.png&quot; alt=&quot;&quot; width=&quot;720&quot; height=&quot;813&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Hierarchy
&lt;/h2&gt;

&lt;p&gt;Now I have listed down the memory hierarchy From top to bottom.&lt;/p&gt;

&lt;h3&gt;
  
  
  CPU Registers
&lt;/h3&gt;

&lt;p&gt;This is the fastest storage available inside a processor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; &lt;br&gt;
Stores values currently being operated on by the CPU.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Extremely small (typically 32 &amp;times; 64-bit registers per core)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~0.3 ns (about one CPU cycle)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Highest in the system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Highest cost per bit (16 transistors per bit)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  CPU Cache (L1, L2, L3)
&lt;/h3&gt;

&lt;p&gt;A small, ultra-fast memory layer designed to keep frequently used data close to the processor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Reduces the need to access slower main memory.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Small (tens of MB total)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~7.5 ns (L3 cache)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Extremely high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Very expensive (SRAM, 6 transistors per bit)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  DRAM (Main Memory)
&lt;/h3&gt;

&lt;p&gt;The working memory used by applications and operating systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Holds active programs and data currently being used.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Typically 32 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~45 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;~48 GB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Higher than storage drives&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  GPU VRAM
&lt;/h3&gt;

&lt;p&gt;Memory optimized for throughput rather than low latency.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Feeds large amounts of data to thousands of GPU cores simultaneously.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~24 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~250 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Extremely high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Expensive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  NVMe SSD
&lt;/h3&gt;

&lt;p&gt;High-speed solid-state storage connected through PCIe.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Fast persistent storage for operating systems, applications, and files.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~2 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read Latency&lt;/td&gt;
&lt;td&gt;~80 &amp;mu;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write Latency&lt;/td&gt;
&lt;td&gt;~500 &amp;mu;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;~5 GB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;~7 cents per GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  SATA SSD
&lt;/h3&gt;

&lt;p&gt;An older solid-state storage technology using the SATA interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Affordable solid-state storage with lower performance than NVMe.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Up to ~4 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~120 &amp;mu;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Lower than NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Similar to NVMe SSDs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Hard Disk Drive (HDD)
&lt;/h3&gt;

&lt;p&gt;Mechanical storage using spinning magnetic platters.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Lowest-cost local storage for large datasets and archives.&lt;/p&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~8 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~8.3&amp;ndash;10 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Very low compared to SSDs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;~1&amp;ndash;2 cents per GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  The Fundamental Tradeoff
&lt;/h1&gt;

&lt;p&gt;As we move down the memory hierarchy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Capacity increases.&lt;/li&gt;
&lt;li&gt;Cost per GB decreases.&lt;/li&gt;
&lt;li&gt;Latency increases.&lt;/li&gt;
&lt;li&gt;Access speed decreases.&lt;/li&gt;
&lt;li&gt;Distance from the processor increases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl30723a19ekijvs2jpj.png&quot; class=&quot;article-body-image-wrapper&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl30723a19ekijvs2jpj.png&quot; alt=&quot;&quot; width=&quot;800&quot; height=&quot;437&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By leveraging this trade-off, modern computers use a hierarchy of registers, cache, memory, SSDs, HDDs, and cloud storage instead of relying on a single storage technology.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuphqwcp6bha9ol6pdo3.png&quot; alt=&quot;git-lrc&quot; width=&quot;360&quot; height=&quot;540&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use.&lt;/p&gt;

&lt;p&gt;&amp;#11088; &lt;a href=&quot;https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;Here are the sources that inspired me to write an article on this topic.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=TfhL5kBiQVI&amp;amp;t=145s&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Why Don&amp;rsquo;t Computers Just Use One Type of Memory?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/21639/why-cant-we-just-use-one-storage-technology-for-everything</guid>
<pubDate>Sun, 05 Jul 2026 22:41:00 +0000</pubDate>
</item>
</channel>
</rss>