<?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: Pranati</title>
    <description>The latest articles on DEV Community by Pranati (@readthroughmyglasses).</description>
    <link>https://dev.to/readthroughmyglasses</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F272557%2Feabb699d-7e93-48a1-b15b-7a052aa98561.jpeg</url>
      <title>DEV Community: Pranati</title>
      <link>https://dev.to/readthroughmyglasses</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/readthroughmyglasses"/>
    <language>en</language>
    <item>
      <title>Anyone can help in tailwind?</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Thu, 04 Jun 2020 09:23:02 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/anyone-can-help-in-tailwind-1a5g</link>
      <guid>https://dev.to/readthroughmyglasses/anyone-can-help-in-tailwind-1a5g</guid>
      <description>&lt;p&gt;I am facing some issues with tailwind postcss. None of the class are working. &lt;/p&gt;

&lt;p&gt;I am working with simple html file no framework.&lt;br&gt;
Installed tailwind as using npm using vscode.&lt;/p&gt;

&lt;p&gt;Any help will be greatful!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>css</category>
      <category>help</category>
    </item>
    <item>
      <title>Client Server Pattern</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Wed, 11 Dec 2019 07:52:40 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/client-server-pattern-5den</link>
      <guid>https://dev.to/readthroughmyglasses/client-server-pattern-5den</guid>
      <description>&lt;p&gt;&lt;strong&gt;This pattern consists of two parties; a server and multiple clients.&lt;br&gt;
The server component will provide services to multiple client components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clients request services from the server and the server provides relevant services to those clients.&lt;/p&gt;

&lt;h1&gt;
  
  
  Two - Tier Client/Server Structure
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ox-6gAx7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q7whc0bk3znn7jznukq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ox-6gAx7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q7whc0bk3znn7jznukq3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A two-tier architecture is where a client talks directly to a server, with no intervening server. It is typically used in small environments&lt;/p&gt;

&lt;h1&gt;
  
  
  Three tier architectures
&lt;/h1&gt;

&lt;p&gt;In the three tier architecture, a middleware is used between the user system interface client environment and the database management server environment.&lt;/p&gt;

&lt;p&gt;The widespread use of the term 3-tier architecture also denotes the following architectures:&lt;/p&gt;

&lt;p&gt;• Application sharing between a client, middleware and enterprise server.&lt;/p&gt;

&lt;p&gt;Divide middleware products into two categories:&lt;/p&gt;

&lt;p&gt;○ &lt;strong&gt;Primitive middleware&lt;/strong&gt;– The middleware layer that is able to tie together many different systems to create a single logical system, a virtual system.&lt;/p&gt;

&lt;p&gt;○ &lt;strong&gt;Database-oriented middleware&lt;/strong&gt; – It uses a primitive middleware to more information to and from a database.&lt;/p&gt;

&lt;p&gt;• Application sharing between a client, application server and enterprise database server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZedQLUAS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q25irf6icxan5m5qjvfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZedQLUAS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q25irf6icxan5m5qjvfc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Presentation layer&lt;/strong&gt;&lt;br&gt;
Supports the GUI. Sometimes this is called a GUI-lite application. There may be many different kinds of GUI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application logic&lt;/strong&gt;&lt;br&gt;
Includes all function and procedures that make the application an application for a particular domain. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;br&gt;
 A large computational server could act as a mathematical engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resoruces&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://infolab.stanford.edu/%7Eburback/dadl/node107.html"&gt;http://infolab.stanford.edu/~burback/dadl/node107.html&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://towardsdatascience.com/10-common-software-architectural-patterns-in-a-nutshell-a0b47a1e9013"&gt;https://towardsdatascience.com/10-common-software-architectural-patterns-in-a-nutshell-a0b47a1e9013&lt;/a&gt; &lt;/p&gt;

</description>
      <category>design</category>
      <category>beginners</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Web Architecture Pattern:- Layered Pattern</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Mon, 02 Dec 2019 06:02:06 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/web-architecture-patterns-1-1jfa</link>
      <guid>https://dev.to/readthroughmyglasses/web-architecture-patterns-1-1jfa</guid>
      <description>&lt;h3&gt;
  
  
  Welcome! In this series we will look at different Architecture Patterns one by one.
&lt;/h3&gt;

&lt;p&gt;Architecture patterns are well known patterns for solving software application architecture problems.&lt;/p&gt;

&lt;p&gt;They are high-level strategies that concerns large-scale components, the global properties and mechanisms of a system.&lt;/p&gt;

&lt;p&gt;A large complex software goes through a series of deconstruction at different levels.&lt;br&gt;
 At large level, architectural patterns are the tools. At smaller level, design patterns are the tools and at implementation level, programming paradigms are the tools.&lt;/p&gt;

&lt;p&gt;The first Architecture Pattern: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Layered Pattern&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;• The most common architecture pattern is the layered 
  architecture pattern, otherwise known as the n-tier 
  architecture pattern

• Components within the layered architecture pattern are 
  organized into horizontal layers, each layer performing 
  a specific role within the application 

• The layered architecture pattern does not specify the 
  number and types of layers that must exist in the 
  pattern.
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most layered architectures consist of four standard layers: presentation, business, persistence, and database &lt;/p&gt;

&lt;p&gt;The layers of isolation concept also means that each layer is independent of the other layers, thereby having little or no knowledge of the inner workings of other layers in the architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f4GfADgC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7es40tu32898whu7t7ur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f4GfADgC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7es40tu32898whu7t7ur.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.1  Different Layers :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The presentation layer:&lt;/strong&gt;  Contains all of the classes responsible for presenting the UI to the end-user or sending the response back to the client &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Business layer:&lt;/strong&gt; Represents the underlying domain, mostly consisting of domain entities and, in some cases, services. Business rules, like invariants and algorithms, should all stay in this layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Persistence Layer and Database Layer :&lt;/strong&gt; Contains all the classes responsible for doing the technical stuff, like persisting the data in the database, like DAOs, repositories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;• General desktop applications.
• E commerce web applications.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Layered Architecture is about organizing code for a good separation of concerns and nothing else&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Resources&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dzone.com/articles/layered-architecture-is-good"&gt;https://dzone.com/articles/layered-architecture-is-good&lt;/a&gt; &lt;br&gt;
&lt;a href="https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html"&gt;https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/4243187/whats-the-difference-between-design-patterns-and-architectural-patterns"&gt;https://stackoverflow.com/questions/4243187/whats-the-difference-between-design-patterns-and-architectural-patterns&lt;/a&gt; &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>design</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Types of Indexing in Databases</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Fri, 29 Nov 2019 15:59:36 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/types-of-indexing-in-databases-56lp</link>
      <guid>https://dev.to/readthroughmyglasses/types-of-indexing-in-databases-56lp</guid>
      <description>&lt;h4&gt;
  
  
  &lt;em&gt;The usual index and pointer to the record structure of indexing is not beneficially in all the cases different indexing techniques are used to help combat different records present in databases&lt;/em&gt;.
&lt;/h4&gt;

&lt;p&gt;Below are few different types of Indexing.&lt;/p&gt;

&lt;p&gt;Primary Index - In primary index, there is a &lt;strong&gt;one-to-one relationship&lt;/strong&gt; between the entries in the index table and the records in the main table. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Dense primary index&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
• The number of entries in the index table is the same as the number of entries in the main table.&lt;br&gt;
• Each and every record in the main table has an entry in the index.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7ox58uc1omcgnbmvv3jd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7ox58uc1omcgnbmvv3jd.jpg" alt="Alt Text"&gt;&lt;/a&gt;    &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Sparse Index&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
• For large tables,to locate  a record we find the index record with the largest search key. Value less than or equal to the search key value. &lt;br&gt;
• We start at that record pointed to by the index record, and proceed along the pointers in the file (that is, sequentially) until we find the desired record.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5h3sh9rrs4aq0agaxcna.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5h3sh9rrs4aq0agaxcna.jpg" alt="Alt Text"&gt;&lt;/a&gt;    &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Clustering Index&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• It may happen sometimes that we are asked to create an index on a non-unique key, such as Dept-id. &lt;br&gt;
• There could be several employees in each department. &lt;br&gt;
Here we use a clustering index, where all employees belonging to the same Dept-id are considered to be within a single cluster, and the index pointers point to the cluster as a whole.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5h3sh9rrs4aq0agaxcna.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5h3sh9rrs4aq0agaxcna.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Multilevel Index/Secondary Index:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
• A multilevel index considers the index file, which we will now refer to as the first (or base) level of a multilevel index, as an ordered file with a distinct value for each K(i).&lt;br&gt;
•  In this case, the original index file is called the first-level index and the index to the index is called the second-level index.&lt;br&gt;
• We can repeat the process, creating a third, fourth ... top level until all entries of the top level fit in one dis&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fojz5gdz9f6n19ozcgf17.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fojz5gdz9f6n19ozcgf17.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the number of keys is high, the data is read from disk in the form of blocks. Disk access time is very high compared to main memory access time. The main idea of using B-Trees is to reduce the number of disk accesses.&lt;/p&gt;

&lt;p&gt;We will see use of B and B+ trees in next blog post!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Resources&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://www.tutorialspoint.com/dbms/dbms_indexing.html" rel="noopener noreferrer"&gt;https://www.tutorialspoint.com/dbms/dbms_indexing.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ques10.com/p/14831/how-does-multilevel-indexing-improve-the-efficienc/" rel="noopener noreferrer"&gt;https://www.ques10.com/p/14831/how-does-multilevel-indexing-improve-the-efficienc/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.javatpoint.com/indexing-in-dbms" rel="noopener noreferrer"&gt;https://www.javatpoint.com/indexing-in-dbms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>sql</category>
      <category>database</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Purpose of Indexing in Database
</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Thu, 28 Nov 2019 06:56:16 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/purpose-of-indexing-in-database-1ofc</link>
      <guid>https://dev.to/readthroughmyglasses/purpose-of-indexing-in-database-1ofc</guid>
      <description>&lt;h4&gt;
  
  
  The flat file consisting of rows (records) and columns and it takes a lot of blocks to store those records
&lt;/h4&gt;

&lt;p&gt;The records of the file must be allocated to disk blocks as block is the unit of data that transfers between disk and memory.&lt;/p&gt;

&lt;p&gt;To store files in a block is termed as File Organisation.&lt;/p&gt;

&lt;p&gt;Ordered Organisation: We store the file in sequential order. If the ordering key is also a key field then the field is called ordering key for the file. Binary Search is used to search a record.&lt;/p&gt;

&lt;p&gt;Unordered Organisation : In this records are added as they’re inserted so new records are at the end of file. It uses heap data structure.&lt;/p&gt;

&lt;p&gt;Below is the records divided into blocks there are total 1000 blocks. In normal sequential file where we use Binary search to search an record we go to the middle element and check it value which also consumes a lot of time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J5FmDJSk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7hzssnhc3exo4niuqubb.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J5FmDJSk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7hzssnhc3exo4niuqubb.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Indexing it’s like a book index which will directly take you the page number in our case the block number to which a record belongs or present in it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ySQmQv4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/a4y5rvm04trpfv0o9nfq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ySQmQv4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/a4y5rvm04trpfv0o9nfq.jpeg" alt="Alt Text"&gt;&lt;/a&gt;           &lt;/p&gt;

&lt;p&gt;The index table consists of the key and a pointer to the location of record in the block.&lt;br&gt;
Suppose we want to find record 10 we will direct locate it’s respective pointer in this case it is 10 then using the pointer value.&lt;/p&gt;

&lt;p&gt;• Index record contains two fields (structure of the index file)-&lt;br&gt;
• The key of the original file&lt;br&gt;
• Pointer to the block where the key is available in the original data records&lt;br&gt;
• Binary search is used to search through the indices.&lt;/p&gt;

&lt;p&gt;To access a record using indexed enteritis number of block accesses required-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;log2Bi+1 , where Bi is the number of blocks in the indexed records&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without Indexing Time Complexity&lt;/strong&gt;&lt;br&gt;
• Ordered file of r=50000 records&lt;br&gt;
• Block size B =1024 bytes&lt;br&gt;
• Records Fixed sized and unspanned with record length R=100 bytes&lt;br&gt;
• (a) Blocking Factor Bfr = B/R = 1024/200 = 5 records per block&lt;br&gt;
• (b)Numberofblocksneededforfileis&lt;br&gt;
• b= r/bfr = 50000/5 = 10000 blocks&lt;br&gt;
• (c)Abinarysearchonthedatafilewouldneed approx&lt;br&gt;
• log2b = log210000 = 13 block accesses&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Indexing values and searching records using  Binary Time Complexity&lt;/strong&gt; &lt;br&gt;
•ordering key V=15bytes long and block pointer P=5bytes long&lt;br&gt;
 •Size of each index entry Ri = 20 bytes&lt;br&gt;
•(a) Blocking factor bfri = 1024/20 = 51 entries per block&lt;br&gt;
•(b) Number of entries ri = number of blocks in data file Number of blocks needed for index is&lt;br&gt;
• bi= ri/bfri = 10000/51 = 196 blocks&lt;br&gt;
•(c) A binary search of index file would need&lt;br&gt;
• log2bi = log2196 = 8 block accesses&lt;br&gt;
•PLUS one block access into the data file itself using the pointer&lt;br&gt;
(d) Therefore 9 block accesses needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Indexing values using linear Search and searching records using  Binary Time Complexity&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;(a) Linear search requires b/2=10000/2=5000 block accesses Suppose a secondary index on a field of V=9bytes&lt;br&gt;
Thus Ri = 9+6 = 15bytes&lt;br&gt;
(b) bfri = B/Ri = 1024/15 = 68 entries per block&lt;br&gt;
Number of index entries ri = number of records = 50,000 &lt;br&gt;
Number of blocks need is bi= ri/bfri = 50000/68 = 735 blocks&lt;br&gt;
 (c) A binary search of index file would need&lt;br&gt;
log2bi = log2735 = 10 block accesses&lt;br&gt;
PLUS one block access into the data file itself using the pointer&lt;br&gt;
(d) Therefore 11 block accesses&lt;/p&gt;

&lt;p&gt;As from the above calculations the binary search optimisation wins in both the cases to search the indices and average record lookup in the index tables.&lt;/p&gt;

&lt;p&gt;There are different types of Indexes which uses different strategies to find the record we will see that in the next post.&lt;/p&gt;

&lt;p&gt;Resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.datacamp.com/community/tutorials/introduction-indexing-sql"&gt;https://www.datacamp.com/community/tutorials/introduction-indexing-sql&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gradeup.co/file-organization-i-5282706f-c5a6-11e5-b9cf-3799afe3355e"&gt;https://gradeup.co/file-organization-i-5282706f-c5a6-11e5-b9cf-3799afe3355e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.montana.edu/~halla/csci440/n18/n18.html"&gt;www.cs.montana.edu/~halla/csci440/n18/n18.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>todayilearned</category>
      <category>todayisearched</category>
      <category>sql</category>
    </item>
    <item>
      <title>Database Storage</title>
      <dc:creator>Pranati</dc:creator>
      <pubDate>Wed, 27 Nov 2019 14:54:01 +0000</pubDate>
      <link>https://dev.to/readthroughmyglasses/database-storage-2ogo</link>
      <guid>https://dev.to/readthroughmyglasses/database-storage-2ogo</guid>
      <description>&lt;p&gt;Indexing is a term used in DBMS which is used to reduce the number of operations or lookups to find a record in a database.&lt;/p&gt;

&lt;p&gt;Before, we dive right into the concept of indexing lets first understand why we needed it in the first place?&lt;/p&gt;

&lt;p&gt;To understand Indexing we need to understand first the disk structure and how the data is stored in the disk.&lt;/p&gt;

&lt;p&gt;A disk is divided into  sectors ,tracks and blocks .&lt;/p&gt;

&lt;p&gt;Each sector consist of multiple tracks-&amp;gt;Intersection of tracks and sectors is called blocks -&amp;gt;Each byte of the block is called offset.&lt;/p&gt;

&lt;p&gt;To locate a block address we need track id and sector id.&lt;/p&gt;

&lt;p&gt;Block address = (sector id, track id)&lt;br&gt;
Typically for study purpose we assume size of block as 512 bytes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E8oCe4W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rrgueobc3fkqujx03gwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E8oCe4W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rrgueobc3fkqujx03gwu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To reach particular byte we need -&amp;gt; track id, sector id, block id&lt;br&gt;
By spinning  the disk the sectors are changed and by moving  the disk tracks are changed&lt;/p&gt;

&lt;p&gt;• Typically the entire database is stored on disk.&lt;br&gt;
• Data must be moved from disk to main memory in order for the data to be operated on.&lt;br&gt;
• After operations are performed, data must be copied back to disk if any changes were made.&lt;br&gt;
• Disk storage is called direct access storage as it is possible to read data on the disk in any order (unlike sequential access).&lt;br&gt;
• Disk storage usually survives power failures and system crashes.&lt;/p&gt;

&lt;p&gt;Organizing the data on the main memory is done by  Data Structures whereas , organizing the data on the disk efficiently so it can be utilized is done by  DBMS.&lt;/p&gt;

&lt;p&gt;Tables are stored on the hard disk of the database server. The database tables are usually divided into column and  rows, just like a regular graphic table. &lt;/p&gt;

&lt;p&gt;In a database table, the columns specify the information category and the data type and the rows hold the actual information.&lt;/p&gt;

&lt;p&gt;How data is stored in disk&lt;br&gt;
For eg : &lt;br&gt;
Consider a tables with n columns with 100 records&lt;br&gt;
Total size of each row  in the table is 128 bytes&lt;/p&gt;

&lt;p&gt;If the block size is 512 bytes then,&lt;br&gt;
No of records per block = 512/128 = 4 &lt;br&gt;
Means we can store 4 rows in 1 block and next 4 in next block and so on&lt;/p&gt;

&lt;p&gt;100 records = 100/4 = 25 &lt;br&gt;
25 blocks for 100 records&lt;/p&gt;

&lt;p&gt;The time to search a record in a table depends upon the number of blocks.&lt;br&gt;
As the number of records increases so will the number of blocks so to access an block with less time we use Indexing &lt;/p&gt;

&lt;p&gt;We will see Indexing in Next blog post!&lt;/p&gt;

&lt;p&gt;Resources&lt;br&gt;
&lt;a href="https://www.ntchosting.com/encyclopedia/hosting/database-storage/"&gt;https://www.ntchosting.com/encyclopedia/hosting/database-storage/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>todayilearned</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
