Categories
Uncategorized

Week 4: Relational or Non-relational?

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 – 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’m slowly becoming more familiar with non-relational databases. This experience with Google Datastore will be great to add to my knowledge.

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.

Relational (SQL) Databases *

  • 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
  • Examples of popular SQL databases:
    • MySQL, PostgreSQL, SQL Server, others…
  • Advantages:
    • ACID Compliance, Data Accuracy, Simplicity
  • Disadvantages:
    • Lacking in performance, flexibility, scalability

Non-relational (NoSQL) Databases *

  • Does not use a tabular schema of rows and columns to store data
  • 4 types of NoSQL databases:
    • Document – Oriented Database: every key is paired with a comlplex data structure document (similar to JSON)
    • Key-Value Stores: uses different key and each key is associated with only one value
    • Wide-Column Stores: 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)
    • Graph Stores: uses a graph structure where a node is data and an edge is an attribute about the relationship between nodes.
  • Examples of popular NoSQL databases:
    • MongoDB, Redis, Google Datastore, others…
  • Advantages
    • Scalable, Flexible, Document-Oriented databases can map to objects in objected-oriented programming languages

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’ve already started looking at Google Datastore documentation and it seems Datastore queries are more complex than MongoDB queries. It also appears that in Datastore a hashmap is not an allowed property 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’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.

To wrap this up, I’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’m looking forward to working with Datastore on this project. I’m curious to see if it is easier, harder, or about the same to work with as compared to Mongo.

* References:

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *