What Is a Database and How Is It Used in Web Hosting?

Home » Knowledge Base » Hosting Basics » What Is a Database and How Is It Used in Web Hosting?
Hero image.

At its core, a database is just a collection of information that is stored on a computer. This information is often organized in a logical manner and is controlled through a sophisticated program called a database management system (DBMS). Thanks to the DBMS, the stored information can be easily viewed, searched, and modified either by the end-user or by another program.

Virtually all information, often referred to as data can be stored in a database. For example, the data can describe a person’s physical characteristics, such as their height, weight, age, and gender. Or if we are talking about an e-commerce store, we will likely use a database to house the product catalog, customer list, and order history.

In an effort to maximize efficiency, all data is stored according to certain rules and guidelines imposed by the type of database that is in use. One of the most popular database types in web hosting is the relational database. In fact, many popular content management systems like WordPress, Drupal, and Joomla use relational databases to store their information.

The information in a relational database is stored in one or more tables. Each table consists of rows and columns where the data is kept. The layout used by relational databases is very similar to spreadsheet programs like Microsoft Excel and Google Sheets. That said, relational databases are more constrained. Each row is referred to as a database record and is used to store information. Columns, on the other hand, are always used to create categories that describe the information that each record holds. An example relational database can be seen in the illustration below:

Relational databases appear very similar to regular tables and spreadsheets since they all use rows and columns to structure the data they hold.
Relational databases appear very similar to regular tables and spreadsheets since they all use rows and columns to structure the data they hold.

In the example above, each row, or record, describes a person. The information is broken down into their ID number, first name, last name, date of birth, and phone number thanks to the use of columns. The intersection of every row and column is known as a field. Every field contains a single piece of information that has a defined type such as text, a number, a date, a Boolean, etc. All fields in a given record should pertain to the same object in order to fully describe it. In our example, each row contains the contact details of a single individual instead of multiple people.

Another powerful feature of relational databases is the fact that you can form relationships between different tables. That allows you to make connections between tables and combine data from multiple sources when needed. Below, we will provide a simple example of how two tables can be connected. In the example, we will show you how your phone’s contacts are likely set up.

In many cases, you would have one table that contains detailed information about each contact, such as their names, phone numbers, emails, addresses, etc, while a second table would be used for your contact list and it would only display a person’s first and last name.

If you open the contact card for a specific person, you will be presented with all available information such as their phone number, age, email, etc.
If you open the contact card for a specific person, you will be presented with all available information such as their phone number, age, email, etc.
Your phone's contact list usually displays just the first and last name of each contact. As such, it draws its data from a relatively small table in the database.
 Your phone’s contact list usually displays just the first and last name of each contact. As such, it draws its data from a relatively small table in the database.

At this point, you may be thinking that these two tables are completely independent of one another. That, however, is not the case. Instead, the small table that contains only the contacts’ first and last names gets its information from the larger table that contains all data. In other words, there is a relationship formed between the two tables. This relationship is facilitated using the ID fields in each table since they act as unique identifiers for each contact. The illustration below demonstrates how the relationship between the two tables works:

The small table gets its data from the large table. The only piece of information that the small table truly stores is the unique ID number for each contact.
The small table gets its data from the large table. The only piece of information that the small table truly stores is the unique ID number for each contact.

The data exchange between the two tables happens in two steps. First, the small table provides the ID numbers of the contacts to the large table and requests their first and last names. This is represented by the blue arrow in the illustration above. Then, in the second step, the large database returns the list of first and last names to the small table, so it can be used when displaying your contacts list. This second step is represented by the green and yellow arrows. The benefit of this relationship is that if you decide to update the name of a given person on their contact card, then the list of contacts will be updated automatically since it gets its information from the contact cards themselves.

These interactions between the two tables are performed via queries. Queries are special requests that are sent to the database either by the end-user or by another program. In our example above, the small table sends a query to the larger table to retrieve the necessary information. However, queries can be used for much more than just fetching data. Through queries, it is possible to search, rearrange, group, edit, and delete information. In fact, every database interaction is translated into a query.

Most databases use the Structured Query Language (SQL) to compose queries. SQL is a relatively expressive language that is easy to understand, even if you have not used it before. Going back to our contacts example, the following query would display all available information for all contacts that have the first name John:

SELECT * FROM `Contacts`
WHERE first_name = "John"

All of these queries are processed by a specialized part of the database called the database management system (DBMS). While the database itself is a set of files where the information is kept, a database management system is a software application that allows you to manipulate the data in the database. Through a DBMS you can add new information, edit existing data, and remove unnecessary records. What is more, you can create new relationships between tables and generate reports that contain data that are grouped or filtered in a useful manner.

Database management systems are extremely powerful and capable, however, they can also be intimidating to newcomers since all interactions occur via queries. That is why there are administrative tools that provide a graphical user interface where you can visually edit and maintain your database. One popular tool for managing your databases is phpMyAdmin. We have fully integrated this database management system into our hosting environment. As such, if you decide to purchase a paid hosting plan from us or even just sign up for a free hosting package, you will gain access to this powerful and versatile tool.

phpMyAdmin may look complicated, but once you are used to its basic functions, it becomes a real time-saver when working with your databases.
phpMyAdmin may look complicated, but once you are used to its basic functions, it becomes a real-time-saver when working with your databases.

At this point, you may be thinking that running a database server and phpMyAdmin requires some specialized computer hardware. Fortunately, that is not the case. The database server is just a software application that can be installed on any computer. That said, here at AwardSpace, we do things a bit differently. We have set up a server cluster that is dedicated to powering only databases. This stands in stark contrast to other hosting providers who often overload their servers by using them to power your website, database, email service, etc. We do not take this approach as we aim to keep our web and database servers as performant as possible, even when they are under extremely heavy loads.

To learn more about what a database is and how it works, continue reading, or jump to the section that interests you:

 

What Types of Databases Are There?

The concept of a computer database has been around for a long time. In fact, the very first databases were created in the 1960s and over the decades multiple new database iterations have emerged. Each new iteration aims to fix the shortcomings of its predecessors while also taking full advantage of the new computing and processing capabilities of modern computer hardware. That said, it is not uncommon for older types of databases to still be in active use. This is due to the fact that these older database types have matured and offer stability that is crucial for mission-critical tasks. Moreover, some database types have been designed with specific uses in mind and cannot be used as general-purpose databases.

Databases are a mature computing technology, dating back to the 1960s.
Databases are a mature computing technology, dating back to the 1960s.

Below, you will find a list containing all major database types:

  • The navigational database was the first database type to be invented. It was popularized in the 1960s and used pointers to follow relationships from one record to another. While simple, this type of database was fairly inflexible which is why it is no longer in use today.
  • The relational database became prominent in the 1980s and is still popular today. In fact, the top content management systems like WordPress, Drupal, Joomla, OpenCart, PrestaShop, Moodle, Magento, and others all use relational databases for their information storage needs. We will examine relational databases in greater detail later in this article.
  • The object-oriented database became popular in the 1990s. This database type draws inspiration from object-oriented programming since all information in that database is stored in the form of objects.
  • You could say that the NoSQL database is the antithesis of the relational database. With a NoSQL database, you are allowed to store unstructured data that does not form relationships between its fields. This type of database became popular in the late 2000s as web-based applications grew in both popularity and complexity.
  • Unlike other databases, the data warehouse was designed to draw vast amounts of information from multiple sources and then allow the information to be queried and analyzed. This database type was first introduced in the late 1980s and is used even today in large enterprises as a core component of their business intelligence strategy.
  • Another database type that takes an interesting approach is the distributed database. In contrast with a regular database that is stored on a single computer, distributed databases are stored on several independent computers at the same time. These machines can be located next to each other or could reside on different continents.
  • A graph database excels at representing data that is heavily interconnected. Each piece of information is presented as an entity and connections are drawn between various entities that are somehow related.
  • The next wave of database design is without a doubt the self-driving database. Self-driving databases leverage recent advancements in cloud computing and machine learning to create a new database system where each database automatically manages itself. A true self-driving database is able to figure out what types of optimizations to carry out and when to carry them out, and finally, the result of these optimizations is analyzed so the database can improve its decisions in the future. All of these tasks occur without any human intervention whatsoever. What is more, other vital tasks such as security, backups, and updates are carried out by the database itself.

 

What Is a Relational Database?

A relational database structures its data in a set of tables that are comprised of rows and columns. The rows are used to store information records while the columns describe the information that is kept in those records.

What makes relational databases unique is that they are indexed which makes searching for information easier and faster when compared to other database types. Moreover, relational databases allow relationships to be formed between different sets of data. Thanks to these relationships, you can make sure that each piece of information is stored only once in the database. This practice is called normalization.

The two tables in the example above contain data that is not normalized. That's because both tables store the individuals' names. Normalizing this database would mean setting up one of the tables to get the name data from the other table.
The two tables in the example above contain data that is not normalized. That’s because both tables store the individuals’ names. Normalizing this database would mean setting up one of the tables to get the name data from the other table.

The biggest advantage brought by normalization is that each fact is stored in a single location. So when the time comes to update this fact, you know that there is precisely one record that needs to be edited.

Speaking of database edits, every command that is sent to the database is written using the Structured Query Language (SQL). SQL can be used for all types of data manipulation, such as record creation, deletion, and alteration. In addition, SQL is also used to carry out database maintenance, such as database optimization, defragmentation, and structural repairs.

SQL is the main programming language used to interact with relational databases.
SQL is the main programming language used to interact with relational databases.

Having a standard query language such as SQL is a big advantage for relational databases, especially considering that there are multiple flavors and implementations that follow the relational database model. Some of the biggest companies in tech have their own relational databases that are widely used in the industry. Notable examples are Microsoft SQL Server, MySQL, IBM DB2, Sybase, and Oracle. While all of these implementations have their own unique strengths, they all fully support SQL as the means of communication between the end-user and the database.

 

How Is a Database Different From a Spreadsheet?

At this point, you may be seeing some parallels between relational databases and spreadsheets – both use rows and columns for data storage and both allow multiple tables to be created. So what makes databases different from spreadsheets?

In short, there are three main differences between a relational database and a spreadsheet: the way information is stored, the amount of information that can be stored, and the number of users who can access the stored information. We will examine each difference in greater detail below.

Perhaps the most notable difference between a spreadsheet and a relational database is that you are supposed to normalize the data you are entering into the database. In other words, each piece of information should be stored only once. In contrast, spreadsheets do not enforce such a limitation.

Databases differ from spreadsheets in the amount of information that they can store. While a spreadsheet can contain a good amount of data, databases are designed to hold hundreds of gigabytes of information, sometimes even more. In fact, you almost never visualize the entire set of information stored in a database. Instead, you query the database to show you only the information that is pertinent to your current task.

The last important difference between spreadsheets and databases is that spreadsheets are designed to be used by a single person or a very small group of people. In contrast, databases can be accessed by multiple users and programs at the same time. What is more, databases are designed to handle multiple simultaneous read/write requests.

 

What Is a Database Used For?

Many times a database starts out as a simple list in a text document or a table in a spreadsheet. However, as the amount of stored information increases, the list or table grows larger and more difficult to understand and to find the data you are looking for. What is more, you may start duplicating parts of the information that is already saved. In situations like these, it is a good idea to transfer your information into a proper database where the information can be properly organized and thoroughly searched and analyzed when needed.

Corporations and other large companies take full advantage of the search and analysis capabilities of databases. In fact, databases and data warehouses are core tools in any organization’s business intelligence strategy. It is common for large corporations to keep as much information as possible in a database. This information can include their customer list, business documents, financial data, statistics, scientific facts, and technical information. All of this historical data is then analyzed in detail in an effort to predict future business outlooks.

Last, but certainly not least, databases are also a vital component in most modern applications and websites. If the application you are using relies on a server back-end, then it most likely uses a database to store its information. Similarly, most modern websites are built using a content management system (CMS) like WordPress, Drupal, or Joomla, and almost all content management systems utilize a database to store your data, such as posts, pages, and comments, users, etc. As such, databases are essential tools in both software development as well as web hosting.

 

How Are Databases Used in Web Hosting?

Without a doubt, databases have played a crucial role in shaping the web as we know it today. Social networks have become an essential part of our lives and it is hard to imagine a blog post or a news story without a comments section where the readers can discuss the subject further. These features collectively comprise Web 2.0, a version of the Internet that goes beyond static web pages and allows site visitors to contribute content in the form of comments and posts, connect with friends via social networks, and use advanced web-based applications.

Every Web 2.0 website uses a database to store most text that you see on the screen. The stored information includes site pages and news stories, but also visitor-generated content like comments and reactions. And if we are talking about a social network, each post, status update, or check-in is also stored in a database.

The benefit of using a database to store most text-based information is that this stored data can be easily accessed and modified. This is especially important when you consider that Web 2.0 websites are meant to display dynamic pages. A dynamic page is a webpage that will show new information as it is added by the site owner or a site visitor.

To always show the latest information, the vast majority of Web 2.0 websites create their pages on-the-fly. This means that the moment a visitor requests a certain page for viewing, the server generates the page by combining information from the database with styling from the active theme. The process takes a few seconds at most and the site visitor is presented with a page that was just created specifically for them using the latest available information from the database. This is the way most content management systems work, including popular ones like WordPress, Drupal, Joomla, Magento, and others.

Most content management systems dynamically generate each page the moment it is requested by a site visitor.
Most content management systems dynamically generate each page the moment it is requested by a site visitor.

As you can see from the illustration above, every time you open a website built using a CMS like WordPress or Drupal, an entire page gets generated specifically for you using the latest information available in the database and combining this page content with the styling and additional functionality that may be set up. Needless to say, this whole process must happen quickly as long loading times lead to high bounce rates and a bad overall experience.

To provide the best performance possible, here at AwardSpace we separate our servers into distinct clusters. Each server cluster is responsible for a single type of operation. For example, we have a cluster of dedicated database servers. These servers’ only task is to make sure that all databases run as quickly and efficiently as possible. And since these servers perform only one task, we have gone out of our way to optimize them for peak performance.

Every one of our database servers runs on SSD storage to make read/write operations blazingly fast. Moreover, each server utilizes either a RAID array or Ceph storage for protection against data loss. Lastly, all servers are equipped with enough RAM to remain stable and responsive even when they are under a heavy load. So, if you are looking for rock-solid hosting that supports popular database types like MySQL and PostgreSQL, look no further than our premium shared hosting and semi-dedicated servers. If you are just starting out or you are on a budget, you can also try our free hosting package as it will also allow you to take advantage of our clustered server platform and popular hosting technologies like MySQL and PHP completely free of charge.

 

What Is SQL?

One term that you will come across when learning about databases is SQL. SQL stands for Structured Query Language and is the default means of interacting with a relational database. The great thing about SQL being the industry standard is that once you learn to use SQL, you will automatically know how to interact with many popular relational databases like MySQL, PostgreSQL, Oracle, Microsoft SQL Server, Sybase, and others.

You use SQL to send queries to the database server. Once each query is received, the database server processes it and sends back a response. Through these queries, you can retrieve and manipulate data. Below, we will provide a simple SQL example that will demonstrate how to write an SQL query and what you can expect as the result.

In our example, we will use a database that contains a single table named Clients that has a few rows and columns. You can see this table below:

Our example database contains just three columns and a handful of rows.
Our example database contains just three columns and a handful of rows.

In our first SQL example, we will search for any records that contain the name John Doe and display them. The SQL query for such an operation would look like this:

SELECT * FROM Clients
WHERE Name = "John Doe"

And below you can see the result returned by the database server:

The server returns all records pertaining to John Doe.
The server returns all records pertaining to “John Doe”.

Using SQL you can bring up more than a single record. In this next SQL example, we will bring up all records where the person’s balance is over $900:

SELECT * FROM Clients
WHERE Balance > 900

Below is the result that we see returned from the database server:

The database is able to return multiple records at the same time.
The database is able to return multiple records at the same time.

As our final example, we will go ahead and alter one of the records. In this case, we will rename Jane Doe to July Dean. Jane Doe has an ID of 2, so that’s how we will specify which record needs to be updated:

UPDATE `Clients`
SET 'Name' = "July Dean"
WHERE ID = 2

The database returns that one record has been updated successfully:

Update operations only tell us whether they have been successful. They do not show us what has been updated.
Update operations only tell us whether they have been successful. They do not show us what has been updated.

We can then issue one last SQL query to make sure that the record with an ID of 2 has indeed been updated:

SELECT * FROM Clients
WHERE ID = 2

And sure enough, the database now shows us the record of July Dean instead of Jane Doe:

Displaying all information about the record with ID 2.
Displaying all information about the record with ID 2.

The above SQL examples only scratch the surface of what queries can do. Complex queries are able to perform very calculated edits or show you data that is gathered from multiple tables according to specific criteria. What is more, SQL queries are used to maintain and optimize the database for better performance.

To interact with your database through SQL queries, you can sign up for one of our premium shared hosting packages or even our free hosting plan. If you decide to get any of these plans, you will be using our shared hosting platform which supports around 99% of all SQL capabilities. If you are interested in having full control, on the other hand, look no further than one of our virtual private server plans.

 

What Is MySQL?

MySQL is one of the most popular open-source database management systems in the world. It is primarily used as a data storage medium in web-based applications and websites thanks to its ability to quickly process large numbers of queries. Moreover, MySQL is fully compatible with SQL, which is the industry standard when it comes to interacting with a relational database. And on top of all that, a database server based on MySQL can be deployed on all major operating systems, making it a good choice regardless of your platform preference.

Here at AwardSpace, we believe that MySQL is a core web technology that every website owner should be able to benefit from. That is why we have built support for MySQL across our entire range of hosting plans. Regardless of whether you choose to use our free hosting platform, one of our paid shared plans, a semi-dedicated server, or even a virtual private server, you will have access to MySQL.

But we didn’t stop there. If you opt for one of our premium hosting packages, you will be able to create and use multiple MySQL databases at the same time. This is great if you wish to run several independent websites from your hosting account. And on top of all that, we have seamlessly integrated phpMyAdmin into all of our hosting plans. phpMyAdmin is a web-based utility that makes MySQL administration a breeze.

To learn even more about MySQL, you can check our dedicated article on what is MySQL and how it is used to power a website. And if you are curious to learn more about phpMyAdmin, you can read our beginner’s guide to phpMyAdmin where we cover all of the basics of this handy utility.

 

What Is a Database Management System?

A database management system, or DBMS for short, is a sophisticated software application that acts as the middleman between the raw database files where information is kept and the person or program that is requesting access to the stored information. When you send a query to your database, the database management system receives this query, carries it out, and returns the requested results.

The database management system has full control over the database files and the data stored therein. As such, a DBMS will always be able to access the stored information, alter it, add new data, and remove old records that are no longer needed. These read/write operations constitute a database management system’s most basic and essential functionality.

That said, most database management systems go beyond these basic operations. The more advanced a DBMS is, the higher number of additional features it will support. Below, we will list the extra features that may be supported by a DBMS. Note, however, that some features depend on the type of database that is in use, i.e. whether it is a relational database, a NoSQL database, or some other type.

  • A DBMS should be able to optimize the database by removing redundancies, defragmenting the database files, and making sure that the database is as performant as possible.
  • Another essential feature is the ability to back up the database files. These backups would ideally occur periodically in an automated manner with no human interaction.
  • One very powerful feature is the support for transactions. A transaction is a predetermined amount of work that is treated as a single operation. If the transaction fails for any reason, any partial work that may have already been performed is rolled back, thus preserving the original data.
  • Right there with transactions is the ability to run multiple database operations at the same time. This feature is often referred to as concurrency.
  • An essential feature for every commercial database is access control. In other words, the database management system should ask every user to authenticate themselves and should only present the information that the user is allowed to view or modify.
  • To run a bug-free database, a DBMS should be able to place constraints on the data that is stored in each field. When constraints are enabled, each field will only accept input data of a certain type. For example, you will not be able to enter a word into a field that expects a number.
  • The DBMS should be able to form relationships between varying pieces of data. This is an essential feature for relational database management systems.
  • An advanced feature that some DBMS packages support is the ability to scale out the software. In other words, the DBMS may allow you to run a single database from multiple computers at the same time, thus increasing your available processing power.
  • Lastly, a database management system should be able to access remote locations on the network or the web. This can be useful for both backup purposes as well as the ability to fetch additional information to store in the database.

As you can see, the database management system is an essential part of using a database since it facilitates all operations. Due to this close relationship, the database storage and the DBMS are often collectively called simply a database.

It is normal for the database management system and the database storage to act as a single coherent unit. That is why they are collectively referred to as a database.
It is normal for the database management system and the database storage to act as a single coherent unit. That is why they are collectively referred to as a “database”.

If you decide to open a hosting account with AwardSpace, you will be able to use some of the most popular database management systems out there. Getting a free hosting account will allow you to use MySQL while buying a paid hosting package will allow you to use both MySQL and PostgreSQL. And if your website or project requires a different type of database, you can always opt to get a virtual private server where you can run any type of databases, such as Oracle, dBASE, DB2, and others.

 

Conclusion

Without a doubt, databases have become an essential building block on the web. While not as flashy as other web technologies, databases ensure that the most important thing to us – our information – is kept in a safe and reliable manner. It also enabled the Web 2.0 revolution which has directly led to the creation of your favorite social networks, video and image sharing websites, and advanced web-based applications.

Was this post helpful?

i

Relevant tags:

Connect

Latest posts:

How to Install a MediaWiki Skin

In MediaWiki, skins determine the visual appearance of your wiki website. Skins define how content is presented to users and include such settings for the overall website layout, typography, color scheme, and more. By default, when you install MediaWiki, the platform...

How to Create a Page in MediaWiki

Creating pages in MediaWiki is а core feature that allows you to add content to your MediaWiki website. Whether you are adding details for a project, contributing to a knowledge base, or anything else, learning how to create a page in MediaWiki is crucial for your...

How to Install MediaWiki Extensions

Now that you have installed MediaWiki and learned how to log in to the CMS, it is time to extend MediaWiki's functionality via extensions. MediaWiki extensions are sets of files that add various types of functionality to your MediaWiki website. You can use extensions...

How to Log In to MediaWiki

After you install MediaWiki, it is time to log in to the platform, so you can start working on your new MediaWiki website. To log in, you must open the MediaWiki login page and enter your credentials. Doing so will open the platform’s admin panel. In the following...

How to Install MediaWiki

You can quickly install MediaWiki on any of the AwardSpace web hosting plans. This includes our free web hosting, shared hosting, as well as advanced services such as semi-dedicated hosting and VPS hosting. You can install MediaWiki in a matter of minutes, whichever...



Create a website for free!


Free forever

Our Support Team is Here to Help

 

If you need any questions answered, don't hesitate and contact us. Click the button below and follow the instructions. You can expect an answer within an hour.

 

Contact AwardSpace

 

iNewest knowledge base articles

How to Install a MediaWiki Skin

In MediaWiki, skins determine the visual appearance of your wiki website. Skins define how content is presented to users and include such settings for the overall website layout, typography, color scheme, and more. By default, when you install MediaWiki, the platform...

How to Create a Page in MediaWiki

Creating pages in MediaWiki is а core feature that allows you to add content to your MediaWiki website. Whether you are adding details for a project, contributing to a knowledge base, or anything else, learning how to create a page in MediaWiki is crucial for your...

How to Install MediaWiki Extensions

Now that you have installed MediaWiki and learned how to log in to the CMS, it is time to extend MediaWiki's functionality via extensions. MediaWiki extensions are sets of files that add various types of functionality to your MediaWiki website. You can use extensions...

How to Log In to MediaWiki

After you install MediaWiki, it is time to log in to the platform, so you can start working on your new MediaWiki website. To log in, you must open the MediaWiki login page and enter your credentials. Doing so will open the platform’s admin panel. In the following...

How to Install MediaWiki

You can quickly install MediaWiki on any of the AwardSpace web hosting plans. This includes our free web hosting, shared hosting, as well as advanced services such as semi-dedicated hosting and VPS hosting. You can install MediaWiki in a matter of minutes, whichever...

How to Install an Elgg Theme

After you have installed Elgg core and logged in to the admin dashboard, you can search for themes that can help you customize your new website. Elgg themes are a set of files that help you customize the appearance of your website. Via themes, you can modify website...

Even more web tutorials

Check out our web hosting knowledge base and the WordPress tutorials to learn more, and be better prepared for your website creation and maintenance journey.