{"componentChunkName":"component---src-templates-blog-post-js","path":"/development/sql-vs-nosql--which-one-you-might-want-to-use/","webpackCompilationHash":"f92dbf25810602c1889e","result":{"data":{"site":{"siteMetadata":{"title":"Web Devlog","author":"RossenaHuh","siteUrl":"https://github.com/rossenahuh","comment":{"disqusShortName":"RossenaHuh","utterances":"rossenahuh/my-dev-blog.git"},"sponsor":{"buyMeACoffeeId":"rossena"}}},"markdownRemark":{"id":"3df898c9-e2aa-57e4-beff-43116bc92963","excerpt":"What is SQL?Structured Query Language with which you can retrieve/insert/update/delete the data you need from database.Relational DatabaseA database which works with certain assumptions or in a certain way and it supports the sql. Such database works with tables. Have to be…","html":"<h1 id=\"what-is-sql\"><a href=\"#what-is-sql\" aria-label=\"what is sql permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is SQL?</h1>\n<p><em>Structured Query Language</em> with which you can retrieve/insert/update/delete the data you need from database.</p>\n<h2 id=\"relational-database\"><a href=\"#relational-database\" aria-label=\"relational database permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Relational Database</h2>\n<p>A database which works with certain assumptions or in a certain way and it supports the sql. Such database works with tables. Have to be precise with a <strong>clear schema</strong> of which data can go into a table which has own fields(columns) and records(rows). It can’t hold more fields than the ones we defined for the table.\nAll records have to follow this schema. You typically don’t only work with one table but instead with <strong>multiple tables which are related</strong>.</p>\n<h2 id=\"non-relational-database\"><a href=\"#non-relational-database\" aria-label=\"non relational database permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Non Relational Database</h2>\n<p>In Non Relational Database, there’s <strong>no schema</strong> applied therefore you can be <strong>more flexible</strong> regarding the data format. Generally there are no relations in no sql world. Putting all the information in one place. Have less relation merging going on, have super fast end efficient queries therefore. But the disadvantages is that you have some duplicates in data.</p>\n<h2 id=\"then-which-one-is-a-winner\"><a href=\"#then-which-one-is-a-winner\" aria-label=\"then which one is a winner permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Then which one is a winner?</h2>\n<p>There’s no clear winner. It really depends on the kind of application you are building and the kind of data you are storing. With really big applications or businesses you typically use both.</p>\n<br>\n<p><strong>SQL</strong></p>\n<ul>\n<li>Data uses Schema(predictable layout)</li>\n<li>when there’re many updates in data, it’s useful</li>\n<li>Vertical Scaling (improve server capacitiy / hardware) available</li>\n</ul>\n<br>\n<p><strong>NoSQL</strong></p>\n<ul>\n<li>Schema-less(flexible)</li>\n<li>Useful when there’re many readings</li>\n<li>Horizantal Scaling (add more servers and merge data into one database) available</li>\n</ul>\n<br>\n<p>SQL will be a better choice for the business that has pre-defined structures such as accounting system, inventory monitoring system or when running on legacy systems.</p>\n<br>\n<p>NoSQL will be a strong choice for any businesses that have rapid growth, no clear definition for schema or when the schema continues to change in cases like real-time analytics or content management systems.</p>\n<br>\n<br>\n<p><em>sorces</em></p>\n<p><a href=\"https://www.xplenty.com/blog/the-sql-vs-nosql-difference/?source=post_page---------------------------\">https://www.xplenty.com/blog/the-sql-vs-nosql-difference/?source=post_page---------------------------</a>\n<a href=\"https://www.youtube.com/watch?v=ZS_kXvOeQ5Y&#x26;t=1121s\">https://www.youtube.com/watch?v=ZS_kXvOeQ5Y&#x26;t=1121s</a></p>\n<br>\n<br>","frontmatter":{"title":"SQL vs NoSQL- Which one you might want to use","date":"July 18, 2019"}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"/development/sql-vs-nosql--which-one-you-might-want-to-use/","previous":{"fields":{"slug":"/development/what-are-cicd-and-devops/"},"frontmatter":{"title":"What are Agile, DevOps and CICD","category":"Development"}},"next":{"fields":{"slug":"/React/react-concept-1---virtual-dom/"},"frontmatter":{"title":"React Concept 1 - Virtual DOM and the myths around it solved","category":"React"}}}}}