Brain Dump on Databases

Hello there!

Whilst basking in the post-turkey glow that is the day after Thanksgiving, I found myself wanting to read an article about technology so that I could have something to blog about. After some consideration, I realized that I wanted to write about databases. Why databases? Because in a class recently, I was writing out use cases for a system that I'm developing with a team. We were weighing the pros and cons of different databases in terms of security, interoperability, and so forth. It was at this moment that I realized I didn't know anything about databases.

My original intent today was to look up databases like MongoDB and mySQL and to compare them in terms of the parameters I specified above to gain a better understanding, but it was then that I realized I don't even really know what a database is. Sure, I know that it stores data. But what does that even mean? And how long am I going to pretend like I understand what that really means before actually putting in some research? Then I stumbled across a few articles explaining databases and what they really are. What a perfect opportunity.

What is a database?

That question has a simple answer and a complex answer. The simple answer: "a collection of information that is organized so that it can be easily accessed, managed, and updated." (taken from this article). So basically a place where we can store a lot of data. Seems simple enough. But how is this data stored? And why are there so many different kinds of databases out there? There must be something that I'm missing. This is the more complex part of databases:

First, there are two main kinds of databases.

1) The relational database. This is the kind that we see most often (or at least that I've seen most often). That's because it's very easy to understand and to manipulate. Relational databases are sets of tables that store and organize the data that you have. For example, you can have a table that stores information about personal profiles for a website, a table that stores specific profiles and their spending history on the site, and another table that holds the data for every product that has been bought ever. These databases also match data using common characteristics that are found in order to group them into tables, or more commonly known as schemas. This kind of database is nice, because it is easy to get the information that you need out of it. A very common user and application program interface for relational databases is SQL which I just discovered stands for structured query language. This means that SQL is a language that allows you to use SQL commands to query information from a database and to gather different kinds of data from it. Another great part about relational databases is that they are easy to extend. Meaning that I can easily add more information to it without having to restructure everything that was there before. Cool. SQL doesn't seem too hard to understand. But I haven't only heard about SQL, I've heard about mySQL and noSQL.... so what are those?
  • After a little bit of research, I discovered that there are a few reasons why some might prefer to use noSQL over SQL. If you are using SQL and you have a database that hold a LOT of information, you sometimes need to store this information on several servers. This can be tricky with the generic SQL-relational database-table based approach because you are storing different rows and columns of these tables over several servers (yikes!). The noSQL option helps with this. It automatically spreads your data onto multiple servers without needing application assistance.
  • Also, noSQL is an object oriented language (more on this in a minute)
Okay, awesome. I get SQL now and I understand noSQL at least a little bit. But what is mySQL? After some research, I figured out that mySQL is very similar to SQL with the exception of a few small things. 

First, mySQL helps much more with allowing a user to select data, modify it, and save it again. Making it a great choice for data storage and referencing data. However SQL does seem to be a bit more secure than mySQL. This is because Microsoft's baseline security analyzer helps make sure that SQL is up to date on all safety features, whereas mySQL doesn't have this perk. (Did I mention that SQL is owned by Microsoft?). On top of this, mySQL is a little bit weaker when it comes to inserting and deleting data as well. So overall, mySQL seems to be a little bit better if you are looking to modify that data often, but there are a few setbacks to beware of. It ultimately depends on the specific platform and what you are going to be using the database for the most. (I graciously absorbed all of this info from here).

2) I finally made it to the second kind of database! You got a sneak preview of this type when I spoke about noSQL and the object oriented database. In this kind of database, the data is stored in objects that can be inherited, modified, and stored pretty easily. Object oriented databases are pretty cool but also a fairly new idea so there isn't too much information out there on them. However, from what I read it seems to me that storing data into objects optimizes looking up specific pieces of data because querying is much faster through objects. This rings true when comparing noSQL to SQL. Now I can see that noSQL generally processes data faster than SQL (and relational databases in general), and it's often faster because its data model is a little bit simpler (compared to that of tables, columns, and schemas). (Again thank you internet for providing such explanatory articles on this stuff).

Wow, that was a lot of information. If you are anything like me, you probably feel like this right about now:



But that is okay! Learning new things about technology is hard. I've been coding for three years and some change now, and I still feel lost a very large portion of time. Even after writing this article I can still admit that databases are a little bit of an intimidating concept to me. But, I can at least hold up a conversation about SQL and its benefits compared to that of an object oriented database. And that's why I have this blog now anyways right? To hold myself accountable for learning outside of school and to keep up with technology.

I wanted to add a quick note to anyone who may be viewing this blog. If you ever have any comments, questions, or suggestions for me; I will gladly take constructive criticism! Feel free to leave a comment or shoot me an email.

Thanks for reading, and I'll catch you next time.

Comments

Post a Comment

Popular posts from this blog

My Blog Is Now On Medium!

My Grace Hopper Thoughts