You stored what in where?

Vincenzo Marcella
4 min readNov 5, 2018

Regardless of if you’re a programmer, you’ve almost surely encountered a Database either directly or indirectly. As a matter of fact, if you’re a user on Medium, you’ve interacted with one by simply signing up! But what exactly are they? Semantically, a Database is a “Structured set of information held within a computer” but that doesn’t really help much. Let’s break it down by taking a non-technical approach to explaining it.

File cabinets and documents

During the time of which computers did not exist and Dinosaurs had still roamed the earth, people used file cabinets to store information that they would need for later. Some people even went as far as placing tabs within these filing cabinets to differentiate the documents that they were going to be inserting to this file cabinet. When a document needed to be retrieved and all the Dinosaurs have been fought off, the person could go inside of the file cabinet, retrieve the document that they’re looking for, and then when they’re done with it place it back into the file cabinet where I got it from. This is almost perfectly parallel to what databases do on a non-technical level, except software is retrieving the document or rather piece of information and no one has to fend off any Dinosaurs.

Why we should care

Now since we have a non-technical grasp on databases, why should we even care about them? Simple, they’re literally everywhere. If you’ve ever thought about operating an internet based business without one, you might want to think again. Companies like Amazon, Facebook, Twitter, Apple, Snapchat, Instagram, and so on all use multiple kinds of databases to process the large amounts of information their services generate every single second. They use databases because they provide an intuitive way of handling information at speeds that completely blow any prior alternative out of the water, allowing these companies to worry less about how they store information and more on the actual information itself.

Types of databases

In the last section, I mentioned that companies used multiple kinds of databases, but why? If we go back to the semantic definition of what a database is, we see the word “Structured” right at the very beginning of the sentence. When working with large amounts of data, you’re going to find out that not all the data can be structured in the same way to be worked with effectively. Instead of only adhering to use one database where we force fit all the data into it, it’s much easier to use multiple that allow the data we’re handling to be stored as efficiently as possible. Although there are multiple types of databases that can be used, they all essentially achieve the same end goal: Make accessing, creating, updating, and deleting information efficient as fast as possible for the task at hand. While there are a plethora of types to talk about, I will only be discussing one of the most common types of databases: Relational.

Relational databases

In 1970, Edgar Codd published the paper “A Relational Model of Data for Large Shared Data Banks,” in which he proposed the organization of data in tables that consist of rows and columns. Tables, also referred to as relations, essentially act as containers for information that is related to each other. Inside of the table, we have both rows and columns. Columns are used to define attributes of the information we’re storing, and rows are records that hold these attributes. For instance, let’s say you’re signing up for Facebook. When you go to register, you’re prompted with what email you’re going to use, a password, full name, birth date, and other attributes in order for your profile to be created. When you’ve finished filling out the form and go to create your profile, a row is created inside of a table that deals with user profiles and you’re now allowed to access that information whenever. We’ve just created a row inside of a table, hooray! But how exactly did we interact with this database? It’s not like you can have a conversation with a database as if you were speaking to me. Databases “speak” in something called SQL. SQL stands for structured query language, and it is just that! SQL allows us to create queries into our relational database to interact with it in almost whatever way we need. Going back to creating a Facebook profile, let’s see how our user creation would look like:

INSERT INTO PROFILES VALUES(‘Vincenzo Marcella’, ‘cenz@cenz.io’, ‘CA’);

Okay, so this isn’t exactly what would be going into Facebook's database, but work with me here. As you can see, we’re telling our database to insert into our profiles table my name, email, and the state in which I live. Those attribute values all together form a row which then can be inserted into the table. Now you’ve inserted something into a relational database and learned how to speak it’s language, double hooray!

Closing thoughts

As you can imagine, the scope of relational databases are far beyond just Facebook login pages and the actual complexity of them even goes beyond that. Relational databases, and databases in general provide an intuitive, fast, and extremely efficient way to manipulate information in ways that weren’t even considered possible less than 100 years ago. Currently Relational databases are still the most frequently used kinds of databases out there, however, there has been a recent massive trend of people starting to use NoSQL and Graph based databases that I highly recommend looking into if you’re interested in learning more about the current alternatives to relational databases today. As technology continues to progress and data becomes more complex, i’m excited to see the what new innovative database technology comes out to accommodate it. Thank you for reading.

--

--

No responses yet