Introduction to Database Design

Database Design Fundamentals

Welcome to our first post in the Database Design Fundamentals course, where you will learn what a database is and how to design one.

But, before we can answer the obvious question, "What is a database?", we first have to answer the questions, "What is data?" and "What is a base?"

What is Data?

I have already answered this question in great detail in the post, "The 5 Components of Information Technology". Please make sure you read it if you haven't done so already.

To summarize, data are facts usually describing some real-world object. For example:

Fact
Billy
Guitar
Strings

So what does this mean?

  • Billy has a guitar with strings?

Let's add some context:

LabelFact
First NameBilly
Last NameStrings
InstrumentGuitar

Now we can see what it means:

  • Billy Strings is a guitar player. Yip, he is for real and an awesome guitar player.

If we expand this data even a bit further we see the following:

Table: Bluegrass Artists

First NameLast NameMain Instrument
BillyStringsGuitar
EarlScruggsBanjo
SamBushMandolin
JerryDouglasDobro

So, it turns out that the facts we started with were part of a list of Bluegrass music artists. Now, you either like Bluegrass music or you don't. I love it!

Now that we know what data is, we have to figure out the base part.

What is a Base?

I am going to keep this simple. Your base is your home. That is where you live. So a base is a place where data live.

What is a Database?

Finally, we can define a database as a container where data is stored and manipulated in an organized fashion. One example of a database is a shopping list written down on a piece of paper. It serves to demonstrate the four things you can do with data: Create, Read, Update, and Delete or CRUD for short.

We can READ the shopping list:

Shopping List
Bread
Milk
Potatoes
Onions
Butter

We can CREATE a new item in the shopping list:

Shopping List
Bread
Milk
Potatoes
Onions
Butter
Grapes

We can UPDATE an item in the shopping list:

Shopping List
Bread
Milk
Potatoes
Red Onions
Butter
Grapes

And, finally, we can DELETE items from the shopping list:

Shopping List
Bread
Milk
Potatoes
Red Onions
Butter
Grapes

A shopping list is a simple database. Most databases used in Enterprise Applications are way more complicated than that. And it is the job of the software developer to come up with a proper database design. That said, it is not always the job of the software developer to design databases. Some companies have database experts who will have the honor. They will most probably have the title of Database Administrator or DBA for short.

Although we have data in a container such as the items on a piece of paper in the example above, we need some form of intelligence to manage and interact with this database. This is where the database engine comes into play. The database engine knows how to Create, Read, Update, and Delete the data in the database and we use a domain-specific language called SQL to tell the database engine what we want done to the data.

Apart from the CRUD actions, the database engine does a lot of other work as well, such as indexing the data, maintaining data integrity, managing data restraints, etc. We will cover these later in the course. This database engine, plus all its supporting apps, is called a Database Management System or DBMS for short.

As you can see from the image a database is depicted by a cylinder-type image and usually lives on a powerful computer called the Database Server.

Types of Databases

There is more than one way to skin a cat. Why would anyone want to do that? But, in the same way, there is more than one way to store and manage data. Hence there is more than one type of database system out there.

We will discuss two groups of databases; SQL databases and NoSQL databases. In hindsight, they could have chosen better names, but we are stuck with SQL and NoSQL.

SQL, which we will cover in a separate post, is the language used to communicate with SQL databases. And SQL is usually not used to communicate with NoSQL databases, hence NoSQL or Not Only SQL. I told you they could have come up with better names, but on the other hand, it says it as it is.

Let's look at NoSQL databases first.

NoSQL Databases

NoSQL databases are the new kids on the block and became popular when big data became a thing. There are four types of NoSQL databases widely in use, namely:

  • Document Databases,

  • Column Oriented Databases,

  • Key Value Databases, and

  • Graph Databases.

Each of these database types uses a different data structure, thus organizing the data differently, making these database types excel in specific use cases.

Please note that I will not cover NoSQL databases in this course. If time permits, I may do a course on each type in the future.

SQL Databases

The granddaddy of the database family is the SQL database and the Relational Database specifically. The Relational Database was designed by Dr. Edgar Codd in the '60s and '70s. To this day, it is the most popular type of database in use and runs the world economy. I don't even think I am exaggerating. Maybe a little bit.

We owe Dr. Codd a big thank you, I think.

We will cover relational databases in depth in the Database Fundamentals courses. I think you will find it a fascinating learning experience. If you don't, you are wrong! Databases are lots of fun!

Some popular Relational Database Management Systems (RDBMS) are PostgreSQL, MySQL, SQLite, Microsoft SQL Server, Oracle Database, and IBM Db2. In this series, you will learn how to design and build databases with PostgreSQL, MySQL, SQLite, and Microsoft SQL Server.

Conclusion

You now have an idea of what a database is. It may not all make sense as you have not yet seen a database in action. Fear not! A few posts from now and we will get our hands dirty and build some databases. You will learn everything you need to know to install, configure, operate, and communicate with Relational Database Management Systems.

Murphy said, "Before you can do something, you first have to do something else." So, before building a database, you first need to learn how to design one. That is the topic of the next post. See you there!