<?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>Forem: Lucas Olivera</title>
    <description>The latest articles on Forem by Lucas Olivera (@lmolivera).</description>
    <link>https://forem.com/lmolivera</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%2F116423%2Fca33aa98-0449-4746-907f-8b7a9d17e8be.jpeg</url>
      <title>Forem: Lucas Olivera</title>
      <link>https://forem.com/lmolivera</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lmolivera"/>
    <language>en</language>
    <item>
      <title>DogecoinTrackerBot - My latest Node project!</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Wed, 12 May 2021 13:31:25 +0000</pubDate>
      <link>https://forem.com/lmolivera/dogecointrackerbot-my-latest-node-project-4j2j</link>
      <guid>https://forem.com/lmolivera/dogecointrackerbot-my-latest-node-project-4j2j</guid>
      <description>&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;I recently bought some Dogecoins as I have seen the rise of Cryptocurrencies and I wanted to be a part of it.&lt;/p&gt;

&lt;p&gt;So there I was, a novice in the matter checking my phone every five minutes to see how Dogecoin was doing. I'm sure anyone who bought Cryptocurrencies has faced this, and if you have, you know it is very exhausting.&lt;/p&gt;

&lt;p&gt;So I wanted an easier way to know if I should buy more or sell the coins I have withouth having to rely on checking the phone 24/7.&lt;/p&gt;

&lt;p&gt;I was surprised there was no tool that did what I wanted (or at least I didn't find it) so I created it myself.&lt;/p&gt;

&lt;h1&gt;
  
  
  How?
&lt;/h1&gt;

&lt;p&gt;I use Telegram a lot, so I researched how to create a Telegram bot!&lt;br&gt;
The code is open-source, you can check it on &lt;a href="https://github.com/LMOlivera/DogeCoinTrackerBot"&gt;Github&lt;/a&gt;. I am not an expert with Node, so feel free to suggest changes or enhancements!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A4aY0e5v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdbab69qm7orhs51oscq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A4aY0e5v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdbab69qm7orhs51oscq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R4JIqMQJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orfmkkup76rm1jjs8d99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R4JIqMQJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orfmkkup76rm1jjs8d99.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I hosted it on Heroku with a free plan, so the bot is only operative for 18 hours a day, and in a time that is suitable for me (from 12:00 to 18:00 GMT is offline).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>mongodb</category>
      <category>bot</category>
      <category>telegram</category>
    </item>
    <item>
      <title>3k followers</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Fri, 20 Dec 2019 14:13:54 +0000</pubDate>
      <link>https://forem.com/lmolivera/3k-followers-159d</link>
      <guid>https://forem.com/lmolivera/3k-followers-159d</guid>
      <description>&lt;p&gt;It's been a year (and a month) since I joined the DEV Community. Thanks to you, I have learned a lot of things that made me confident enough to write my own articles, which made me win the Top 7 badge.&lt;/p&gt;

&lt;p&gt;As of today I have 9 posts, which 5 are actually articles. It's been some time since I wrote one but I am still getting new followers everyday thanks to them.&lt;/p&gt;

&lt;p&gt;For this new year I will continue writing quality articles about topics that some people can find hard to understand.&lt;/p&gt;

&lt;p&gt;Thank you very much DEV Community and DEV Team! I wish you all a merry Christmas and a happy new year!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>meta</category>
      <category>blog</category>
      <category>writing</category>
      <category>career</category>
    </item>
    <item>
      <title>My review on freeCodeCamp's curriculum</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Wed, 31 Jul 2019 18:11:18 +0000</pubDate>
      <link>https://forem.com/lmolivera/my-review-on-freecodecamp-s-curriculum-3ee5</link>
      <guid>https://forem.com/lmolivera/my-review-on-freecodecamp-s-curriculum-3ee5</guid>
      <description>&lt;p&gt;Hello DEV Community!&lt;/p&gt;

&lt;p&gt;I have just finished every project of the last certificate on freeCodeCamp and got the desired &lt;a href="https://www.freecodecamp.org/certification/lucas.olivera/full-stack" rel="noopener noreferrer"&gt;Full Stack Certification&lt;/a&gt;. It took me nearly a year to complete every certificate, life got in the way but I finally made it!&lt;/p&gt;

&lt;p&gt;As I have finished the whole curriculum, I will tell you what I think of it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I am not affiliated with freeCodeCamp, I'm just telling you my personal opinion on this platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: As FreeCodeCamp is releasing a new version of the platform, this review will be useless soon.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is freeCodeCamp?
&lt;/h1&gt;

&lt;p&gt;In case you were living under a rock or are new around here: freeCodeCamp is a non-profit organization which has an online web platform where you can learn to code by doing small "challenges", each one with a small text explaining a line of code and asking you to implement it on the platform. You run test cases and if you pass them, you are allowed to continue to the next challenge.&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%2Fwa11s8vx47qqt2gn41e1.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fwa11s8vx47qqt2gn41e1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best part of fCC is that you can learn on your own without paying anything, as it is completely free (but you can make donations if you want). It is also &lt;a href="https://github.com/freeCodeCamp/freeCodeCamp" rel="noopener noreferrer"&gt;open source&lt;/a&gt;, and they always need help!&lt;/p&gt;

&lt;h1&gt;
  
  
  Content
&lt;/h1&gt;

&lt;p&gt;freeCodeCamp's curriculum offers six certifications which take you around 300 hours each to earn while doing challenges and coding your own projects. If that is not enough for you, you are given an additional certification: "Full Stack", as a reward for completing the previous six.&lt;/p&gt;

&lt;p&gt;And that's not all: you have a last section called "Coding Interview Prep" which offers to teach you algorithms, data structures and gives you more projects to continue practicing!&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%2Faq093ejuhdq0tjfkzxfe.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Faq093ejuhdq0tjfkzxfe.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Look at all that content!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every certificate finishes with five projects you have to complete by following user stories. If you manage to do them all, you are rewarded with a certification you can print or add to you LinkedIn's profile!&lt;/p&gt;

&lt;p&gt;If you find a challenge too difficult, freeCodeCamp's offers you a hint or the possibility to ask for help in the forum, which is really convenient!&lt;/p&gt;

&lt;h1&gt;
  
  
  Certifications
&lt;/h1&gt;

&lt;p&gt;Now I will tell you about every certification in freeCodeCamp and my experience with them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Responsive Web Design Certification
&lt;/h3&gt;

&lt;p&gt;This is the first and most accessible certification of all and the place to start if you have no experience in programming. Here you will learn HTML5 and CSS3 to the degree of making basic but full responsive web pages.&lt;/p&gt;

&lt;p&gt;I had a bit of experience with HTML when I started fCC and as CSS had always been a mystery for me I started here. The platform explains in a very simple way how a tag works and how you can combine them with CSS to make basic web pages. CSS will be your only challenge here, and can take you some time to get the grasp of it, but nothing too difficult.&lt;/p&gt;

&lt;p&gt;The projects you have to make are very simple but engaging. I have to admit though, that I found them too simple that I got bored and did the minimum amount of effort just to continue to the next one, but I have friends who enjoyed them a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build a Tribute Page&lt;/strong&gt;: It can be about a famous person or something you love. I have made two versions of this one to explain the differences of &lt;a href="https://codepen.io/LeWanderer/pen/dwOLdQ" rel="noopener noreferrer"&gt;CSS Grid&lt;/a&gt; and &lt;a href="https://codepen.io/LeWanderer/pen/eLdQdO?editors=1100" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt;, but that is in another &lt;a href="https://dev.to/lmolivera/css-grid-vs-flexbox-1koi"&gt;post&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Survey Form&lt;/strong&gt;: Like the ones you complete when registering on a site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Product Landing Page&lt;/strong&gt;: A page similar to the ones that try to sell you a specific product.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Technical Documentation Page&lt;/strong&gt;: Similar to a Wiki. I had no idea of what I could write here so I just copied the theme in the example and later turned it into a &lt;a href="https://codepen.io/LeWanderer/pen/LMEjmQ" rel="noopener noreferrer"&gt;React Tutorial&lt;/a&gt; (which I have just discovered has a small bug, sorry for that)!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Personal Portfolio Webpage&lt;/strong&gt;: This portfolio is filled with the four previous projects you've made, so you can see how much you've learned!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I really enjoyed the experience of this certificate and would recommend it to anyone starting in web development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Javascript Algorithms And Data Structures Certification
&lt;/h3&gt;

&lt;p&gt;Did you enjoy the previous certification? Did you have fun? I hope you did, because this certificate has given nightmares to everyone who has tried it.&lt;/p&gt;

&lt;p&gt;You start discovering Javascript, how to declare variables, working with conditionals and loops, etc. When suddenly, you are left alone. I don't remember the exact challenge this happened to me, but I had been thinking for ten minutes and couldn't think of a single way to do the challenge, so I decided to try the hint. Imagine my surprise when I saw that the hint used a method I had never seen before! I thought that maybe I forgot a previous challenge, but no.&lt;/p&gt;

&lt;p&gt;fCC asks you to do things you have not seen before and you will find yourself unable to do them. So, every challenge I was checking the hint and learning from there, which I recommend in this certificate. A lot of people told me that this certificate was easier if you read &lt;a href="https://github.com/getify/You-Dont-Know-JS" rel="noopener noreferrer"&gt;You Don't Know JS&lt;/a&gt;, which is completely free. I didn't read it though, but maybe you find it useful.&lt;/p&gt;

&lt;p&gt;The difficulty of this certificate makes new developers quit. And if you don't believe me, you can check on Twitter the amount of people who shared the first certification and never posted anything related to development again.&lt;/p&gt;

&lt;p&gt;But hey, it is hard, not impossible. You just have to persevere, read books, search for another resources, ask questions or pair-program. It took me 2 months and I wanted to quit everyday, but believe it was really worth it. The projects are a bit difficult too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Palindrome Checker&lt;/strong&gt;: You create a function which checks that the string it receives can be read the same backwards. This project came as Coca Cola on a summer day, I really had fun with it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roman Numeral Converter&lt;/strong&gt;: Converts integer numbers to Roman numbers. This one was difficult for me, to be honest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caesars Cipher&lt;/strong&gt;: You input a letter and it is changed to another. A small encryption project, very interesting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telephone Number Validator&lt;/strong&gt;: You make a function that checks whether a phone number is valid or not. Nothing to comment on this one, I made a giant if sentence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cash Register&lt;/strong&gt;: This last challenge makes you create a program in which a client pays for a product and you have to give change to them. This one took me days and made me discover why people hate Javascript: 0.1 + 0.2 is not equal 0.3, amazing right?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end, this certification was so hard to get that I have it as a trophy now. Of course, my knowledge of Javascript continued growing with the following certificates, so I don't think today these challenges would be a problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Front End Libraries Certification
&lt;/h3&gt;

&lt;p&gt;After suffering with Javascript, I was nervous about this one. But what I found was my favorite certification of all.&lt;/p&gt;

&lt;p&gt;I was surprised the previous certification didn't explain how to use JS for Front End, it only teaches you logic (for Backend). But here you learn how to use jQuery and React (at a basic level). It also features Bootstrap, SASS and Redux.&lt;/p&gt;

&lt;p&gt;The big problem of this certificate is that you don't learn anything in depth. fCC only shows you libraries at a very high level. It is your job to choose jQuery or React and learn them somewhere else to be able to do the projects of this certification.&lt;/p&gt;

&lt;p&gt;At this point, after suffering in the previous certificate and studying jQuery/React by yourself, you should feel very comfortable looking for answers to your problems on your own.&lt;/p&gt;

&lt;p&gt;The projects are really entertaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build a Random Quote Machine&lt;/strong&gt;: Click a button and get a random quote which you can share on Twitter. I had a lot of fun with this one. You can check my project &lt;a href="https://codepen.io/LeWanderer/pen/aRwyrY" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Markdown Previewer&lt;/strong&gt;: Write markdown, get text. The user stories of this project shows that you need an extra library, which you will need to figure out in order to pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Drum Machine&lt;/strong&gt;: You make a "Drumpad" with buttons you press to make sounds. Another really funny project. Check mine &lt;a href="https://codepen.io/LeWanderer/pen/jegXJP" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a JavaScript Calculator&lt;/strong&gt;: A calculator. The funny thing is that you have 2 different ways of calculating values. This one was very difficult because I learned about the Shunting-Yard and Postfix algorithms. &lt;a href="https://codepen.io/LeWanderer/pen/yQNeER" rel="noopener noreferrer"&gt;Here it is&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a Pomodoro Clock&lt;/strong&gt;: Here you learn about the Pomodoro technique. You can check my project &lt;a href="https://codepen.io/LeWanderer/pen/wQmGPw" rel="noopener noreferrer"&gt;here&lt;/a&gt; but it is not very stylish.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even with the problems I mentioned, nothing compares to being able to render content on a browser for the first time. I really enjoyed this certificate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Visualization Certification
&lt;/h3&gt;

&lt;p&gt;This one took me too much time to finish. I think it is because I had a lot of work to do at that time and the concepts never entered my head, I was able to finish every challenge but I have just finished the projects on this one.&lt;/p&gt;

&lt;p&gt;Here you learn D3.js (a library for graphs) and how to use APIs by XML/HTTP requests (a very important ability for every Frontend developer).&lt;/p&gt;

&lt;p&gt;After revisiting this certificate for the fourth time and being helped by others, I think I don't understand D3. Seriously. I was told that there are more accessible libraries for graphs so I didn't spend enough time to learn this library knowing that there are more easier alternatives.&lt;/p&gt;

&lt;p&gt;Maybe you try it and you find it easy, who knows?&lt;/p&gt;

&lt;p&gt;The projects are simple graphs, so I won't enter into details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Visualize Data with a Bar Chart&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualize Data with a Scatterplot Graph&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualize Data with a Heat Map&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualize Data with a Choropleth Map&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualize Data with a Treemap Diagram&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This projects are fairly simple. The complexity of this certificate is understanding D3. At least you get a very important skill: Making API calls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Apis And Microservices Certification
&lt;/h3&gt;

&lt;p&gt;The fifth certification is a very important one: We stop learning Frontend and start using Node.js for Backend. Sadly, this certificate is very buggy and you will spend a lot of time trying to pass a single challenge because the tests won't validate.&lt;/p&gt;

&lt;p&gt;As i said, you will learn Node here and all it has: Managing packages with NPM, using Express to serve files and your first NoSQL database, MongoDB (in MLAB).&lt;/p&gt;

&lt;p&gt;There is too much to learn, I have to admit that the concepts of this certificate where a bit complicated for me and I had to do the challenges several times. But what helped me understand Node was &lt;a href="https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world" rel="noopener noreferrer"&gt;this Flask tutorial&lt;/a&gt;. Flask and Node are very similar and I was able to learn concepts with Python that I easily applied with Node, so I suggest you check Flask (Python) first.&lt;/p&gt;

&lt;p&gt;The projects on this certificate are all about making APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timestamp Microservice&lt;/strong&gt;: You send a date and the API sendsback the date in string form, and viceversa. Nothing too exciting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request Header Parser Microservice&lt;/strong&gt;: An API that gives you the information you send to the sites you visit, like which browser you are using. The information is interesting but is not that fun.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL Shortener Microservice&lt;/strong&gt;: You send a URL and your job is to "short" it and when you access the short URL you should be sent to the original site. Really useful API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exercise Tracker&lt;/strong&gt;: A tracker API which saves the times you exercise. The most useful project in my opinion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Metadata Microservice&lt;/strong&gt;: Upload a file and receive its metadata as response. I didn't find it useful at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As soon as you grasp the concepts of making APIs in the first project the others will be very easy to do, so this certificate was fascinating at first but I gradually lost enthusiasm in the projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Information Security And Quality Assurance Certification
&lt;/h3&gt;

&lt;p&gt;The last certificate is Backend again, but with a (even more) wide variety of topics. Here you will learn how to secure your site with Helmet.js, about Quality Assurance and Unit Testing with Chai and Mocca, template engines with Pug, authentication, password hashing and sockets.&lt;/p&gt;

&lt;p&gt;This last certificate has the same problems as the previous one: It is bugged and there are too many concepts to learn. You will struggle a bit but nothing too serious.&lt;/p&gt;

&lt;p&gt;The projects provide a simple Frontend and the basic structure for you to fill in the Backend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Metric-Imperial Converter&lt;/strong&gt;: Converts units from Metric to Imperial and viceversa. Nothing too exciting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue Tracker&lt;/strong&gt;: API to store/retrieve issues (like bugs). Similar to what we did with the Exercise Tracker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal Library&lt;/strong&gt;: API to store/retrieve books you own. I found the idea of this project interesting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stock Price Checker&lt;/strong&gt;: API to check stock prices. The URL fCC gives you to do the project doesn't work so you have to figure how to do this project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anonymous Message Board&lt;/strong&gt;: A Board, like 4Chan.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This certificate was a bit tedious to me, as I was impatient to finish it and go back to the projects on the fourth one to finally claim the Full Stack certificate.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;freeCodeCamp is a bit bugged and has some errors in the way challenges where designed. This could be seen as a problem, but in reality you are going to work with a lot of bugged programs and will need to figure on your own how to proceed with things, so I see this as a training for a real job. Stuck? You are going to ask someone (write in fCC forums?) for help, you don't understand what a piece of code does? You sure end up in StackOverflow, and so on.&lt;/p&gt;

&lt;p&gt;I recommend freeCodeCamp to anyone who wants to learn how to program, but not alone. I really suggest you go through the challenges with a friend, as the platform encourages pair-programming, so when one has problems the other can help.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final words
&lt;/h1&gt;

&lt;p&gt;I hope this review was useful for you. What do you think of freeCodeCamp?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>review</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Everything you need to know about NoSQL databases</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Tue, 04 Jun 2019 12:04:27 +0000</pubDate>
      <link>https://forem.com/lmolivera/everything-you-need-to-know-about-nosql-databases-3o3h</link>
      <guid>https://forem.com/lmolivera/everything-you-need-to-know-about-nosql-databases-3o3h</guid>
      <description>&lt;p&gt;Hello DEV! It's been some time but here I am with an article that took a lot of research, as I felt that the answers &lt;a href="https://dev.to/lmolivera/explain-nosql-databases-like-im-five-3jo0"&gt;here&lt;/a&gt; were not enough for me.&lt;/p&gt;

&lt;p&gt;I suggest you first check this article I made about &lt;a href="https://dev.to/lmolivera/everything-you-need-to-know-about-relational-databases-3ejl"&gt;Relational Databases&lt;/a&gt; to be able to understand this article more easily.&lt;/p&gt;

&lt;h1&gt;
  
  
  Index
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
What is NoSQL?

&lt;ul&gt;
&lt;li&gt;Definition&lt;/li&gt;
&lt;li&gt;Features&lt;/li&gt;
&lt;li&gt;Terminology&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Advantages and disadvantages

&lt;ul&gt;
&lt;li&gt;Advantages&lt;/li&gt;
&lt;li&gt;Disadvantages&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Types of NoSQL databases

&lt;ul&gt;
&lt;li&gt;Key-value&lt;/li&gt;
&lt;li&gt;Document&lt;/li&gt;
&lt;li&gt;Graph&lt;/li&gt;
&lt;li&gt;Columnar&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

NoSQL and Relational Databases Comparison

&lt;ul&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;li&gt;Maintenance&lt;/li&gt;
&lt;li&gt;Data Model&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Choosing a particular database

&lt;ul&gt;
&lt;li&gt;Feature Comparison&lt;/li&gt;
&lt;li&gt;NoSQL over Relational&lt;/li&gt;
&lt;li&gt;Polyglot persistence&lt;/li&gt;
&lt;li&gt;Benchmarking databases&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;How to design a NoSQL database&lt;/li&gt;

&lt;li&gt;Important links&lt;/li&gt;

&lt;li&gt;Sources&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is NoSQL?
&lt;/h1&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Definition
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/lmolivera/everything-you-need-to-know-about-relational-databases-3ejl"&gt;Relational Databases&lt;/a&gt; were created some time ago when &lt;a href="https://en.wikipedia.org/wiki/Waterfall_model" rel="noopener noreferrer"&gt;Waterfall model&lt;/a&gt; was very popular, but they were not designed to cope with the scale and agility of modern applications, neither to take advantage of the commodity storage and processing power available today.&lt;/p&gt;

&lt;p&gt;NoSQL are type of databases created in the late 90s  to solve these problems, called like that because they didn’t use SQL (but today they are called “Not Only SQL” due to some Management Systems which implement Query Languages). NoSQL databases mostly address some of the points: being non-relational, distributed, open-source and horizontally scalable.&lt;/p&gt;

&lt;p&gt;It is important to mention that nowadays Relational Databases have improved dramatically, having resolved most of the problems they had when dealing with today's technology. NoSQL Databases are another way of storing data, not necessarily better than Relational Databases. Both are designed to resolve different kinds of needs.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Distributed computing system.&lt;/li&gt;
&lt;li&gt;Higher Scalability.&lt;/li&gt;
&lt;li&gt;Reduced Costs.&lt;/li&gt;
&lt;li&gt;Flexible schema design.&lt;/li&gt;
&lt;li&gt;Process unstructured and semi-structured data.&lt;/li&gt;
&lt;li&gt;No complex relationship.&lt;/li&gt;
&lt;li&gt;Open-sourced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Terminology
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node: Networked computer that offers some kind of service, local storage and access to a larger distributed system or file store.&lt;/li&gt;
&lt;li&gt;Clusters: Set of nodes.&lt;/li&gt;
&lt;li&gt;Sharding (or horizontal partitioning): Partitioning the database on the value of some field.&lt;/li&gt;
&lt;li&gt;Replication: Portions of data are written to multiple nodes in case one of them fails (ensuring availability).&lt;/li&gt;
&lt;li&gt;ACID: &lt;strong&gt;A&lt;/strong&gt;tomicity, &lt;strong&gt;C&lt;/strong&gt;onsistency, &lt;strong&gt;I&lt;/strong&gt;solation, &lt;strong&gt;D&lt;/strong&gt;urability. Is a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc.&lt;/li&gt;
&lt;li&gt;BASE: &lt;strong&gt;B&lt;/strong&gt;asically &lt;strong&gt;a&lt;/strong&gt;vailable (no 24/7 availability), &lt;strong&gt;s&lt;/strong&gt;oft-state (database may be inconsistent) and &lt;strong&gt;e&lt;/strong&gt;ventually consistent (eventually, it will be consistent).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Advantages and disadvantages
&lt;/h1&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Elastic scalability&lt;/strong&gt;: These databases are designed for use with low-cost commodity hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Big Data Applications&lt;/strong&gt;: Massive volumes of data are easily handled by NoSQL databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Economy&lt;/strong&gt;: Relational Databases require installation of expensive storage systems and proprietary servers, while NoSQL databases can be easily installed in cheap commodity hardware clusters as transaction and data volumes increase. This means that you can process and store more data at much less cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic schemas&lt;/strong&gt;: NoSQL databases need no schemas to start working with data. In Relational Database you have to define a schema first, making things more difficult because you have to change the schema everytime the requirements change.
&lt;em&gt;Note&lt;/em&gt;: This means that every data quality control must be done on the application.
&lt;em&gt;Note 2&lt;/em&gt;: Having no schema is not a characteristic of every NoSQL database and could also be a disadvantage if we don't organize data properly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-sharding&lt;/strong&gt;: Relational Databases scale vertically, which means you often have a lot of databases spread across multiple servers because of the disk space they need to work. NoSQL databases usually support auto-sharding, meaning that they natively and automatically spread data across an arbitrary number of servers, without requiring the application to even be aware of the composition of the server pool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replication&lt;/strong&gt;: Most NoSQL databases also support automatic database replication to maintain availability in the event of outages or planned maintenance events. More sophisticated NoSQL databases are fully self-healing, offering automated failover and recovery, as well as the ability to distribute the database across multiple geographic regions to withstand regional failures and enable data localization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrated caching&lt;/strong&gt;: Many NoSQL technologies have excellent integrated caching capabilities, keeping frequently-used data in system memory as much as possible and removing the need for a separate caching layer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;NoSQL databases don’t have the reliability functions which Relational Databases have (basically don’t support ACID).

&lt;ul&gt;
&lt;li&gt;This also means that NoSQL databases offer consistency in performance and scalability.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;In order to support ACID developers will have to implement their own code, making their systems more complex.

&lt;ul&gt;
&lt;li&gt;This may reduce the number of safe applications that commit transactions, for example bank systems.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;NoSQL is not compatible (at all) with SQL.

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Note&lt;/em&gt;: Some NoSQL management systems do use a Structured Query Language.&lt;/li&gt;
&lt;li&gt;This means that you will need a manual query language, making things slower and more complex.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;NoSQL are very new compared to Relational Databases, which means that are far less stable and may have a lot less functionalities.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of NoSQL databases
&lt;/h1&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5t0v6no4bldypdsgyzc1.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%2F5t0v6no4bldypdsgyzc1.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Note&lt;/em&gt;: Some rules will depend on the Management System you choose.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key-value
&lt;/h3&gt;

&lt;p&gt;Key-value Stores are the simplest NoSQL databases. Every single item in the database is stored as an attribute name (or 'key'), together with its value, similar to a dictionary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability: Large amounts of data and users.&lt;/li&gt;
&lt;li&gt;Speed: Large number of queries.&lt;/li&gt;
&lt;li&gt;Data model: Key-value pairs.&lt;/li&gt;
&lt;li&gt;Consistency.&lt;/li&gt;
&lt;li&gt;Transactions.&lt;/li&gt;
&lt;li&gt;Querying ability.&lt;/li&gt;
&lt;li&gt;Scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Operations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;get(key): Get a value given a key.&lt;/li&gt;
&lt;li&gt;put(key, value): Create/Update a value given a key.&lt;/li&gt;
&lt;li&gt;delete(key): Deletes a value given a key.&lt;/li&gt;
&lt;li&gt;execute(key): Invoke an operation to a value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No relationships among Multiple-Data.&lt;/li&gt;
&lt;li&gt;Multi-operation Transactions: If you are storing many keys and there is a failure to save one of the keys, you can’t roll back the rest of the operations.&lt;/li&gt;
&lt;li&gt;Query Data by 'value': Searching the 'keys' based on some info found in the 'value' part of the key-value pairs.&lt;/li&gt;
&lt;li&gt;Operation by groups: As operations are confined to one key at a time, there exists no way to run several keys simultaneously.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real life examples&lt;/strong&gt;&lt;br&gt;
Key-Value would be best-fit to store user profile:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;userId, username.&lt;/li&gt;
&lt;li&gt;additional attributes/preferences:

&lt;ul&gt;
&lt;li&gt;Language&lt;/li&gt;
&lt;li&gt;Country&lt;/li&gt;
&lt;li&gt;Timezone&lt;/li&gt;
&lt;li&gt;User favorites&lt;/li&gt;
&lt;li&gt;and so on&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key-value databases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/dynamodb/?nc1=h_ls" rel="noopener noreferrer"&gt;DynamoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://riak.com/products/" rel="noopener noreferrer"&gt;Riak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html" rel="noopener noreferrer"&gt;Berkeley DB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://redis.io/" rel="noopener noreferrer"&gt;Redis&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Document
&lt;/h3&gt;

&lt;p&gt;Document Stores pair each key with a complex data structure known as a document that can contain many different key-value pairs, or key-array pairs, or even nested documents. Documents are treated as wholesome and splitting a document into its constituent name/value pairs are avoided.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability: For more complex objects.&lt;/li&gt;
&lt;li&gt;Data model: Collection of documents.

&lt;ul&gt;
&lt;li&gt;Similar to JSON and XML.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Implements ACID transactions and adapt RDBMS characteristics.

&lt;ul&gt;
&lt;li&gt;Allows indexing of documents based on its primary identifier and properties.&lt;/li&gt;
&lt;li&gt;Supports Query transactions (to an extent).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Design pattern allows retrieving info in a single operation.&lt;/li&gt;

&lt;li&gt;Avoids performing joins within the application.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Operations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search by:

&lt;ul&gt;
&lt;li&gt;Field&lt;/li&gt;
&lt;li&gt;Range&lt;/li&gt;
&lt;li&gt;Regular Expression&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Queries: Can include Javascript functions.&lt;/li&gt;

&lt;li&gt;Indexing: Can be done on any field.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Types&lt;/strong&gt;&lt;br&gt;
XML Databases: &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%2F5dibyoa5puagvqjwb38g.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%2F5dibyoa5puagvqjwb38g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XML document formed the first Document DB.&lt;/li&gt;
&lt;li&gt;XML has a variety of standards and tools to assist with authoring, validation, searching, and transforming XML documents.

&lt;ul&gt;
&lt;li&gt;XPath: Syntax for retrieving specific elements from an XML document.&lt;/li&gt;
&lt;li&gt;XQuery: Query language for grilling XML documents, also known as “the SQL of XML”.&lt;/li&gt;
&lt;li&gt;XML schema: Document Template that explains which all elements may be present in a specified class of XML documents to validate document correctness.&lt;/li&gt;
&lt;li&gt;XSLT: Language to transform XML documents into other formats, like non-XML formats such as HTML.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Famous XML databases: eXist (open-source) and MarkLogic (commercial).&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;JSON Databases: &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%2Fdo8ltgsyud15jnmmliog.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%2Fdo8ltgsyud15jnmmliog.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON document database expects the data to be stored in the format of JSON.&lt;/li&gt;
&lt;li&gt;Resembles row in an RDBMS.&lt;/li&gt;
&lt;li&gt;Contains one or more key-value pairs, nested documents, and arrays.
Arrays may hold complex hierarchical structure.&lt;/li&gt;
&lt;li&gt;Collection (data bucket) is a group of documents sharing some common objective (resembles table in an RDBMS).&lt;/li&gt;
&lt;li&gt;Although preferred, documents in a collection need not be of the same type.&lt;/li&gt;
&lt;li&gt;JSON databases:

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;CouchDB&lt;/li&gt;
&lt;li&gt;OrientDB&lt;/li&gt;
&lt;li&gt;DocumentDB.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data modelling&lt;/strong&gt;&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%2Fmvs5m9394h2m7ta13sdr.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%2Fmvs5m9394h2m7ta13sdr.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less deterministic compared to RDBMS.&lt;/li&gt;
&lt;li&gt;Driven by nature of the queries to be executed, while in RDBMS it is driven by the kind of data to be stored.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Base info duplication across multiple documents&lt;/li&gt;
&lt;li&gt;Complicates design resulting in inconsistency.

&lt;ul&gt;
&lt;li&gt;Solution: Link multiple documents using document identifiers (resembles foreign key in RDBMS)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real life examples&lt;/strong&gt;&lt;br&gt;
Here is a &lt;a href="https://www.edureka.co/blog/real-world-use-cases-of-mongodb/" rel="noopener noreferrer"&gt;list of real life cases&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Document databases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/es" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://couchdb.apache.org/" rel="noopener noreferrer"&gt;CouchDB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Graph
&lt;/h3&gt;

&lt;p&gt;Graph Stores are an expressive structure with the collection of Nodes and relationships interlinking them, used to store information about networks of data, such as social connections. Based on the mathematical theory of graphs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parts of a graph&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nodes - representation of entities.&lt;/li&gt;
&lt;li&gt;Properties - Information about nodes.

&lt;ul&gt;
&lt;li&gt;Can be indexed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Edges - Relationships between nodes.

&lt;ul&gt;
&lt;li&gt;Can be indexed.&lt;/li&gt;
&lt;li&gt;Unidirectional or bidirectional, no limit of edges.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Understanding Graph theory&lt;/strong&gt;&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%2F0rkw0x7243131glg42y6.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%2F0rkw0x7243131glg42y6.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to Graph theory, the major constituents of a graph include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vertices or Nodes representing distinct objects.&lt;/li&gt;
&lt;li&gt;Edges or Relationships or arcs establishing connectivity among these objects.&lt;/li&gt;
&lt;li&gt;Both Nodes and Relationships carry some properties.

&lt;ul&gt;
&lt;li&gt;Properties of Nodes are similar to those of relational table/JSON document.&lt;/li&gt;
&lt;li&gt;Properties of Relationship considers the type, strength, or history of the relationship.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Graph theory assigns mathematical notation for&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding/removing nodes or relationships from graph&lt;/li&gt;
&lt;li&gt;Performing operations to trace adjacent nodes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Core Rule&lt;/strong&gt; - 'No broken links': A relationship should always have a start and end node. Deletion of a node is not possible without deleting its associated relationships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types&lt;/strong&gt;&lt;br&gt;
At a very high level, Graph store can be categorized into two kinds:&lt;/p&gt;

&lt;p&gt;1) Graph Database - (Real-time)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performs transactional online graph persistence in real-time.&lt;/li&gt;
&lt;li&gt;Similar to online transactional processing (OLTP) databases in RDBMS area.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) Graph Compute Engine - (Batch Mode)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performs offline graph analytics in batch as series of steps.&lt;/li&gt;
&lt;li&gt;Similar to online analytical processing (OLAP) for analysis of data in bulk, such as data mining.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scales to the complexity of data.&lt;/li&gt;
&lt;li&gt;Focus on interconnectivity.&lt;/li&gt;
&lt;li&gt;Many query languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Operations&lt;/strong&gt;&lt;br&gt;
Will depend on it’s query language. For example, Neoj4 uses &lt;a href="https://neo4j.com/developer/cypher/" rel="noopener noreferrer"&gt;Cypher Query Language&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lack of high performance concurrency: In many cases, Graph Databases provide multiple reader and single writer type of transactions, which hinders their concurrency and performance as a consequence, somewhat limiting the threaded parallelism.&lt;/li&gt;
&lt;li&gt;Lack of standard languages: The lack of a well established and standard declarative language is being a problem nowadays. Neo4j is proposing Cypher and Oracle is working on a language.&lt;/li&gt;
&lt;li&gt;Lack of parallelism: One important issue is the fact that partitioning a graph is a problem. Thus, most do not provide shared nothing parallel queries on very large graphs. Thus, allowing for parallelism is intrinsically a problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real life examples&lt;/strong&gt;&lt;br&gt;
Graph Store is used to model all kind of different scenarios such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Construction of a space rocket.&lt;/li&gt;
&lt;li&gt;Transportation system (roads and trains).&lt;/li&gt;
&lt;li&gt;Supply-chain and Logistics.&lt;/li&gt;
&lt;li&gt;Medical history.&lt;/li&gt;
&lt;li&gt;Fraud Detection.&lt;/li&gt;
&lt;li&gt;Network and IT Operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Graph databases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://neo4j.com/" rel="noopener noreferrer"&gt;Neo4J&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://giraph.apache.org/" rel="noopener noreferrer"&gt;Giraph&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Columnar
&lt;/h3&gt;

&lt;p&gt;Wide-column/Columnar/Column Stores are optimized for queries over large datasets, which are stored on a column-family basis. Column stores databases use a concept called a keyspace. A keyspace is kind of like a schema in the relational model. The keyspace contains all the column families, which contain rows, which contain columns.&lt;/p&gt;

&lt;p&gt;Columnar databases are pretty different from relational databases under the hood: instead of tables comprising a set of rows or tuples which have a value for each column, tables are a set of columns, each of which may or may not contain a value for a particular row key.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxxdia1d3yjuo74hhoej.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%2Fjxxdia1d3yjuo74hhoej.png"&gt;&lt;/a&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9kr5zuxfbjyodvpyilh.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%2Fp9kr5zuxfbjyodvpyilh.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compression: Column stores are very efficient at data compression and/or partitioning.&lt;/li&gt;
&lt;li&gt;Aggregation queries: Due to their structure, columnar databases perform particularly well with aggregation queries (such as SUM, COUNT, AVG, etc).&lt;/li&gt;
&lt;li&gt;Scalability: Columnar databases are very scalable. They are well suited to massively parallel processing, which involves having data spread across a large cluster of machines – often thousands of machines.&lt;/li&gt;
&lt;li&gt;Fast to load and query: Columnar stores can be loaded extremely fast. A billion row table could be loaded within a few seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are just some of the benefits that make columnar databases a popular choice for organizations dealing with big data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operations&lt;/strong&gt;&lt;br&gt;
Operations and some features vary wildly depending on the Management System you use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incremental data loading: It takes more time writing data than reading.
Online Transaction Processing (OLTP) usage.&lt;/li&gt;
&lt;li&gt;Queries against only a few rows: Reading specific data takes more time than intended.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real life examples&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A column family for vegetables of a supermarket.&lt;/li&gt;
&lt;li&gt;A column family for clients.&lt;/li&gt;
&lt;li&gt;A column family for users.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Columnar databases&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cassandra.apache.org/" rel="noopener noreferrer"&gt;Cassandra&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hbase.apache.org/" rel="noopener noreferrer"&gt;HBase&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://kudu.apache.org/overview.html" rel="noopener noreferrer"&gt;Kudu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The CAP Theorem
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecsq67lmxfipxzzbxytj.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%2Fecsq67lmxfipxzzbxytj.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is very important to understand the limitations of NoSQL database. NoSQL can not provide consistency and high availability together. This was first expressed by Eric Brewer in CAP Theorem.&lt;/p&gt;

&lt;p&gt;CAP theorem or Eric Brewers theorem states that we can only achieve at most two out of three guarantees for a database: Consistency, Availability and Partition Tolerance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consistency: Every read receives the most recent write or an error.&lt;/li&gt;
&lt;li&gt;Availability: Every request receives a (non-error) response – without the guarantee that it contains the most recent write.&lt;/li&gt;
&lt;li&gt;Partition tolerance: Even if there is a network outage in the data center and some of the computers are unreachable, still the system continues to perform.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No system can provide more than 2 guarantees. In the case of a distributed systems, the partitioning of the network is a must, so the trade-off is always between consistency and availability.&lt;/p&gt;

&lt;p&gt;If you want to know more about CAP, check &lt;a href="https://howtodoinjava.com/hadoop/brewers-cap-theorem-in-simple-words/" rel="noopener noreferrer"&gt;this link&lt;/a&gt; and &lt;a href="https://cloudxlab.com/assessment/slide/11/nosql/345/nosql-cap-theorem" rel="noopener noreferrer"&gt;this one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  NoSQL and Relational Databases Comparison
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsehfkso9r9w3oaiailc2.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%2Fsehfkso9r9w3oaiailc2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take into consideration that this comparison is at database level, it doesn’t include any management system that implements both of them. Database Management Systems include their own techniques to sort this problems and also improve performance and reliability.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Scaling&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational Databases: Vertical Scaling.

&lt;ul&gt;
&lt;li&gt;Architecture design runs well on a single machine.&lt;/li&gt;
&lt;li&gt;To handle larger volumes of operations is to upgrade the machine with a faster processor or more memory.&lt;/li&gt;
&lt;li&gt;There is a limitation to size/level of scaling as you need more computers to handle more data.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;NoSQL Databases: Horizontal Scaling.

&lt;ul&gt;
&lt;li&gt;NoSQL databases are intended to run on clusters of comparatively low-specification servers.&lt;/li&gt;
&lt;li&gt;To handle more data, add more servers to the cluster.&lt;/li&gt;
&lt;li&gt;Calibrated to operate with full throttle even with low-cost hardware.&lt;/li&gt;
&lt;li&gt;Relatively cheaper approach to handle increased: Number of operations and Size of the data.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Maintenance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational Databases: Maintaining high-end RDBMS systems is expensive and requires trained workforce for database management.&lt;/li&gt;
&lt;li&gt; NoSQL Databases: Require minimal management, and it supports many features, which makes the need for administration and tuning requirements becomes less. This covers Automatic repair, easier data distribution and simpler data models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Data Model&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational Databases: Rigid Data Model.

&lt;ul&gt;
&lt;li&gt;RDBMS requires data in structured format as per defined data model.&lt;/li&gt;
&lt;li&gt;As change management is a big headache in SQL with a strong dependency on primary/foreign keys, ad-hoc data insertion becomes tougher.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: It's worth to mention that relational databases have been getting better at working with un-structured or semi-structured data, with PostgreSQL's indexable binary JSONB datatype leading the pack. If you have a mix, fitting your unstructured data into a relational context is a lot easier and safer than trying to adapt your relational data into a NoSQL context.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NoSQL Databases: No Schema/Data model.

&lt;ul&gt;
&lt;li&gt;NoSQL database is schema-less so that data can be inserted into a database with ease, even without any predefined schema.&lt;/li&gt;
&lt;li&gt;The format or data model could be changed anytime, without application disruption.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Caching&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational Databases: The caching in typical RDBMS database requires separate infrastructure.&lt;/li&gt;
&lt;li&gt;NoSQL Databases: NoSQL database supports caching in system memory, so it increases data output performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Choosing a particular database
&lt;/h3&gt;

&lt;p&gt;Now that we have gone through the different kinds of NoSQL, you should know by now that NoSQL databases are not similar and are not made to solve the same problems.&lt;/p&gt;

&lt;p&gt;It is important to understand which database is appropriate depending of the scenario. The parameters to be taken into consideration when choosing a NoSQL database are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database features&lt;/li&gt;
&lt;li&gt;Performance &lt;/li&gt;
&lt;li&gt;Context-based criteria&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best way to group them is comparing their features to choosing the correct one for the problem we are facing.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Feature Comparison
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not all NoSQL databases promise horizontal scalability on equal margins.&lt;/li&gt;
&lt;li&gt;HBase and Hypertable carry an advantage, while Redis, MongoDB, and Couchbase Server lag behind.&lt;/li&gt;
&lt;li&gt;The difference becomes more amplified as the data size grows over a few petabytes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Transactional integrity and consistency&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transactional integrity is applicable only when data gets modified, updated, created, and deleted.&lt;/li&gt;
&lt;li&gt;Not relevant in pure data warehousing and mining contexts where data is written once and read multiple times.

&lt;ul&gt;
&lt;li&gt;Like web traffic logs, social networking status updates, stock market tick data, and game scores.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;RDBMS makes best fit if updates are common and range of operations require integrity of updates.&lt;/li&gt;

&lt;li&gt;Column-family databases (HBase and Hypertable), and document databases (MongoDB) are suited well if atomicity at an individual item level is sufficient.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data modeling&lt;/strong&gt;&lt;br&gt;
Relational Database Management Systems (RBDMS) offers a consistent and organized way of modeling data with standardized implementation. The NoSQL world does not offer any room for the standardized and well-defined data model as they are not bound to solve the same problem or have the same architecture.&lt;/p&gt;

&lt;p&gt;MongoDB has gradually adopted few RDBMS concepts, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL-like querying.&lt;/li&gt;
&lt;li&gt;Rudimentary relational references.&lt;/li&gt;
&lt;li&gt;Database objects (inspired by the standard table and column-based model).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Query support&lt;/strong&gt;&lt;br&gt;
Querying data from any database with ease and effectively is considered to be an interesting puzzle to be solved. With standardized syntax and semantics, RDBMS thrives on SQL support for easy access to data.&lt;/p&gt;

&lt;p&gt;Among NoSQL:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB and CouchDB (Document DB) come with querying capabilities which are equally powerful to RDBMS.&lt;/li&gt;
&lt;li&gt;Redis (Key-Value DB) alone comes with querying the data structures it stores.&lt;/li&gt;
&lt;li&gt;Under Columnar DB, HBase has a little bit of querying capabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Access and interface availability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB dominates in this space with the availability of drivers for mainstream libraries for interfacing and interacting.&lt;/li&gt;
&lt;li&gt;CouchDB also has few drivers available as well as the RESTful HTTP interface.&lt;/li&gt;
&lt;li&gt;Language bindings to connect from most mainstream languages are available for few like Redis, Membase, Riak, HBase, Hypertable, Cassandra, and Voldemort.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  NoSQL over Relational
&lt;/h4&gt;

&lt;p&gt;You should choose a NoSQL database over a Relational database if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have unstructured or semi-structured data, or a mix of unstructured and relational data.&lt;/li&gt;
&lt;li&gt;You need to support multiple queries while simultaneously loading a lot of data.&lt;/li&gt;
&lt;li&gt;You need to reuse portions of your data for multiple projects.&lt;/li&gt;
&lt;li&gt;You have rapidly changing schemas or need to take on new information sources without a six-month (or longer) development cycle.&lt;/li&gt;
&lt;li&gt;You need to consolidate multiple, disparate data types and sources without being forced to model data or create a schema.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Polyglot persistence
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgayvpcdlu6drsrxxd4xr.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%2Fgayvpcdlu6drsrxxd4xr.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Polyglot&lt;/strong&gt;: Knowing or using several languages.&lt;/p&gt;

&lt;p&gt;Polyglot programming allow us to choose the appropriate language for the appropriate task. One database does not fit all sizes and knowledge and adoption of more than one database is a wise strategy. The knowledge and use of multiple database products and methodologies are popularly now being called polyglot persistence.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Benchmarking databases
&lt;/h4&gt;

&lt;p&gt;Benchmarking allow us to get an insight on how the different NoSQL products stack up.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/brianfrankcooper/YCSB/wiki" rel="noopener noreferrer"&gt;Yahoo! Cloud Services Benchmark&lt;/a&gt; is one of the famous benchmarking infrastructures for comparing NoSQL products&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tokyocabinet.sourceforge.net/benchmark.pdf" rel="noopener noreferrer"&gt;Tokyo Cabinet Benchmarks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://redis.io/topics/benchmarks" rel="noopener noreferrer"&gt;How fast is Redis&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to design a NoSQL Database
&lt;/h3&gt;

&lt;p&gt;The design of NoSQL databases depends on the type of database. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For a guide on modeling a NoSQL Document Database, enter &lt;a href="https://mapr.com/blog/data-modeling-guidelines-nosql-json-document-databases/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. One more link &lt;a href="https://www.researchgate.net/publication/277890728_NoSQL_Databases_and_Data_Modeling_Techniques_for_a_Document-oriented_NoSQL_Database" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here is a Microsoft Oficial Youtube Account &lt;a href="https://www.youtube.com/watch?v=IUxT7ZRHlZ4" rel="noopener noreferrer"&gt;video&lt;/a&gt; for modeling Document databases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Here is the official documentation for Amazon's Key-value database &lt;a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/best-practices.html" rel="noopener noreferrer"&gt;DynamoDB&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have been told that is useful for Cassandra too if you replace references to the “Partition Key” with “Shard Key” and “Sort Key” with “Index”. They translate to MongoDB as well.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;This &lt;a href="https://www.kidscodecs.com/database-design/" rel="noopener noreferrer"&gt;link&lt;/a&gt; and &lt;a href="https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/" rel="noopener noreferrer"&gt;this other one&lt;/a&gt; include every kind of database.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You can also check &lt;a href="https://www.quora.com/What-is-a-good-way-to-design-a-NoSQL-database" rel="noopener noreferrer"&gt;this interesting thread&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Important links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://nosql-database.org/" rel="noopener noreferrer"&gt;NoSQL-database&lt;/a&gt;: A bit outdated website containing a LOT of information about NoSQL databases.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.mongodb.com/" rel="noopener noreferrer"&gt;MongoDB official documentation&lt;/a&gt;: Get started using the most famous Document Database.&lt;/li&gt;
&lt;li&gt;This article explains how to use MongoDB in Node easily thanks to Mongoose:
&lt;div class="ltag__link"&gt;
  &lt;a href="/akhilaariyachandra" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F170397%2F83c4eca6-42f6-4b0e-971d-a1661a534ee9.jpg" alt="akhilaariyachandra"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/akhilaariyachandra/setup-mongodb-in-node-js-with-mongoose-4gik" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Setup MongoDB in Node.js with Mongoose&lt;/h2&gt;
      &lt;h3&gt;Akhila Ariyachandra ・ May 22 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#mongodb&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learn.freecodecamp.org/" rel="noopener noreferrer"&gt;Freecodecamp&lt;/a&gt;: It has a certificate called "Apis and Microservices" in which they teach you how to use MongoDB with Mongoose in Node.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.udemy.com/courses/search/?src=ukw&amp;amp;q=NoSQL&amp;amp;p=1&amp;amp;price=price-free" rel="noopener noreferrer"&gt;Free Udemy courses&lt;/a&gt; about NoSQL.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis" rel="noopener noreferrer"&gt;Comparison&lt;/a&gt; of a lot of NoSQL databases.&lt;/li&gt;
&lt;li&gt;And, I found what I think is a &lt;a href="http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/" rel="noopener noreferrer"&gt;controversial blog post&lt;/a&gt; about MongoDB that I thought you might find interesting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A training at my job.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://nosql-database.org" rel="noopener noreferrer"&gt;http://nosql-database.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.mongodb.com/nosql-explained" rel="noopener noreferrer"&gt;MongoDB: NoSQL Explained&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.pandorafms.org/es/bases-de-datos-nosql/" rel="noopener noreferrer"&gt;https://blog.pandorafms.org/es/bases-de-datos-nosql/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blogs.oracle.com/spain/qu-es-una-base-de-datos-nosql" rel="noopener noreferrer"&gt;https://blogs.oracle.com/spain/qu-es-una-base-de-datos-nosql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hadoop360.datasciencecentral.com/blog/advantages-and-disadvantages-of-nosql-databases-what-you-should-k" rel="noopener noreferrer"&gt;https://www.hadoop360.datasciencecentral.com/blog/advantages-and-disadvantages-of-nosql-databases-what-you-should-k&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mapr.com/blog/data-modeling-guidelines-nosql-json-document-databases/" rel="noopener noreferrer"&gt;https://mapr.com/blog/data-modeling-guidelines-nosql-json-document-databases/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.channelfutures.com/cloud-2/the-limitations-of-nosql-database-storage-why-nosqls-not-perfect" rel="noopener noreferrer"&gt;Limitations of NoSQL&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/xplenty-blog/the-sql-vs-nosql-difference-mysql-vs-mongodb-32c9980e67b2" rel="noopener noreferrer"&gt;Medium: Differences between SQL and NoSQL&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/ACID_(computer_science)" rel="noopener noreferrer"&gt;Wikipedia: ACID&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/CAP_theorem" rel="noopener noreferrer"&gt;Wikipedia: CAP Theorem&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Polyglot_persistence" rel="noopener noreferrer"&gt;Wikipedia: Polyglot Persistence&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://howtodoinjava.com/hadoop/brewers-cap-theorem-in-simple-words/" rel="noopener noreferrer"&gt;https://howtodoinjava.com/hadoop/brewers-cap-theorem-in-simple-words/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloudxlab.com/assessment/slide/11/nosql/345/nosql-cap-theorem" rel="noopener noreferrer"&gt;https://cloudxlab.com/assessment/slide/11/nosql/345/nosql-cap-theorem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://database.guide/what-is-a-column-store-database/" rel="noopener noreferrer"&gt;https://database.guide/what-is-a-column-store-database/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.flydata.com/blog/whats-unique-about-a-columnar-database/" rel="noopener noreferrer"&gt;https://www.flydata.com/blog/whats-unique-about-a-columnar-database/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mapr.com/blog/data-modeling-guidelines-nosql-json-document-databases/" rel="noopener noreferrer"&gt;https://mapr.com/blog/data-modeling-guidelines-nosql-json-document-databases/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neo4j.com/blog/why-graph-databases-are-the-future/" rel="noopener noreferrer"&gt;https://neo4j.com/blog/why-graph-databases-are-the-future/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/What-is-a-limitation-of-graph-database-Is-there-any-situation-when-the-performance-of-the-graph-database-degrades" rel="noopener noreferrer"&gt;https://www.quora.com/What-is-a-limitation-of-graph-database-Is-there-any-situation-when-the-performance-of-the-graph-database-degrades&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.slideshare.net/blimpyacht/polyglot-persistence-52711581" rel="noopener noreferrer"&gt;https://www.slideshare.net/blimpyacht/polyglot-persistence-52711581&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.amazon.com/NoSQL-Dummies-Adam-Fowler/dp/1118905741/ref=asc_df_1118905741/?tag=hyprod-20&amp;amp;linkCode=df0&amp;amp;hvadid=312114711253&amp;amp;hvpos=1o1&amp;amp;hvnetw=g&amp;amp;hvrand=4748842111187385565&amp;amp;hvpone=&amp;amp;hvptwo=&amp;amp;hvqmt=&amp;amp;hvdev=c&amp;amp;hvdvcmdl=&amp;amp;hvlocint=&amp;amp;hvlocphy=1027028&amp;amp;hvtargid=pla-528631369366&amp;amp;psc=1" rel="noopener noreferrer"&gt;NoSQL for Dummies&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.marklogic.com/resources/enterprise-nosql-for-dummies/?type=PD&amp;amp;publisher=GGLCPC&amp;amp;utm_source=google&amp;amp;utm_medium=cpc&amp;amp;utm_campaign=US/UK-NB&amp;amp;utm_content=nosql-for-dummies&amp;amp;gclid=EAIaIQobChMI7tnr97_G4gIVB4zICh06Xg7aEAAYASAAEgJqfvD_BwE" rel="noopener noreferrer"&gt;Enterprise NoSQL for Dummies, MarkLogic Special Edition&lt;/a&gt;: Enter the link to get this ebook for free!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final words
&lt;/h3&gt;

&lt;p&gt;I hope you find this article useful and if you see some error and want me to correct it don't hesitate to tell me in the comments!&lt;/p&gt;

&lt;p&gt;Thanks to Dian Fay and Slavius for corrections made in the comments!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>nosql</category>
    </item>
    <item>
      <title>Time till Endgame</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Wed, 17 Apr 2019 19:36:47 +0000</pubDate>
      <link>https://forem.com/lmolivera/time-till-endgame-55hp</link>
      <guid>https://forem.com/lmolivera/time-till-endgame-55hp</guid>
      <description>&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;My coworkers and I are great Marvel fans, so naturally we can't stop talking about Endgame, the movie which is going to be premiered soon.&lt;/p&gt;

&lt;p&gt;Everyday we ask eachother how much time do we have to wait to go to the cinema to finally watch it, so I decided to make a webpage in which you insert the day you are watching it and it returns you a counter which days and time left to watch it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;h3&gt;
  
  
  v1
&lt;/h3&gt;

&lt;p&gt;You can see the website &lt;a href="https://time-till-endgame.glitch.me/"&gt;here&lt;/a&gt;. If you wish to see the code, you can see it on my &lt;a href="https://github.com/LMOlivera/time-till-endgame"&gt;Github repository&lt;/a&gt;. It was made with React in a day and a half, so don't expect a lot of functionalities, but spaghetti code and bad UX.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Glitch is having some maintenance, so the site may not be available!&lt;/p&gt;

&lt;h3&gt;
  
  
  v2
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://time-till-endgame-v2.glitch.me/"&gt;Online&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/LMOlivera/time-till-endgame-v2"&gt;Github repository&lt;/a&gt;
This version allows you to see who is going to watch the film, when and if they can spoil you (or if you can spoil them). Also, let's you post on Twitter how much time you have to wait to finally see the film.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to give me advice about anything that I can improve! But do it before Endgame premieres!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>project</category>
      <category>beginners</category>
      <category>marvel</category>
    </item>
    <item>
      <title>Explain NoSQL Databases Like I'm Five</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Sat, 16 Mar 2019 03:35:39 +0000</pubDate>
      <link>https://forem.com/lmolivera/explain-nosql-databases-like-im-five-3jo0</link>
      <guid>https://forem.com/lmolivera/explain-nosql-databases-like-im-five-3jo0</guid>
      <description>&lt;p&gt;Hello dev!&lt;/p&gt;

&lt;p&gt;I'm having a hard time trying to understand NoSQL Databases. Can someone tell me what advantages and disadvantages has when compared to Relational databases? When would you choose for example MongoDB instead of SQLServer? Is it worth studying them for my career?&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
      <category>nosql</category>
    </item>
    <item>
      <title>Everything you need to know about (Relational) Databases</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Thu, 17 Jan 2019 19:42:48 +0000</pubDate>
      <link>https://forem.com/lmolivera/everything-you-need-to-know-about-relational-databases-3ejl</link>
      <guid>https://forem.com/lmolivera/everything-you-need-to-know-about-relational-databases-3ejl</guid>
      <description>&lt;p&gt;Databases are an important part of (almost) every piece of software today. In this article I'm going to tell you everything you need to know to start working with them.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a database?
&lt;/h1&gt;

&lt;p&gt;If you manage information in files or folders, you sooner or later will find that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have multiple files that contain the same information&lt;/li&gt;
&lt;li&gt;You have multiple files about the same topic but with different information, making difficult to understand which file has the correct/updated information.&lt;/li&gt;
&lt;li&gt;Every time you want to change some information you have to update multiple files, taking a lot of time and potentially making mistakes that lead to the two previous problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach for handling information is inefficient, databases were made to fix these problems.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Database&lt;/strong&gt; is a system that allows everyone to share, manage and use data. To use one you first need to understand some things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A lot of people will be using it, so you have to find a way for them to easily input and extract data.&lt;/li&gt;
&lt;li&gt;Databases also present risks like users stealing or overwriting important information, so security and permissions should be taken into consideration when designing a database. &lt;/li&gt;
&lt;li&gt;You also need to be careful not to lose any data. The system may go down or a hard drive can fail. Databases need mechanisms to recover from this failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Types of databases
&lt;/h3&gt;

&lt;p&gt;There are many kinds of databases, these three are the most commonly used data models for databases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hierarchical Data Model&lt;/strong&gt;, in which there is a tree-like relationship between data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Data Model&lt;/strong&gt;, in which pieces of data have overlapping relationships with each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relational Data Model&lt;/strong&gt;, process data using the easy-to-understand concept of table.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use Hierarchical Data Model and Network Data Model you must manage data by keeping physical location and the order of data in mind, so performing flexible and high-speed search of your data is difficult.&lt;/p&gt;

&lt;p&gt;That’s why we will be using the Relational Data Model.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Relational Database?
&lt;/h1&gt;

&lt;p&gt;A relational database is a type of database. It uses a structure that allows us to identify and access data in relation to another piece of data in the database. Data in a relational database is organized into tables. &lt;/p&gt;

&lt;h3&gt;
  
  
  Table, Record, Field, Row &amp;amp; Column
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;table&lt;/strong&gt; is a set of data elements (values).&lt;/li&gt;
&lt;li&gt;A piece of data in a file is called a &lt;strong&gt;record&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Each item in a record is called a &lt;strong&gt;field&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtjcjj0dx62ml8nrtuyt.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%2Fmtjcjj0dx62ml8nrtuyt.PNG" alt="Table, Record, Field, Row &amp;amp; Column"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One piece of data or record is called a &lt;strong&gt;row&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Each item or field is called a &lt;strong&gt;column&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Primary Key, Unique &amp;amp; Null
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqzv5t2ssuilz8kpo3h74.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%2Fqzv5t2ssuilz8kpo3h74.PNG" alt="Primary Key, Unique &amp;amp; Null"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A field is often given an important role in the database, when this happens we call that field the &lt;strong&gt;Primary Key&lt;/strong&gt;. In this example, Product Code is the Primary Key. More information of this in the next section.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Unique&lt;/strong&gt; value is a value that cannot be repeated (Like product name, you shouldn’t have two products with the same name).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Null&lt;/strong&gt; is the absence of value (as seen above in “Remarks”, where there are empty values). Some Fields can be null (depending on the database).&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of keys
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key&lt;/strong&gt;: One or more columns in a database table that is used to sort and/or identify rows in a table. e.g. if you were sorting people by the field salary then the salary field is the key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary key&lt;/strong&gt;:  A primary key is a one or more fields that uniquely identifies a row in a table. The primary key cannot be null (blank). The primary key is indexed (more on index later).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foreign key&lt;/strong&gt;:  A foreign key is a relationship between columns in two database tables (one of which is indexed) designed to insure consistency of data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite key&lt;/strong&gt;:  A primary key composed of one or more columns. The primary key can be formed using  the fields (though not very advisable).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Natural key&lt;/strong&gt;:  A composite primary key which is composed of attributes (fields) which already exist in the real world (for example First Name, Last Name, Social Security Number).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Surrogate key&lt;/strong&gt;:  A primary key which is internally generated (typically auto-incremental integer value) that does not exist in the real world (for example, ID which serves to identify the record but nothing else).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Candidate key&lt;/strong&gt;:  A column, or set of columns, in a table that can uniquely identify any database record without referring to any other data. Each table may have one or more candidate keys, but one candidate key is unique (the primary key).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compound key&lt;/strong&gt;: A composite key consisting of two or more fields that uniquely describe a row in a table. The difference between compound and candidate is that all of the fields in the compound key are foreign keys; in the candidate key one or more of the fields may be foreign keys (but it is not mandatory).&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Designing a database
&lt;/h1&gt;

&lt;p&gt;When you try to create a database yourself, the first step is to determine the conditions of the data you are trying to model.&lt;/p&gt;

&lt;h3&gt;
  
  
  The E-R model
&lt;/h3&gt;

&lt;p&gt;Model used for analysis to make diagrams. In this model you consider the actual world using concepts of entity and relationship.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;E refers Entity&lt;/strong&gt;. A recognizable object in the real world. For example, when exporting fruits to other countries, &lt;strong&gt;fruit&lt;/strong&gt; and &lt;strong&gt;export&lt;/strong&gt; destination can be considered entities. Represented with a rectangle.

&lt;ul&gt;
&lt;li&gt;Each entity has &lt;strong&gt;attributes&lt;/strong&gt;, particular properties that describe the entity (Product Name in Fruit, for example). Represented with an ovallus.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso8rbt0cujvvp8sxpddj.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%2Fso8rbt0cujvvp8sxpddj.png" alt="Entity, attributes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;R refers relationship&lt;/strong&gt;. How entities relate with each other. For example, fruits and export destination are associated with each other because you sell fruits to export destinations. Represented with a diamond.
Fruit is exported to many Export destinations and Export destination purchases many kinds of fruit. We call this a &lt;strong&gt;many-to-many relationship&lt;/strong&gt;. In the E-R model the number of associations between entities is considered, this is called &lt;strong&gt;cardinality&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fddio1ju860k1qgzcb2q2.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%2Fddio1ju860k1qgzcb2q2.png" alt="Entity, attributes, relation, cardinality"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cardinality&lt;/strong&gt;: Number of associations between entities.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One-to-one relationship (1-1)&lt;/strong&gt;: I only sell fruits to you and you only buy fruits from me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-to-many (or many-to-one) relationship (n-1 or 1-n)&lt;/strong&gt;: I sell fruits to other families and those families buy fruits only from me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Many-to-many relationship (n-n)&lt;/strong&gt;: You have an example above.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Normalization
&lt;/h3&gt;

&lt;p&gt;Process of tabulating data from the real world for a relational database, following a serie of steps. It is necessary to Normalize data in order to properly manage a relational database. Normalization is used for mainly two purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Eliminating redundant(useless) data.&lt;/li&gt;
&lt;li&gt;Ensuring data dependencies make sense i.e data is logically stored.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Unnormalized form
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;First Normal Form&lt;/strong&gt; is created from this table. All the attributes you have identified for a given entity are probably grouped together in a flat structure. This is where the process of normalization comes into play, to organize the attributes.&lt;/p&gt;

&lt;h4&gt;
  
  
  First Normal Form
&lt;/h4&gt;

&lt;p&gt;For a table to be in the First Normal Form, it should follow the following 4 rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It should only have single(atomic) valued attributes/columns&lt;/strong&gt;: This means, for example, a fruit shouldn’t be in the database with two names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Values stored in a column should be of the same domain&lt;/strong&gt;: This is more of a "Common Sense" rule. In each column the values stored must be of the same kind or type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All the columns in a table should have unique names&lt;/strong&gt;: This rule expects that each column in a table should have a unique name. This is to avoid confusion at the time of retrieving data or performing any other operation on the stored data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The order in which data is stored, does not matter&lt;/strong&gt;: This rule says that the order in which you store the data in your table doesn't matter.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Important
&lt;/h4&gt;

&lt;p&gt;Before going on you must first know this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prime attributes: Parts of candidate key of a given relational table.&lt;/li&gt;
&lt;li&gt;Non-prime attributes: Not a part of candidate key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Second Normal Form
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;It should be in the First Normal form.&lt;/li&gt;
&lt;li&gt;It should not have &lt;strong&gt;Partial Dependency&lt;/strong&gt;. If a non-prime attribute of the relation is getting derived by only a part of the composite candidate key then such dependency is defined as partial dependency.

&lt;ul&gt;
&lt;li&gt;Dependency: When you have to use the primary key in order to get an specific value (example, your &lt;strong&gt;Name&lt;/strong&gt; to know your &lt;strong&gt;Age&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Third Normal Form
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;It is in the Second Normal form.&lt;/li&gt;
&lt;li&gt;It doesn't have &lt;strong&gt;Transitive Dependency&lt;/strong&gt;. If a non-prime attribute of the relation is getting derived by either another non-prime attribute or the combination of part of the candidate key along with a non-prime attribute then such dependency would be defined as transitive dependency.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Steps for designing a database
&lt;/h3&gt;

&lt;p&gt;Now that you are familiar with the basic terminology and the ER model, you are ready to design a database.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Determine the purpose of the database.&lt;/li&gt;
&lt;li&gt;Determine the tables needed.&lt;/li&gt;
&lt;li&gt;Identify needed fields.&lt;/li&gt;
&lt;li&gt;Identify exclusive fields.&lt;/li&gt;
&lt;li&gt;Determine relations between tables.&lt;/li&gt;
&lt;li&gt;Define constraints to preserve data integrity (don't forget normalization).&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  SQL
&lt;/h1&gt;

&lt;p&gt;When you use the database you have to input or retrieve data using SQL (Structured Query Language). SQL allows you to communicate with the database. Some commands may change depending on the Database Management System (SQL Server for example) you are using.&lt;/p&gt;

&lt;p&gt;It’s commands can be broken down into three distinct types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Definition Language (DDL)&lt;/strong&gt;: Related to the data structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create&lt;/li&gt;
&lt;li&gt;Drop&lt;/li&gt;
&lt;li&gt;Alter&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Data Manipulation Language (DML)&lt;/strong&gt;: Related to stored data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select&lt;/li&gt;
&lt;li&gt;Insert&lt;/li&gt;
&lt;li&gt;Update&lt;/li&gt;
&lt;li&gt;Delete&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Control Language (DCL)&lt;/strong&gt;: Manages user access.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Select
&lt;/h3&gt;

&lt;p&gt;Most basic SQL statement.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="cm"&gt;/*The column you want to see...*/&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*...from the table it belongs.*/&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Where
&lt;/h3&gt;

&lt;p&gt;Used to specify the information you want.&lt;/p&gt;

&lt;p&gt;This statement retrieves all data from the product table that has a unit price greater than or equal to 200.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;     &lt;span class="cm"&gt;/*This selects every column in the table.*/&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Very easy to understand right?*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And this one retrieves all data with the product name ‘apple’.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;apple&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Comparison operators
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flj90d6uvvn2fcgxhbvdj.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%2Flj90d6uvvn2fcgxhbvdj.PNG" alt="Comparison operators"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Logical operators
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhtxq9fg6w5u2mel8ky2.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%2Fnhtxq9fg6w5u2mel8ky2.PNG" alt="Logical operators"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Other
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;
&lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Between doesn’t need explanation I think.*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*This one neither.*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Like
&lt;/h3&gt;

&lt;p&gt;When you don’t know exactly what to search for you can use pattern matching in conditions, by using wildcard characters in a LIKE statement.&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%2Fau9otyqmb2hx7me37z6n.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%2Fau9otyqmb2hx7me37z6n.PNG" alt="Wildcards"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="nv"&gt;"%n"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Will search for data ending with the letter ‘n’.*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Order by
&lt;/h3&gt;

&lt;p&gt;Sort data based on a certain column.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="nv"&gt;"%n"&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Easy to understand, right*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Aggregate functions in SQL
&lt;/h3&gt;

&lt;p&gt;Also known as &lt;strong&gt;Set Functions&lt;/strong&gt;. You can use them to aggregate information such as maximum or minimum values.&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%2F4brpfqj75mrlikb9crcn.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%2F4brpfqj75mrlikb9crcn.PNG" alt="Wildcards"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;MAX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Aggregating data by grouping
&lt;/h4&gt;

&lt;p&gt;If you group data you can obtain aggregated values easily. To group data combine an aggregate function with GROUP BY.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;district&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;district&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Output: Average unit price per district*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  HAVING
&lt;/h4&gt;

&lt;p&gt;You can’t use WHERE with aggregate functions, you have to use HAVING.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;district&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;district&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Filters result after being grouped.*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Searching for data
&lt;/h3&gt;

&lt;p&gt;There are more complicated query methods in SQL.&lt;/p&gt;
&lt;h4&gt;
  
  
  SUBQUERY and IN
&lt;/h4&gt;

&lt;p&gt;You can embed one query in another query (this is called a subquery).&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_code&lt;/span&gt;
&lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;product_code&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_statement&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The query in parentheses is performed first. The other SELECT is performed with the result. The IN operator allows multiple WHERE values (that’s why the first select works with the second).&lt;/p&gt;

&lt;h4&gt;
  
  
  Correlated query
&lt;/h4&gt;

&lt;p&gt;A subquery may refer to data from the outer query, this is called a correlated query. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_statement&lt;/span&gt; &lt;span class="n"&gt;U&lt;/span&gt; &lt;span class="cm"&gt;/*Alias? Maybe more on this later*/&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales_statement&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;U&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;product_code&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Alias
&lt;/h3&gt;

&lt;p&gt;SQL aliases are used to give a table, or a column in a table, a temporary name. Often used to shorten column names to make working with them easier (mostly in joins). An alias only exists for the duration of the query.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrderID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrderDate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerName&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;"Around the Horn"&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Joining tables
&lt;/h3&gt;

&lt;p&gt;JOIN is used to combine rows from two or more tables, based on a related column between them.&lt;/p&gt;
&lt;h4&gt;
  
  
  Different Types of SQL JOINs
&lt;/h4&gt;

&lt;p&gt;Here are the different types of the JOINs in SQL:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(INNER) JOIN: Returns records that have matching values in both tables.
&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%2F39txp4l1k6rxahj032jl.gif" alt="Inner join"&gt;
&lt;/li&gt;
&lt;li&gt;LEFT (OUTER) JOIN: Return all records from the left table, and the matched records from the right table.
&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%2F22cjcy5mf9vvcps1v16t.gif" alt="Inner join"&gt;
&lt;/li&gt;
&lt;li&gt;RIGHT (OUTER) JOIN: Return all records from the right table, and the matched records from the left table.
&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%2Fg4e7dcect9ur8e32wg3a.gif" alt="Inner join"&gt;
&lt;/li&gt;
&lt;li&gt;FULL (OUTER) JOIN: Return all records when there is a match in either left or right table.
&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%2F6s7qssacrb5cxmc35g8b.gif" alt="Inner join"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Equi join
&lt;/h4&gt;

&lt;p&gt;Join against equality or matching column(s) values of the associated tables. An equal sign (=) is used as comparison operator in the where clause to refer equality.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;table1&lt;/span&gt; 
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;table2&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;join_condition&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="cm"&gt;/*You can also do it without JOIN*/&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column_list&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;table1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table2&lt;/span&gt;&lt;span class="p"&gt;....&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;table1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;column_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="n"&gt;table2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;column_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Creating a table
&lt;/h3&gt;

&lt;p&gt;The code can be different depending on which kind of database you are working with.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="cm"&gt;/*This line needs no explanation, right?*/&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="n"&gt;product_code&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;product_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="n"&gt;unit_price&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_code&lt;/span&gt;&lt;span class="p"&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;INT means integers.&lt;/li&gt;
&lt;li&gt;VARCHAR means database expects text. 255 means no more than 255 characters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Constraints on a table
&lt;/h4&gt;

&lt;p&gt;Specifications for a table to prevent data conflicts.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa18neooq9j2g27ekb2hl.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%2Fa18neooq9j2g27ekb2hl.PNG" alt="Constraints"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Inserting data into a table
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;"melon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;"melon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Both statements do the same. You insert data in the type and order it was defined. Remember the constraints (like primary keys).&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating rows
&lt;/h3&gt;

&lt;p&gt;Allows you to modify data inside a table.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;"cantaloupe"&lt;/span&gt;    &lt;span class="cm"&gt;/*New value*/&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;"melon"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    &lt;span class="cm"&gt;/*Specific value to overwrite*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Deleting rows
&lt;/h3&gt;

&lt;p&gt;Delete data from a table.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;"apple"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/*Row to delete*/&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Creating a view
&lt;/h3&gt;

&lt;p&gt;You can create a virtual table that exists only when it is viewed by a user. This is a view. The table from which a view is derived is called a base table.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;expensive_product&lt;/span&gt; &lt;span class="cm"&gt;/*The view name is "expensive_product"*/&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To use the view:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;expensive_product&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It is convenient to create a view when you want to make part of the data in a table public.&lt;/p&gt;

&lt;h3&gt;
  
  
  DROP
&lt;/h3&gt;

&lt;p&gt;Allows you to delete:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="cm"&gt;/*A view:*/&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;expensive_product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="cm"&gt;/*A base table:*/&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="cm"&gt;/*A database:*/&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Operating a database
&lt;/h1&gt;
&lt;h3&gt;
  
  
  Transactions
&lt;/h3&gt;

&lt;p&gt;A unit of data operations is called a transaction. Example: Reading data, writing data. A transaction always ends with a &lt;strong&gt;commit&lt;/strong&gt; or a &lt;strong&gt;rollback&lt;/strong&gt; operation.&lt;/p&gt;

&lt;p&gt;It is important to ensure that multiple transactions can be processed without conflicting data. It is also important to protect data from inconsistencies in case a failure occurs while a transaction is being processed. To that end, the following table lists the properties required for a transaction, which memorably spell ACID.&lt;/p&gt;
&lt;h4&gt;
  
  
  Properties required for a transaction
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffxblykn204idt5czt87.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%2Fffxblykn204idt5czt87.PNG" alt="Properties required for a transaction"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Commit
&lt;/h3&gt;

&lt;p&gt;Operations in the database are finalized when each transaction is processed correctly. That finalization is called a commit operation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Lock
&lt;/h3&gt;

&lt;p&gt;Operations by many users are controlled so that nothing goes wrong when they access the database concurrently. For that purpose, a method called &lt;strong&gt;Lock&lt;/strong&gt; is used.&lt;br&gt;
You lock data to prevent it from being erroneously processed.&lt;/p&gt;

&lt;p&gt;If I perform some operations on the database, the data is locked until my operations are finished, then is unlocked to be used by another user and the data is locked again, and unlocked when this user finishes.&lt;/p&gt;

&lt;p&gt;Although a lock has its own role in a database, it should not be overused because it can hinder its purpose: sharing data with a lot of people. So we use different types of locks depending on the situation.&lt;/p&gt;
&lt;h4&gt;
  
  
  Shared lock
&lt;/h4&gt;

&lt;p&gt;For example, you can use a shared lock for a read operation when it is the only operation needed. Other users can read data but cannot perform a write operation on it.&lt;/p&gt;
&lt;h4&gt;
  
  
  Exclusive lock
&lt;/h4&gt;

&lt;p&gt;When performing a write operation a user applies an exclusive lock. When it is applied other users cannot read or write data.&lt;/p&gt;
&lt;h4&gt;
  
  
  Concurrency control
&lt;/h4&gt;

&lt;p&gt;When a lock is used to control two or more transactions. Concurrency allows as many users as possible to use a database at one time while preventing data conflicts from ocurring.&lt;/p&gt;
&lt;h5&gt;
  
  
  Two phase locking
&lt;/h5&gt;

&lt;p&gt;In order to make sure a schedule is serializable we need to obey specific rules for setting and releasing locks. One of these rules is &lt;strong&gt;two-phase locking&lt;/strong&gt;, for each transaction two phases should be used: one for setting locks and the other for releasing them.&lt;/p&gt;
&lt;h5&gt;
  
  
  Locking granularity
&lt;/h5&gt;

&lt;p&gt;There are a number of resources that can be locked. The extent to which resources are locked is referred to as &lt;strong&gt;granularity&lt;/strong&gt;. &lt;strong&gt;Coarse granularity&lt;/strong&gt; occurs when many resources are locked at once, and &lt;strong&gt;fine granularity&lt;/strong&gt; occurs when few resources are locked. When granularity is coarse (or high) the number of locks needed per transaction is reduced, reducing the amount of processing required.&lt;/p&gt;
&lt;h5&gt;
  
  
  Other concurrency controls
&lt;/h5&gt;

&lt;p&gt;Simpler methods can be used when you have a small number of transactions or a high number of read operations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Timestamp Control: A label containing the time of access (timestamp) is assigned to data accessed during a transaction. If another transaction with a later timestamp has already updated the data, the operation will be not permitted. When a read or write operation is not permitted, the transaction is rolled back.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimistic Control: This method allows a read operation. When a write operation is attempted, the data is checked to see if any other transactions have occurred. If another transaction has already updated the data, the transaction is rolled back.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  Levels of isolation
&lt;/h5&gt;

&lt;p&gt;You can set the level of transactions that can be processed concurrently, this is referred to as the isolation level. The SET TRANSACTION statement can be used to specify the isolation level of the following transactions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;READ UNCOMMITTED&lt;/li&gt;
&lt;li&gt;READ COMMITTED&lt;/li&gt;
&lt;li&gt;REPETEABLE READ&lt;/li&gt;
&lt;li&gt;SERIALIZABLE&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;TRANSACTION&lt;/span&gt; &lt;span class="k"&gt;ISOLATION&lt;/span&gt; &lt;span class="k"&gt;LEVEL&lt;/span&gt; &lt;span class="k"&gt;READ&lt;/span&gt; &lt;span class="k"&gt;UNCOMMITTED&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Depending on the isolation level setting, any of the following actions may occur:&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%2Fpdx5xhuobeflepd7wg91.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%2Fpdx5xhuobeflepd7wg91.PNG" alt="Isolation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dirty read: When transaction2 reads a row before transaction1.&lt;/li&gt;
&lt;li&gt;Non-repeatable read: When a transaction reads the same data twice and gets a different value.&lt;/li&gt;
&lt;li&gt;Phantom read: When a transaction searches for rows matching a certain condition but finds the wrong rows due to another transaction’s changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Deadlock
&lt;/h4&gt;

&lt;p&gt;Two users use an exclusive lock on two tables. Then, both will try to apply the same lock to the other table. Since each of them must wait for the lock applied by the other user to be released, neither can proceed with any operation. This situation is called a &lt;strong&gt;deadlock&lt;/strong&gt; and cannot be solved unless one of the locks is released.&lt;/p&gt;

&lt;h4&gt;
  
  
  Rollback
&lt;/h4&gt;

&lt;p&gt;When a deadlock occurs, you can look for transactions that have been queued for a certain time and cancel them. Cancelling a transaction (every operation in it) is called a &lt;strong&gt;rollback&lt;/strong&gt;. For example, if you wanted to apply a discount to all fruits with a price of 150 or more and one of them fails, you cancel everything and the database behaves as if no operation had been performed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Database security
&lt;/h1&gt;

&lt;p&gt;If you don’t secure the database, data can be deleted or modified without permission. A good solution may be to require usernames and passwords to limit users and limit operations to certain users (for example, only an administrator can DROP a table). &lt;/p&gt;

&lt;h3&gt;
  
  
  GRANT
&lt;/h3&gt;

&lt;p&gt;You can grant access to users using GRANT.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;Overseas_business_department&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Database privileges
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feuxsdlxhn2nyk0gnwv1v.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%2Feuxsdlxhn2nyk0gnwv1v.PNG" alt="Privileges"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Granting privilege with WITH GRANT OPTION enables the user to grant privileges to other users.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;overseas_business_department&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;OPTION&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  REVOKE
&lt;/h3&gt;

&lt;p&gt;To take away a user’s privileges uso &lt;strong&gt;REVOKE&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="k"&gt;REVOKE&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;overseas_business_department&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Some database products can group a number of privileges and grant them to multiple users at once. Grouping makes privilege management easier. Using views enables even more security, enabling the view to certain users you also protect the selected data in the view. &lt;/p&gt;

&lt;h1&gt;
  
  
  Disaster recovery
&lt;/h1&gt;

&lt;p&gt;A database needs to have a mechanism that can protect data in the system in the event of a failure. To ensure durability of transactions is mandatory that no failure can create incorrect or faulty data. To protect itself from failure a database performs various operations which include creating backup and transaction &lt;strong&gt;logs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Records called &lt;strong&gt;logs&lt;/strong&gt; are kept whenever a data operation is performed. When a problem has occurred in the system you first restart the system and utilize logs to recover the database. The recovery method varies depending on whether or not the transaction has been committed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of failures
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transaction failure&lt;/strong&gt;: When a transaction cannot be completed due to an error in itself. The transaction is rolled back when this failure occurs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System failure&lt;/strong&gt;: When system goes down because of a power failure or other disruption.
If the problem occurred after a transaction had already been committed, you can recover data by reapplying the operations to the database. This method is called rolling forward.
If the transaction hasn’t been committed, a rollback takes place. The value before the update is referenced to cancel the transaction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Media failure&lt;/strong&gt;: When the hard disks containing the database is damaged.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Checkpoints
&lt;/h1&gt;

&lt;p&gt;In order to improve the efficiency of a write operation in a database, a buffer (segment of memory used to temporarily hold data) is often used to write data in the short term. The contents of the buffer and the database are synchronized, and then a checkpoint is written. When the database writes a checkpoint, it doesn’t have to perform any failure recovery for transactions that were committed before the checkpoint. Transactions that weren’t committed before the checkpoint must be recovered.&lt;/p&gt;

&lt;h1&gt;
  
  
  Indexing
&lt;/h1&gt;

&lt;p&gt;As the database grows and more people begin using it some problems may appear. The greater the volume of data, the slower a search operation becomes.&lt;/p&gt;

&lt;p&gt;An index works as in a book. A blind search of a piece of information in a book would take time, so you check the index to speed up your search. It is very time consuming to browse all rows when searching for certain data. If you create indexed for product codes you can instantly learn where product data is stored for a product assigned. It tells you where on the disk is located, reducing the disk access count and therefore accelerating future searches.&lt;/p&gt;

&lt;p&gt;It is up to the database administrator to add indexes. Creating too many indexes may lead to inefficiency (imagine a large number of indexes in a book, it won’t do any good).&lt;/p&gt;

&lt;h1&gt;
  
  
  Stored programs
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Types
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq54v1dvv5rronwtmyn1.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%2Fhq54v1dvv5rronwtmyn1.PNG" alt="Privileges"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Program logic inside the database server (basically queries inside the server). They help reduce the load on the network because it eliminates the need for frequent transfers of SQL queries.&lt;/p&gt;

&lt;h1&gt;
  
  
  Distributed database
&lt;/h1&gt;

&lt;p&gt;A database in which not all storage devices are attached to a common processor but in multiple computers, located in the same physical location or dispersed over a network of interconnected computers. Keep in mind that it may be handled as a single database.&lt;/p&gt;

&lt;h1&gt;
  
  
  Practice
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;W3Schools has a lot of basic SQL exercises, &lt;a href="https://www.w3schools.com/sql/sql_exercises.asp" rel="noopener noreferrer"&gt;practice them&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;W3Resources has a wide varierty of exercises for you to &lt;a href="https://www.w3resource.com/sql-exercises/" rel="noopener noreferrer"&gt;improve your skills&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The Manga Guide to Databases includes exercises with its answers, not only SQL but also for the design phase.&lt;/li&gt;
&lt;li&gt;Try also Google or Youtube.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Source
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Cover image: Google.&lt;/li&gt;
&lt;li&gt;The Manga Guide to Databases: A really recommended reading. In a simple story explains everything about databases (most of this article is based on it). Includes sections with more technical information and exercises. Very useful.&lt;/li&gt;
&lt;li&gt;My own notes from high school.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codecademy.com/articles/what-is-rdbms-sql" rel="noopener noreferrer"&gt;https://www.codecademy.com/articles/what-is-rdbms-sql&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://basededatosaplicado.blogspot.com/2011/10/v-behaviorurldefaultvmlo.html" rel="noopener noreferrer"&gt;https://basededatosaplicado.blogspot.com/2011/10/v-behaviorurldefaultvmlo.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wofford-ecs.org/DataAndVisualization/ermodel/material.htm" rel="noopener noreferrer"&gt;https://wofford-ecs.org/DataAndVisualization/ermodel/material.htm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.studytonight.com/dbms/database-normalization.php" rel="noopener noreferrer"&gt;https://www.studytonight.com/dbms/database-normalization.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/sql/sql_like.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/sql/sql_like.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/sql/sql_having.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/sql/sql_having.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/sql/sql_join.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/sql/sql_join.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/sql/sql_alias.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/sql/sql_alias.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3resource.com/sql/joins/perform-an-equi-join.php" rel="noopener noreferrer"&gt;https://www.w3resource.com/sql/joins/perform-an-equi-join.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Distributed_database" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Distributed_database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.informit.com/articles/article.aspx?p=27785&amp;amp;seqNum=3" rel="noopener noreferrer"&gt;http://www.informit.com/articles/article.aspx?p=27785&amp;amp;seqNum=3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://germoroney.wordpress.com/2012/11/26/different-types-of-database-keys/" rel="noopener noreferrer"&gt;https://germoroney.wordpress.com/2012/11/26/different-types-of-database-keys/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/What-is-the-difference-between-partial-and-transitive-dependency-in-database-management" rel="noopener noreferrer"&gt;https://www.quora.com/What-is-the-difference-between-partial-and-transitive-dependency-in-database-management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@jimmyfarillo/the-basics-of-database-indexes-for-relational-databases-bfc634d6bb37" rel="noopener noreferrer"&gt;https://medium.com/@jimmyfarillo/the-basics-of-database-indexes-for-relational-databases-bfc634d6bb37&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>sql</category>
    </item>
    <item>
      <title>CSS Grid vs Flexbox</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Tue, 18 Dec 2018 18:33:07 +0000</pubDate>
      <link>https://forem.com/lmolivera/css-grid-vs-flexbox-1koi</link>
      <guid>https://forem.com/lmolivera/css-grid-vs-flexbox-1koi</guid>
      <description>&lt;p&gt;The main reason I wanted to learn CSS was because I was very interested in Responsive Web Design. I tried to use the 'float' method until &lt;a href="https://stackoverflow.com/questions/9776840/are-floats-bad-what-should-be-used-in-its-place" rel="noopener noreferrer"&gt;I discovered it was a bit outdated&lt;/a&gt; and there were better options for a web layout.&lt;/p&gt;

&lt;p&gt;I started using Flexbox to organize my layout. Until I discovered CSS Grid. But I was confused as Flexbox and CSS Grid are very similar and I didn't know when to use which. So, let me tell you what I learnt from my new research.&lt;/p&gt;

&lt;h3&gt;
  
  
  The main difference
&lt;/h3&gt;

&lt;p&gt;"Flexbox is made for one dimensional layouts and Grid is made for two dimensional layouts."&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%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AEwh1fXubGWjA2GNaPGTYKw.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%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AEwh1fXubGWjA2GNaPGTYKw.png" alt="One dimension example"&gt;&lt;/a&gt;&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%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AcdngZtVyxvxCt6pvDNcM9w.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%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AcdngZtVyxvxCt6pvDNcM9w.png" alt="Two dimensions example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  More differences
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;CSS Grid’s approach is layout-first while Flexbox’s approach is content-first.&lt;/li&gt;
&lt;li&gt;Flexbox layout is most appropriate to the components of an application and small-scale layouts, while the Grid layout is intended for larger scale layouts which aren’t linear in their design.&lt;/li&gt;
&lt;li&gt;Tip: You can even combine these layout models. Note that you can use a Flexbox container inside a CSS Grid container (and vice-versa too!).
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1000%2F1%2Ajy2Xh-3Uiv5-uBc0pprKBQ.jpeg" alt="Combination of Flexbox and CSS Grid"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;I created some time ago a tribute page as a project for the &lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; curriculum. Fully responsive and made with Flexbox, in case you want to check how to use it.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/LeWanderer/embed/eLdQdO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I also made the same project with CSS Grid, check it out.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/LeWanderer/embed/dwOLdQ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Practice both!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/thomaspark" rel="noopener noreferrer"&gt;Thomas Park&lt;/a&gt; has created two cute games to learn and practice &lt;a href="https://flexboxfroggy.com" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt; and &lt;a href="https://cssgridgarden.com" rel="noopener noreferrer"&gt;CSS Grid&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When I have doubts
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://css-tricks.com/" rel="noopener noreferrer"&gt;CSS Tricks&lt;/a&gt; has simple guides to use &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;Flexbox&lt;/a&gt; and &lt;a href="https://css-tricks.com/snippets/css/complete-guide-grid/" rel="noopener noreferrer"&gt;CSS Grid&lt;/a&gt;. I check them everytime I have a doubt or don't remember syntax.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Compatibility
&lt;/h3&gt;

&lt;p&gt;You can check which browsers support Flexbox &lt;a href="https://caniuse.com/#feat=flexbox" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Check &lt;a href="https://caniuse.com/#feat=css-grid" rel="noopener noreferrer"&gt;here&lt;/a&gt; for CSS Grid compatibility.&lt;/p&gt;

&lt;p&gt;Also check &lt;a href="https://css-tricks.com/css-grid-in-ie-debunking-common-ie-grid-misconceptions/" rel="noopener noreferrer"&gt;implementing CSS grid in Internet Explorer&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.canva.com/guptaji" rel="noopener noreferrer"&gt;Cover photo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hackernoon.com/the-ultimate-css-battle-grid-vs-flexbox-d40da0449faf" rel="noopener noreferrer"&gt;Quote and information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/youstart-labs/beginners-guide-to-choose-between-css-grid-and-flexbox-783005dd2412" rel="noopener noreferrer"&gt;Images and information&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Thoughts
&lt;/h3&gt;

&lt;p&gt;Which one do you use the most?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>css</category>
      <category>web</category>
    </item>
    <item>
      <title>Library vs Framework</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Fri, 14 Dec 2018 14:08:12 +0000</pubDate>
      <link>https://forem.com/lmolivera/library-vs-framework-3bgo</link>
      <guid>https://forem.com/lmolivera/library-vs-framework-3bgo</guid>
      <description>&lt;p&gt;The other day at the office a colleague approached me and asked me what I thought of Bootstrap. As I been studying Modern Web Development for the past five months he wanted to know whether he should say Bootstrap was a framework or a library. And that question caught me off guard, because I got to know I didn’t understand the differences between a library and a framework.&lt;/p&gt;

&lt;p&gt;I am a junior developer, so what I expect from me is to research this to make a proper answer. I am very sure there are other juniors in dev.to that might not know the answer. I will try to tell you what I have learned from this.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a library?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.quora.com/What-does-library-mean-in-the-case-of-programming-languages" rel="noopener noreferrer"&gt;Source&lt;/a&gt;: A library is a set of code that was previously written, that can be called upon when building your own code. It is work that was previously done by someone else that you can now make use of, without having to do it yourself.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.webopedia.com/TERM/L/library.html" rel="noopener noreferrer"&gt;Source&lt;/a&gt;: In programming, a library is a collection of precompiled routines that a program can use. The routines, sometimes called modules, are stored in object format. Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them.&lt;/li&gt;
&lt;li&gt;To sum up: A library is a collection of codes you will be using frecuently. You may call the code directly if you need it.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks" rel="noopener noreferrer"&gt;Some well known Javascript libraries&lt;/a&gt;: jQuery, D3.js, React.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is a Framework?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.quora.com/What-is-a-framework-in-programming" rel="noopener noreferrer"&gt;Source&lt;/a&gt; To understand frameworks you first need to understand libraries. Libraries are a bunch of codes that can save your time by already implementing the functionality you want. You can call the appropriate library for the appropriate job and the library does the job for you. You don’t need to know how the functions inside the libraries do their job. You just need to know how to call them. Frameworks on the other hand are just like libraries in a way that they make your job easier, but you cannot call frameworks in the same way as libraries. If you want to use framework, you have to learn the framework, because in this case, the framework call your code, and not the other way round. So you need to learn how the framework works and all the concepts inside it. In simple terms, you can call libraries, while frameworks call your code.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/JavaScript_framework" rel="noopener noreferrer"&gt;Source&lt;/a&gt; A library offers functions to be called by its parent code, whereas a framework defines the entire application design. A developer does not call a framework; instead it is the framework that will call and use the code in some particular way.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Software_framework" rel="noopener noreferrer"&gt;Source&lt;/a&gt; A software framework is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate development of software applications, products and solutions. Software frameworks may include support programs, compilers, code libraries, tool sets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or system.&lt;/li&gt;
&lt;li&gt;To some up: A framework defines how your application will be structured, it decides when to call code and it can include libraries, which will be used if needed. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks" rel="noopener noreferrer"&gt;Some well known Javascript frameworks&lt;/a&gt;: AngularJS, Backbone.js, Vue.js.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Wrapping up everything
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/datafire-io/libraries-vs-frameworks-626cdde799a7" rel="noopener noreferrer"&gt;Source&lt;/a&gt;:If we use the metaphor of architecture, libraries are bricks, and frameworks are, fittingly, the frame.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg6ny8nrnahyloybvpfk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg6ny8nrnahyloybvpfk.png" alt="Library and Framework" width="640" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  So… What is Bootstrap then?
&lt;/h3&gt;

&lt;p&gt;At the &lt;a href="https://learn.freecodecamp.org" rel="noopener noreferrer"&gt;FreeCodeCamp curriculum&lt;/a&gt;, Bootstrap appears under the “Front End Libraries Certification” section. But in the &lt;a href="https://getbootstrap.com/docs/4.0/getting-started/introduction/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; says Bootstrap is a framework. I’m clearly not an expert, but if I had to choose I would guide me by the official documentation. Bootstrap is a CSS Framework.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you think?
&lt;/h3&gt;

&lt;p&gt;As I already told you, I am a junior. Is this article correct? Or it has incorrect information?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading. Don't forget to follow me on dev.to and Twitter!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>library</category>
      <category>framework</category>
    </item>
    <item>
      <title>My own React tutorial! Feedback needed</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Thu, 06 Dec 2018 17:40:24 +0000</pubDate>
      <link>https://forem.com/lmolivera/my-own-react-tutorial-feedback-needed-4bel</link>
      <guid>https://forem.com/lmolivera/my-own-react-tutorial-feedback-needed-4bel</guid>
      <description>&lt;p&gt;Hello Dev.to!&lt;/p&gt;

&lt;p&gt;I once heard something like "If you can explain it simple enough it means you really know the subject". I have been studying Front-End for a couple of months and I wanted to check if I really know how to use React, so I wrote a small tutorial.&lt;/p&gt;

&lt;p&gt;The catch is that I'm very sure there are a lot of things missing in the tutorial and as it is the first time I write something like this I need feedback from everyone, from junior (did you understand?) to senior (did I forgot to add something?).&lt;/p&gt;

&lt;p&gt;So here it is. Feel free to comment here or making a pull request to change the tutorial, it'll be much appreciated.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/LMOlivera" rel="noopener noreferrer"&gt;
        LMOlivera
      &lt;/a&gt; / &lt;a href="https://github.com/LMOlivera/Learn-React-fast" rel="noopener noreferrer"&gt;
        Learn-React-fast
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      React.js introduction tutorial to use it fast.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Learn-React-fast&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Are you an impatient student like me? This is the React tutorial for you.&lt;/p&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/LMOlivera/Learn-React-fast/blob/master/images/reactjs.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FLMOlivera%2FLearn-React-fast%2Fraw%2Fmaster%2Fimages%2Freactjs.png" alt="Google components"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: This was made with the combined knowledge I acquired from many tutorials, articles and videos. Not all the images I use are of my autorship.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Index&lt;/h1&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Before" rel="noopener noreferrer"&gt;Before we start&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Know" rel="noopener noreferrer"&gt;Things you should know...&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Tools" rel="noopener noreferrer"&gt;Tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Introduction" rel="noopener noreferrer"&gt;Introduction&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#VirtualDOM" rel="noopener noreferrer"&gt;Virtual DOM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#JSX" rel="noopener noreferrer"&gt;JSX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Basic" rel="noopener noreferrer"&gt;Basic&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/LMOlivera/Learn-React-fast#ReactComponent" rel="noopener noreferrer"&gt;What is a React Component?&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#FunctionComponent" rel="noopener noreferrer"&gt;Function component&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#ClassComponent" rel="noopener noreferrer"&gt;Class component&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#InputExample" rel="noopener noreferrer"&gt;Input example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#OutputExample" rel="noopener noreferrer"&gt;Output example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#WhenFunctionClass" rel="noopener noreferrer"&gt;When to use Function or Class component&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Props" rel="noopener noreferrer"&gt;Props&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#PropFunction" rel="noopener noreferrer"&gt;Working in a function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#PropClass" rel="noopener noreferrer"&gt;Working in a class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#PropResult" rel="noopener noreferrer"&gt;Result&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://github.com/LMOlivera/Learn-React-fast#State" rel="noopener noreferrer"&gt;State&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#ChangeState" rel="noopener noreferrer"&gt;Changing the state&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Lifecycle" rel="noopener noreferrer"&gt;Lifecycle&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Hooks" rel="noopener noreferrer"&gt;Hooks&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#Things" rel="noopener noreferrer"&gt;Some things to have in mind&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast#ExtraInfo" rel="noopener noreferrer"&gt;Extra information&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;a href="https://github.com/LMOlivera/Learn-React-fast" rel="noopener noreferrer"&gt;Before we start...&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;I’m writing this because of &lt;strong&gt;two reasons&lt;/strong&gt;:&lt;/p&gt;


&lt;ol&gt;

&lt;li&gt;The first is to ensure I know React so well that I can write a tutorial.&lt;/li&gt;

&lt;li&gt;I consider most tutorials to be very slow and I like going fast and straight to action, so here you will see little…&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/LMOlivera/Learn-React-fast" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>help</category>
      <category>beginners</category>
      <category>react</category>
      <category>github</category>
    </item>
    <item>
      <title>Static Class or Interface?</title>
      <dc:creator>Lucas Olivera</dc:creator>
      <pubDate>Thu, 22 Nov 2018 20:34:01 +0000</pubDate>
      <link>https://forem.com/lmolivera/static-class-or-interface-720</link>
      <guid>https://forem.com/lmolivera/static-class-or-interface-720</guid>
      <description>&lt;p&gt;Hello guys, this is my first post and it is a question. I've been learning C# and I didn't understand the difference between Static Class and Interface. In essence they appear to do the same, but as I don't have much experience I was wondering if maybe they were the same but with different performance or something like that.&lt;br&gt;
Help?&lt;/p&gt;

</description>
      <category>help</category>
    </item>
  </channel>
</rss>
