<?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: Amr el-dessouki</title>
    <description>The latest articles on DEV Community by Amr el-dessouki (@amr_eldessouki).</description>
    <link>https://dev.to/amr_eldessouki</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%2F2934176%2F96a14031-9c54-42c2-99c4-bfc7e59a9a7a.png</url>
      <title>DEV Community: Amr el-dessouki</title>
      <link>https://dev.to/amr_eldessouki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amr_eldessouki"/>
    <language>en</language>
    <item>
      <title>DBMS Disk manager introduction</title>
      <dc:creator>Amr el-dessouki</dc:creator>
      <pubDate>Wed, 12 Mar 2025 03:49:53 +0000</pubDate>
      <link>https://dev.to/amr_eldessouki/dbms-disk-manager-introduction-4gck</link>
      <guid>https://dev.to/amr_eldessouki/dbms-disk-manager-introduction-4gck</guid>
      <description>&lt;p&gt;If we want to understand DBMS internals, we first need to understand the storage hierarchy.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fv5yx0w1rrvfs8qbq2yym.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fv5yx0w1rrvfs8qbq2yym.png" alt="Image description" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above SSDs, we have temporary memory, which we call RAM. If the electricity goes off, all the information stored in RAM and above will be lost when the PC restarts. Additionally, all components above DRAM, including DRAM itself, are smaller in capacity compared to the components below DRAM&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fu90621cd0ohhmnqkgjdl.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fu90621cd0ohhmnqkgjdl.png" alt="Image description" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SEQUENTIAL VS. RANDOM ACCESS&lt;/p&gt;

&lt;p&gt;Random access on non-volatile storage(all components above SSD) is almost always much slower than sequential access.&lt;/p&gt;

&lt;p&gt;DBMS will want to maximize sequential access.&lt;/p&gt;

&lt;p&gt;→ Algorithms try to reduce number of writes to random pages so that data is stored in contiguous blocks.&lt;br&gt;
→ Allocating multiple pages at the same time is called an extent.&lt;/p&gt;

&lt;p&gt;why RANDOM ACCESS is slow ?&lt;/p&gt;

&lt;p&gt;lets say we need to execute this query&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM USERS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This means the DBMS needs to retrieve all user data. This data is stored in files on disk (we will discuss this in the next few articles). Fetching data from disk requires physical movement&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fzrqfu35n7tzuw5g88sar.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fzrqfu35n7tzuw5g88sar.png" alt="Image description" width="348" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The disk spins, and the disk head moves to read data. This movement takes time as it lands on the right sector that holds the USER table data, which is essentially wasted time. To optimize performance, we need to minimize head movement because any time spent moving is time wasted. Ideally, the head should retrieve all necessary data without moving.&lt;/p&gt;

&lt;p&gt;Full Article Here &lt;a href="https://medium.com/@amreldessoukiad/dbms-disk-manager-introduction-ea8c63eaa9cb" rel="noopener noreferrer"&gt;DBMS Disk manager introduction&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>database</category>
      <category>postgres</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
