{"id":32,"date":"2022-01-26T17:45:54","date_gmt":"2022-01-26T17:45:54","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/kblack\/?p=32"},"modified":"2022-01-26T17:45:54","modified_gmt":"2022-01-26T17:45:54","slug":"week-4-relational-or-non-relational","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/kblack\/2022\/01\/26\/week-4-relational-or-non-relational\/","title":{"rendered":"Week 4: Relational or Non-relational?"},"content":{"rendered":"\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>For our capstone project, my team has decided to use Google Datastore to store the information related to our language app. Google Datastore is a type of non-relational or NoSQL (Not Only SQL) database. Most of my previous experience has been with relational or SQL (Structured Query Language) databases. When I took CS 290 &#8211; Web Development, the focus was only on relational databases. I believe the course now teaches both types allowing students to get some hands-on experience with NoSQL databases. Most of the projects in my internship use the NoSQL database MongoDB, and I&#8217;m slowly becoming more familiar with non-relational databases. This experience with Google Datastore will be great to add to my knowledge. <\/p>\n\n\n\n<p>So, for my own educational purposes, I want to highlight some similarities and differences between relational and non-relational databases. This information was accumulated from my somewhat simple Google search. Please refer to the references at the bottom if you would like to dive deeper. <\/p>\n\n\n\n<p><strong>Relational (SQL) Databases<\/strong> *<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Data is stored in tables, like a spreadsheet. Columns are attributes and rows are indivual entities composed of attributes. Relationaships between tables is a schema and this must be clearly defined<\/li><li>Examples of popular SQL databases: <ul><li>MySQL, PostgreSQL, SQL Server, others&#8230;<\/li><\/ul><\/li><li>Advantages: <ul><li><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/ACID\" target=\"_blank\">ACID<\/a> Compliance, Data Accuracy, Simplicity<\/li><\/ul><\/li><li>Disadvantages:<ul><li>Lacking in performance, flexibility, scalability <\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Non-relational (NoSQL) Databases<\/strong> *<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Does not use a tabular schema of rows and columns to store data<\/li><li>4 types of NoSQL databases:<ul><li><em>Document &#8211; Oriented Database: <\/em>every key is paired with a comlplex data structure document (similar to JSON)<\/li><li><em>Key-Value Stores: <\/em>uses different key and each key is associated with only one value<\/li><li><em>Wide-Column Stores:<\/em> data is stored in a tabular format, but column names and value formats can very from row to row (similar to SQL, but not as rigid)<\/li><li><em>Graph Stores:<\/em> uses a graph structure where a node is data and an edge is an attribute about the relationship between nodes. <\/li><\/ul><\/li><li>Examples of popular NoSQL databases:<ul><li>MongoDB, Redis, Google Datastore, others&#8230;<\/li><\/ul><\/li><li>Advantages<ul><li>Scalable, Flexible, Document-Oriented databases can map to objects in objected-oriented programming languages<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>For this Capstone project, another teammate created the database model and my tasks do not include database setup. However, I will be implementing some of the backend endpoints. So, I will get my chance to interact with non-relational databases through queries. I&#8217;ve already started looking at <a rel=\"noreferrer noopener\" href=\"https:\/\/cloud.google.com\/datastore\/docs\/concepts\/queries\" target=\"_blank\">Google Datastore documentation<\/a> and it seems Datastore queries are more complex than MongoDB queries. It also appears that in Datastore a hashmap is not an allowed <a rel=\"noreferrer noopener\" href=\"https:\/\/cloud.google.com\/datastore\/docs\/concepts\/entities#properties_and_value_types\" target=\"_blank\">property <\/a>for entities, but arrays are allowed. My team wanted to use a hashmap for one of our entities to quickly locate recording links for a specific language, but have determined a workaround. I&#8217;m curious as to why a hashmap cannot be used because it seems like if would be an efficient data structure to lookup a value. Maybe as I progress with implementing endpoints I will look into this. <\/p>\n\n\n\n<p>To wrap this up, I&#8217;m somewhat disappointed I missed the revamped iteration of CS290 that included MongoDB. Learning about non-relational databases seems essential for industry especially with the move of data to the club and the need for fast and scalable databases. I&#8217;m looking forward to working with Datastore on this project. I&#8217;m curious to see if it is easier, harder, or about the same to work with as compared to Mongo. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>* <strong>References:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.logianalytics.com\/relational-vs-non-relational-databases\/\">https:\/\/www.logianalytics.com\/relational-vs-non-relational-databases\/<\/a><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.mongodb.com\/compare\/relational-vs-non-relational-databases\">https:\/\/www.mongodb.com\/compare\/relational-vs-non-relational-databases<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For our capstone project, my team has decided to use Google Datastore to store the information related to our language app. Google Datastore is a type of non-relational or NoSQL (Not Only SQL) database. Most of my previous experience has been with relational or SQL (Structured Query Language) databases. When I took CS 290 &#8211; [&hellip;]<\/p>\n","protected":false},"author":11980,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/users\/11980"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":4,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/posts\/32\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kblack\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}