← Databases

Overarching note that is slowly going to expand into more as I study more about them! Very rough draft at the moment.

Status: Writing up notes after having gone through CS184 (Stanford’s Databases course)

NoSQL vs SQL

In the beginning, there were relational databases. These are your typical tables with rows and columns that each row has. You can think of it like each row being a thing and each column being a particular attribute of every data point.

Now throw that all out the window, since NoSQL feels not at all related to that. If your notion of a database is SQL, joins, and consistency, then NoSQL doesn’t come with any of that. Instead you have this taxonomy of graph-based DBs, key-value pairs, etc. To me, some of them don’t even feel like databases. Like a large key-value pair store stores information, but it cannot provide the same services as a traditional relational model.

If you’re thinking about picking between the two, you have to keep in mind they’re for very different tasks. For traditional DB things like joins and consistency, go relational. If you need something that can scale extremely well, isn’t always consistent, matches your data better, and is just a massive dictionary, then look into NoSQL.1

How are relational databases stored?

This could take a whole class, but I’ll leave this as a TODO right now. Roughly, give each layer some exposition from the client -> operators -> optimization -> index -> buffer -> disk space manager -> literal files on disk.

SQL cheatsheet

TODO


  1. I’ve never found a real use for NoSQL databases and haven’t read too much into them! If someone is more well versed, do let me know where I’m going wrong with this explanation :)↩︎