Databases

This video is excerpt from Lynda.com.

What is data

Before we can talk about databases, we first must talk about data. What is data? Data can be any facts or information related to any object or topic. Data can come in many different forms depending on what the data is describing. If the data is describing a person, it may consist of information like name, age, height and weight. While the data for a web site may consist of text, links, images and videos.

Now, data by itself is raw and random. Data really only becomes useful when it is collected, structured and organized. There are many ways and tools to organize data, and a database is only one of those ways.

For example, data for a web site can be organized using HTML, XML, JSON, or CSV, just to name a few. With all these ways to manage data, why even bother with databases? To answer that question, we must first look at what is a database?

What is a database

A database is an organized collection of data, which can consist of a file or collection of files that holds information, and this collection of the data is typically managed by a database management system, which in turn requires some knowledge and understand to use it properly. But, if a database is just a file of data, what make a database different than a regular text file or a spreadsheet? Wouldn't it be easier to use something we already know? Why use a database?

Why use a Database

A database is merely a tools for organizing data. But just because you have data does not mean you need to use a database, even working with PHP.

There are many ways to store data that would make it accessible to PHP. For example, you can store database in a spreadsheet saved as a CSV (Comma Separated Values) file or you can save data in a web friendly data format like XML or JSON.

However, using a database gives certain advantages that we won't get with these other methods including:

  • Better scalability
  • Easier data management
  • Better accuracy
  • Better security
  • Better data integrity

It is these advantages that make databases so popular and widely used. But, it is not the database itself that makes this all possible, the DBMS that puts these rules place and helps manage the database. Of course, now the next question is, what is a DBMS?