<?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: Ruchi Vora</title>
    <description>The latest articles on DEV Community by Ruchi Vora (@ruchivora).</description>
    <link>https://dev.to/ruchivora</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%2F607827%2F85f77e05-29b1-4f94-b62e-aed97b22a734.jpeg</url>
      <title>DEV Community: Ruchi Vora</title>
      <link>https://dev.to/ruchivora</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ruchivora"/>
    <language>en</language>
    <item>
      <title>Tips to maintain clean git commit history</title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Sat, 07 May 2022 15:53:14 +0000</pubDate>
      <link>https://dev.to/ruchivora/tips-to-maintain-clean-git-commit-history-18p0</link>
      <guid>https://dev.to/ruchivora/tips-to-maintain-clean-git-commit-history-18p0</guid>
      <description>&lt;h3&gt;
  
  
  Solution 1 :
&lt;/h3&gt;

&lt;p&gt;Lets say you are working on a feature and created a feature branch F1 by checking out from master. While working on the feature branch F1 , you created multiple intermediate commits. However, when you check the commit history you find some of these commits redundant. In such case you can squash the commits i.e you can combine multiple commits and make it a one commit.&lt;/p&gt;

&lt;p&gt;Below is the commit history of the feature branch before and after the squash.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mTKmc-35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdzmzw2dt4uuwoyef03x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mTKmc-35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdzmzw2dt4uuwoyef03x.png" alt="Squash Git Commits" width="880" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Command to squash the last X commits using interactive rebase is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="nx"&gt;HEAD&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;X&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The squashing of commits is also useful when you want to merge your feature branch to master branch.As by squashing, all the redundant commits can be removed and after merging the feature branch to master, the git commit history is clean.&lt;/p&gt;

&lt;h4&gt;
  
  
  Advantage of squashing :
&lt;/h4&gt;

&lt;p&gt;The git history remains clean&lt;/p&gt;

&lt;h4&gt;
  
  
  Disadvantage of squashing :
&lt;/h4&gt;

&lt;p&gt;The detailed branch history is no longer available.&lt;/p&gt;

&lt;p&gt;Before going to the second solution , let's understand the difference between git merge and git rebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  git merge VS git rebase
&lt;/h3&gt;

&lt;p&gt;Both git merge and git rebase is used to merge the code from feature branch to the main(master) branch.&lt;/p&gt;

&lt;h5&gt;
  
  
  git merge
&lt;/h5&gt;

&lt;p&gt;When we use git merge command to merge the code from feature branch to master , then git will take all the changes from my feature branch and create a special commit on top of my commit , called as merge commit that contains all the changes from my feature branch and place this merge commit on top of master branch. The git commit graph will look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H_RJu4XH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bxc044ej3txbvnbg1pm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H_RJu4XH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bxc044ej3txbvnbg1pm.png" alt="Git Merge" width="880" height="666"&gt;&lt;/a&gt;&lt;br&gt;
Command to merge the fetaure_branch in master branch is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="nx"&gt;master&lt;/span&gt;
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;merge&lt;/span&gt; &lt;span class="nx"&gt;feature_branch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's understand git rebase with Solution 2&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution 2 :
&lt;/h3&gt;

&lt;p&gt;In order to maintain a clean commit history , instead of git merge do git rebase. What rebase will do is , it will take all the commits from the feature branch and move them on top of master commits. The graph structure of the commits looks like this &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8gTMjkae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3tthbiep1f6vqdegi7w7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8gTMjkae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3tthbiep1f6vqdegi7w7.png" alt="Git rebase" width="880" height="584"&gt;&lt;/a&gt;&lt;br&gt;
Command to rebase fetaure_branch with master branch is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="nx"&gt;master&lt;/span&gt;
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="nx"&gt;feature_branch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Advantage of git rebase :
&lt;/h4&gt;

&lt;p&gt;It keeps the commit history of the main branch clean and hence it becomes easy to track&lt;/p&gt;

&lt;h4&gt;
  
  
  Disadvantage of git rebase :
&lt;/h4&gt;

&lt;p&gt;The detailed branch history is no longer available.&lt;/p&gt;

&lt;p&gt;So using squashing of commits and then rebaseing with master will keep the commit history clean and trackable.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why Python?</title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Fri, 07 Jan 2022 10:48:10 +0000</pubDate>
      <link>https://dev.to/ruchivora/why-python-1aoh</link>
      <guid>https://dev.to/ruchivora/why-python-1aoh</guid>
      <description>&lt;p&gt;Have you ever wondered why companies are nowadays preferring Python over Java for backend development?&lt;/p&gt;

&lt;p&gt;The answer to the above question lies in the awesome features that Python provides.&lt;/p&gt;

&lt;p&gt;Following are the features of python:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Python is a very easy Programming Language. It’s like writing the code in the English Language.&lt;/li&gt;
&lt;li&gt;Python is a general-purpose high-level Programming Language.

&lt;ul&gt;
&lt;li&gt;general-purpose- As it can be used to build a web app, 
machine learning, desktop app, robotics, artificial 
intelligence, IoT, gaming, data Analysis&lt;/li&gt;
&lt;li&gt;high-Level Programming Language- Assembly language is a 
low-level language and can interact with the hardware but 
is not human friendly. However Python, Java is a high- 
level programming language.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Python is a dynamically typed language. i.e You need not declare the type of variable. It is assigned automatically based on the value that you store in the variable.
Eg: a = 10 , b =10.0
To debug the code in Python, you can use Type(variable) as the variable can save any type.
However, Java and C are statically typed languages. You always declare the variable with type in advance&lt;/li&gt;
&lt;li&gt;Python has the following programming features, borrowed from different languages

&lt;ul&gt;
&lt;li&gt;Functional Programming from C&lt;/li&gt;
&lt;li&gt;OOP from C++&lt;/li&gt;
&lt;li&gt;Scripting language feature from Perl and Shell Script&lt;/li&gt;
&lt;li&gt;Modular programming language&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It has borrowed the syntax from C and ABC Programming Language&lt;/li&gt;
&lt;li&gt;Python is platform-independent- You can write the code once in any O.S and can run the code anywhere.&lt;/li&gt;
&lt;li&gt;Python is portable- Portability means you write the code in one machine and then if you port the code to any other machine then it won't require any changes.&lt;/li&gt;
&lt;li&gt;Interpreted Language- To run the program you need not compile the program. To understand the difference between compiled Language and Interpreted Language refer to this &lt;a href="https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/"&gt;https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Extensible- Extensible feature in python refers that you can write some of your Python code in other languages like C or C++. It means that it can be extended to other languages which makes python an extensible language. It’s
not extending the language itself (syntax, constructs, etc), but it lets you interface python with libraries written in other languages. which simply means that you can write code in other languages in your python source code. By implementing this feature you can improve performance.&lt;/li&gt;
&lt;li&gt;Embedded: Python code can be embedded in any other programming language.&lt;/li&gt;
&lt;li&gt;Extensive Library Support&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>webdev</category>
      <category>backend</category>
    </item>
    <item>
      <title>Need For Full Text Search</title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Tue, 23 Nov 2021 15:07:06 +0000</pubDate>
      <link>https://dev.to/ruchivora/full-text-search-59f6</link>
      <guid>https://dev.to/ruchivora/full-text-search-59f6</guid>
      <description>&lt;p&gt;As the name suggests Full Text Search is a method which is heavily used to get the relevant and faster search result especially when we have high volume of unstructured data. &lt;/p&gt;

&lt;p&gt;Some of the use cases in which Full text search is used include :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Searching&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;E&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Commerce&lt;/span&gt; &lt;span class="nx"&gt;Website&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Searching&lt;/span&gt; &lt;span class="nx"&gt;movies&lt;/span&gt; &lt;span class="nx"&gt;based&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;movie&lt;/span&gt; &lt;span class="nx"&gt;star&lt;/span&gt; &lt;span class="nx"&gt;etc&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Searching&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;Google&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;any&lt;/span&gt; &lt;span class="nx"&gt;search&lt;/span&gt; &lt;span class="nx"&gt;engine&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;many&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt;&lt;span class="p"&gt;....&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need for Full text search ?&lt;br&gt;
As the volume of data and number of users grow , performing search on a column of a relational database using LIKE operator is inefficient and time consuming. Even if we create an index on the column the search is not efficient because if the LIKE operator has a wild card then that require every key of the index to be examined . Also relational database do not provide fuzzy search.&lt;/p&gt;

&lt;p&gt;Lets understand the difference between Full Text Search and LIKE operator of relational database with an example.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lets say we have a database that stores all the comments of 
Virat Kholi's Instagram post, and you want to search for 
all the comments related to the word(concept) running.Then 
in such case if you perform a search query using LIKE = 
'run'  then your query would return all the comments that 
contains the word run.&lt;/li&gt;
&lt;li&gt;If the comment contains the word 'RAN' , then also that 
comment is related to running but that won't be returned by 
the LIKE operator.However,if the search is performed using 
some Full Text Search Solution then it returns all the 
comments that contains the word run,ran,running etc . &lt;/li&gt;
&lt;li&gt;Hence , In order to find more relevant search, Full text 
search solution is being used as the data becomes 
unstructured and the number of users grow .&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How does Full text search solution give appropriate(relevant) search result ?&lt;br&gt;
How Full Text Search returns the results faster than the LIKE operator on indexed Column ?&lt;/p&gt;

&lt;p&gt;Full Text Search achieves above things by creating inverted index for the stored data. Inverted index is a hashmap like data structure that directs you from a word to a document or a web page. Lets understand with an example.&lt;br&gt;
Imagine that you have documents like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Today it's a perfect day to start my workout.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;doc2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I will not come today to meet you.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;doc3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Our meeting will start soon!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;doc4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My class starts at 6.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following are the steps used to create an inverted index:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tokenizing : It just extracts the words from the sentence. And each word extracted from the sentence is called the token.&lt;/li&gt;
&lt;li&gt;Remove stop words : The words like 'I' ,'You', 'Your' etc occur frequently and are useless words occurring in a document.Hence we remove these stop words.&lt;/li&gt;
&lt;li&gt;Stemming of Root Word : Whenever I want to search for 'start', I want to see a document that has information about it. But the word present in the document is 'starts' . To relate the word 'start' and 'starts' , We chop some part of each word and then we get 'root word'.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After tokenization, removing stop words, stemming  the documents will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;today&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;perfect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;day&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;workout&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;doc2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;come&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;today&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;meet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;doc3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;meet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;soon&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;doc4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;class&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we create a hashmap with word as the key and document Id as the values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;today&lt;/span&gt;     &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;doc2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;perfect&lt;/span&gt;   &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;day&lt;/span&gt;       &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;start&lt;/span&gt;     &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;doc3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;workout&lt;/span&gt;   &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;come&lt;/span&gt;      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;meet&lt;/span&gt;      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;doc3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt;     &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;soon&lt;/span&gt;      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;doc3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This process is called indexing and the above mapping is called inverted index.&lt;/p&gt;

&lt;p&gt;As the documents are stored in this format,the full text search gives most relevant search result .&lt;br&gt;
And searching a word in full text search solutions takes O(1). However searching in relational database with index on the column takes O(log H) where H = Height of the B Tree , as it uses B Tree to create an index.&lt;/p&gt;

&lt;p&gt;Various Full Text Search Solution present are Solr , Elastic Search which uses Lucene.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>database</category>
    </item>
    <item>
      <title>HTTP Methods And Its Use Case</title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Wed, 10 Nov 2021 14:34:07 +0000</pubDate>
      <link>https://dev.to/ruchivora/http-methods-1fdp</link>
      <guid>https://dev.to/ruchivora/http-methods-1fdp</guid>
      <description>&lt;p&gt;HTTP is an Application Layer Protocol and the REST API uses HTTP or HTTPS to exchange data between Client and Server using HTTP methods like :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GET
&lt;/li&gt;
&lt;li&gt;POST
&lt;/li&gt;
&lt;li&gt;PUT &lt;/li&gt;
&lt;li&gt;PATCH&lt;/li&gt;
&lt;li&gt;DELETE&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These HTTP methods are used to perform CRUD (Create ,Read ,Update ,Delete) operations on the resource.&lt;br&gt;
Here resource can be a row of a relational database or a document in the case of the NoSql database or it can be any other form of a resource.&lt;/p&gt;

&lt;p&gt;Let's understand each of the Http methods with an example of a document store. Where each document contains information about an Employee in the company.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GET Method : GET method is used to retrieve the resource.
For Eg : If you want to check the details of an Employee 
whose id is 10. Then the GET request will look like
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;localhost:8080/EmployeeDetail/10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The response of the GET request will be :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ruchi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;02-04-2001&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;location&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;new york&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;department&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;IT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The GET request can be cached. If multiple requests are 
made to retrieve the data of an Employee whose id is 10 , 
then all of them will receive the same data. So instead of 
hitting the server again and again for the same static data 
, the response of the request can be cached.&lt;/li&gt;
&lt;li&gt;Also the GET request is Idempotent. Which means that even 
though multiple requests are made for an employee with id 
as 10 , it returns the same response.&lt;/li&gt;
&lt;li&gt;The various HTTP response code returned by GET requests are

&lt;ul&gt;
&lt;li&gt;200 (OK) - If the resource is found on the server. i.e 
If an Employee with id 10 exists then the HTTP response 
code 200 along with the resource is returned.&lt;/li&gt;
&lt;li&gt;404 ( NOT FOUND ) - If the resource does not exists on 
server. i.e If a document with Employee id 10 does not 
exists on server then HTTP response code 404 is returned&lt;/li&gt;
&lt;li&gt;400 ( BAD REQUEST ) - GET request itself is not 
correctly formed then the server will return the HTTP 
response code 400&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;POST Method : POST method is used to create a new 
resource.For Eg: If you want to insert the data of a 
new Employee who has just joined the company , then in 
such case POST method is used . The POST request will look 
like
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{
              &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;ram&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;,
              &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;dob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; :&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, 
              &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;Mumbai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;,
              &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;department&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;IT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;
            }&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;X&lt;/span&gt; &lt;span class="nx"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;H&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type: application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; 
   &lt;span class="nx"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;EmployeeDetail&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here , We do not pass the Id , assuming that ID is a unique &lt;br&gt;
  key generated by server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;POST request can not be cached.&lt;/li&gt;
&lt;li&gt;POST request is not Idempotent . Hence, if multiple 
request with same data is sent to same url then two 
documents are created with same data but different Id , 
as Id being the unique key generated by the server.&lt;/li&gt;
&lt;li&gt;The various HTTP response code returned by POST requests

&lt;ul&gt;
&lt;li&gt;201 ( Created ) - If the new resource is created i.e 
If a document for new Employee is created then it 
returns HTTP response code 201&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;PUT Method : PUT Method is used to perform UPSERT 
operation.Which means if the resource does not exists then 
it is created and if the resource exists then the whole 
resource is updated. For Eg: If we send a request with 
Employee Id 100 , and if there exists no Employee with Id 
as 100 then the new resource is created(assume that client 
can generate an Employee Id and server also accepts the Id 
generated by client). If the Employee with Id 100 exists 
then the whole resource(document) is updated(even though 
there is no change in the data).The PUT request looks like 
this :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;     &lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{
               &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;  :&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;
               &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;ram&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;,
               &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;dob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; :&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, 
               &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;Mumbai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;,
               &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;department&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;IT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;
            }&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;X&lt;/span&gt; &lt;span class="nx"&gt;PUT&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;H&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type: application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; 
   &lt;span class="nx"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;EmployeeDetail&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;PUT request can not be cached&lt;/li&gt;
&lt;li&gt;PUT request is idempotent , as if N PUT requests are made 
then the very first request will update the resource; the 
other N-1 requests will just overwrite the same resource 
state again and again – effectively not changing 
anything. Hence, PUT is idempotent.&lt;/li&gt;
&lt;li&gt;The various HTTP response code returned by PUT requests

&lt;ul&gt;
&lt;li&gt;201 ( Created ) - If the new resource is created i.e 
If a document for new Employee is created then it 
returns HTTP response code 201&lt;/li&gt;
&lt;li&gt;200 ( OK ) - If the existing resource is updated.&lt;/li&gt;
&lt;li&gt;404 ( Not Found ) - If ID is not found or invalid.&lt;/li&gt;
&lt;li&gt;405 (Method not allowed) - If you are trying to 
update the Employee Id which is the unique key. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;PATCH Method : PATCH Method is used to make a partial 
update to a resource. which means if an Employee with id 
10 has changed his department then in order to update only 
the department key PATCH Method can be used. The PATCH 
method looks like this
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;department&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;IT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;X&lt;/span&gt; &lt;span class="nx"&gt;PATCH&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;H&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type: 
   application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;EmployeeDetail&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;PATCH request can not be cached&lt;/li&gt;
&lt;li&gt;Most of the PATCH request are Idempotent similar to PUT , 
but some PATCH requests are not Idempotent.&lt;/li&gt;
&lt;li&gt;The various HTTP response code returned by POST requests

&lt;ul&gt;
&lt;li&gt;200 ( OK ) - If the existing resource is 
partially updated.&lt;/li&gt;
&lt;li&gt;404 (Not Found) - If ID is not found or invalid&lt;/li&gt;
&lt;li&gt;405 (Method not allowed) - If you are trying to 
update the Employee Id which is the unique key. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;DELETE Method : DELETE Method is used to delete a 
resource.For Eg: If we want to delete Employee with Id as 
10 then the DELETE method looks like this
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;curl&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;X&lt;/span&gt; &lt;span class="nx"&gt;DELETE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;H&lt;/span&gt; &lt;span class="nx"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;EmployeeDetail&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;DELETE request can not be cached.&lt;/li&gt;
&lt;li&gt;DELETE operations are idempotent. If you DELETE a 
 resource, it’s removed from the collection of resources.
 Repeatedly calling DELETE API on that resource will not 
 change the outcome – however, calling DELETE on a 
 resource a second time will return a 404 (NOT FOUND) 
 since it was already removed.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to add vanilla bootstrap to nextjs </title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Sat, 03 Jul 2021 19:07:53 +0000</pubDate>
      <link>https://dev.to/ruchivora/how-to-add-vanilla-bootstrap-to-nextjs-3lb1</link>
      <guid>https://dev.to/ruchivora/how-to-add-vanilla-bootstrap-to-nextjs-3lb1</guid>
      <description>&lt;p&gt;I was recently setting up a project in nextjs , and had the same question &lt;strong&gt;How to add vanilla bootstrap to nextjs?&lt;/strong&gt;.  On searching above question on google , i got blogs and documentation on &lt;strong&gt;How to add react-bootstrap to nextjs?&lt;/strong&gt;. Although adding vanilla bootstrap to the nextjs project is very easy , but its easy only when you know it . And being a newbie to nextjs i had to struggle a bit , so i thought of writing a blog and explain you the steps.&lt;/p&gt;

&lt;p&gt;Step 1: Add bootstrap package in your project , using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;next&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once , you install bootstrap , it would be seen in your package.json file under dependencies. And all the files related to bootstrap would be present in &lt;strong&gt;node_modules&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;Step 2: As bootstrap is used by both components and pages , bootstrap should be added to &lt;strong&gt;pages/_app.js&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bootstrap/dist/css/bootstrap.min.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// This default export is required in a new `pages/_app.js` file.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once it is added to the &lt;strong&gt;pages/_app.js&lt;/strong&gt; file , the bootstrap classes can be accessed from components and pages folder.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Block Storage Vs Object Storage </title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Sun, 18 Apr 2021 02:52:28 +0000</pubDate>
      <link>https://dev.to/ruchivora/block-storage-and-object-storage-in-aws-2bn0</link>
      <guid>https://dev.to/ruchivora/block-storage-and-object-storage-in-aws-2bn0</guid>
      <description>&lt;p&gt;Let's understand the difference between block and object storage with the help of an example. Suppose we have an excel file of 100MB in size. &lt;/p&gt;

&lt;h2&gt;
  
  
  Block Storage
&lt;/h2&gt;

&lt;p&gt;How the 100MB file will be stored in Block Storage?&lt;br&gt;
In the case of block storage, the 100MB file is divided into 10 blocks, each of 10MB and stored in the memory. Here ,by memory, I mean hard disk. Each block of data is given a unique identifier, which allows a storage system to place the smaller pieces of data wherever is most convenient.&lt;br&gt;
&lt;a href="https://media.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%2Fwsud2xvmf6m148fak1gr.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsud2xvmf6m148fak1gr.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How can you access the 100MB file?
&lt;/h3&gt;

&lt;p&gt;Each block storage can be treated as an individual hard disk, and hence can access the data via an operating system. This operating system can be present locally or network-attached in case of cloud storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  How updates are performed on the 100MB file?
&lt;/h3&gt;

&lt;p&gt;So, if I want to make changes in the few cells of the 100MB excel sheet, then in the memory only those blocks in which we have made changes are updated. Updates are not performed on all the 10 blocks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of using block storage :
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Read/Write operation is faster&lt;/li&gt;
&lt;li&gt;As storage needs grow, organizations can add block storage volumes without sacrificing performance but can hamper durability.&lt;/li&gt;
&lt;li&gt;Follows file structure hence is human friendly&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Disadvantages of using block storage
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Block storage uses very limited metadata. This can affect application performance in metadata critical operations, such as search and retrieval, because the application cannot identify the storage location by meaningful metadata, and may have to scan a large number of blocks to find the required data.&lt;/li&gt;
&lt;li&gt;Greater the distance between storage and application, the higher is the latency.&lt;/li&gt;
&lt;li&gt;Block storage is expensive. Because it requires expensive hardware and highly trained maintenance personnel.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Use case and cloud examples
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Block storage is useful for highly structured data.&lt;/li&gt;
&lt;li&gt;useful for database and transactional data.&lt;/li&gt;
&lt;li&gt;AWS Elastic block storage (EBS), provides raw storage just like hard disk, which you can attach with your EC2 instance.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Object Storage
&lt;/h2&gt;

&lt;p&gt;How the 100GB file will be stored in Object Storage?&lt;br&gt;
In object storage, the data is broken into discrete units called objects and is kept in a single repository, instead of being kept as files in folders or as blocks on servers.&lt;br&gt;
In the case of object storage, the 100MB file is not divided into chunks.  Instead, entire clumps of data are stored in,  as a single object. Each object consists of three things. The data (100MB file), expandable amount of metadata and a globally unique identifier.&lt;br&gt;
&lt;a href="https://media.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%2Fyohz73d9ddpr8am0s7e4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyohz73d9ddpr8am0s7e4.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How can you access the 100MB file?
&lt;/h3&gt;

&lt;p&gt;Each object has a globally unique identifier and requires a  simple HTTP application programming interface (API), which is used by most clients in all languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  How updates are performed on the 100MB file?
&lt;/h3&gt;

&lt;p&gt;So, if I want to make changes in the few cells of the 100MB excel sheet, then in object storage, the entire file is updated.This makes the update operation very heavy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of using object storage :
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;object-based storage, is a flat structure in which files are broken into pieces and spread out among hardware. In object storage, the data is broken into discrete units called objects and is kept in a single repository, instead of being kept as files in folders or as blocks on servers.&lt;/li&gt;
&lt;li&gt;Read operations are much faster &lt;/li&gt;
&lt;li&gt;Object-based storage architectures can be scaled up and managed simply by adding additional nodes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Disadvantages of using object storage
&lt;/h3&gt;

&lt;p&gt;1.You can not use object storage to store transactional and database data.&lt;br&gt;
2.It does not allow you to alter a piece of data, you must read and write the entire object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use case and cloud examples
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Used for storing unstructured data eg: image,videos&lt;/li&gt;
&lt;li&gt;AWS Simple Storage Service (S3), is used extensively for storing files, whose frequent operation is read. &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Feel free to ask any doubts.
&lt;/h3&gt;

</description>
      <category>beginners</category>
      <category>aws</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Client-side rendering Vs Server-side rendering</title>
      <dc:creator>Ruchi Vora</dc:creator>
      <pubDate>Sun, 04 Apr 2021 13:12:21 +0000</pubDate>
      <link>https://dev.to/ruchivora/client-side-rendering-vs-server-side-rendering-3oii</link>
      <guid>https://dev.to/ruchivora/client-side-rendering-vs-server-side-rendering-3oii</guid>
      <description>&lt;p&gt;The concept of Client-side rendering(CSR) and server-side rendering(SSR) revolves around how the response is sent by the server when a client requests it.&lt;br&gt;
Let's understand the difference between CSR and SSR with an example. Suppose you want to buy a headphone and for that, from your browser, you will go to Amazon.com and search for headphone. Let's convert the above example in client-server terminology and what happens behind the scenes.&lt;br&gt;
Here, your browser is the client and amazon is the server. So, you send the request to Amazon(server) and your browser(client) get the response. The response, in this case, is the list of headphones available on amazon. Amazon has two choices to serve the request. It can either serve the request by CSR or SSR.&lt;/p&gt;

&lt;p&gt;How the request is served by amazon in the case of SSR?&lt;br&gt;
When you send the request to amazon, then the response to your browser is the HTML page that will be rendered on the browser.The response will be somewhat&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;HTML&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"head_phone_img1.jpg"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;100&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;100&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, your browser will have to render HTML and will not have to wait for the javascript to be downloaded. So, the time for the first byte to reach the browser will be higher as the server will take some time to create the HTML page. And the number of network calls will also be higher because for each and every request the server will take some time to send the response. So for each request the server responds by generating and returning a completely new page for every interaction&lt;/p&gt;

&lt;p&gt;How the request is served by amazon in the case of CSR?&lt;br&gt;
When you send the request to amazon, the response is the plain HTML with the contents to be rendered by javascript.&lt;br&gt;
Hence the browser has to wait till the javascript is downloaded and then it can insert the element in the plain HTML.So, the time required to render the page depends on the Clients internet. So if the speed of the internet is good, the page will be rendered at a faster rate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;Index.html
&lt;span class="nt"&gt;&amp;lt;HTML&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id =&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"index.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Javascript to add contents to the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &amp;lt;img src="head_phone_img1.jpg"&amp;gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a new approach to render the website and became popular with various frameworks like react,vue, angular etc.&lt;br&gt;
The websites rendered with CSR are more interactive and the number of network calls is also reduced. Client-side rendering avoids making unnecessary requests for a full page when only a portion of the page has changed.&lt;/p&gt;

&lt;p&gt;If client-side rendering is so useful then why do most of the company prefer SSR?&lt;br&gt;
One of the drawbacks of CSR is SEO gets tempered, Since the content is not rendered until the page is loaded on the browser, the web crawlers can not crawl the page.&lt;/p&gt;

&lt;p&gt;How the companies reduce the number of network calls and speed with SSR?&lt;br&gt;
So, the speed can be increased by introducing caching layer.So when the client requests for the page, it first looks for it in the cache and thus the latency of network call can be reduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros and Cons of SSR
&lt;/h2&gt;

&lt;p&gt;Search engines can perform SEO&lt;br&gt;
 Initial page load is faster&lt;br&gt;
 Frequent network calls&lt;br&gt;
 reloads the page again and again&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros and Cons of CSR
&lt;/h2&gt;

&lt;p&gt;Number of network calls is less&lt;br&gt;
 SEO gets hit&lt;br&gt;
 Initial page load takes longer&lt;/p&gt;

&lt;p&gt;So it is very important to decide whether to go for CSR or SSR depending on the use case.&lt;br&gt;
For example,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the case of e-commerce SEO plays a very important role. So, in such case SSR can be used. But speed is also a very huge factor, to ensure that, it can use caching mechanism.&lt;/li&gt;
&lt;li&gt;For a web application like Facebook or WhatsApp web, where SEO does not matter alot but the speed and client interaction plays an important role, in such case CSR can be used&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
