Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Non-relational Databases

Author: Sophia

what's covered
In this tutorial, you will explore the similarities and differences between relational databases and non-relational databases like NoSQL. Specifically, this lesson will cover:
  1. Relational Database Characteristics
  2. Non-relational Databases
    1. When to use a Non-relational Database
    2. Main Types of Non-relational Databases
  3. Relational Database Contrast

1. Relational Database Characteristics

This course focuses on relational databases, where data is organized into tables in a structured manner. There are relationships and dependencies between the tables. You use SQL to query the data in a very specific format through the tables, columns, and rows. Each table is made up of one topic or object. The columns represent the data points that need to be stored. The rows represent the records of the data points. This type of relational database structure makes it easy to sort, filter, and compute various calculations with expressive query languages.

2. Non-relational Databases

A non-relational database has more of a document-oriented structure. All of the data about a particular object is stored within the document. A non-relational database has a less structured format. It offers high scalability, flexibility with data models, and adaptability to the needs of the organization.

2a. When to use a Non-relational Database If you're working with data that isn’t clearly defined and organized, and you can't establish defined tables and relationships in the data set, then you might want to consider a non-relational database. The information that is gathered in a non-relational database isn’t structured to be segmented into tables and defined relationships.

EXAMPLE

A messaging application like Facebook Messenger is a good example of the need for a non-relational database. With so much unstructured information that gets included within a message, the messages have to be stored in a non-relational database for efficiency.

2b. Main Types of Non-relational Databases There are four main types of non-relational databases:

  1. document-oriented,
  2. key-value stores,
  3. wide-column stores, and
  4. graph stores.
Document-oriented databases focus on pairing a key with a complex data structure. It is similar to storing information in a Word document and just adding more information into that document. If you need to find information, you have to search through that document. Key-value stores are databases that use different keys, where each key is only associated with one value. An example is a dictionary where the word is the key, and the value is the definition of the word. This is one of the simplest types of non-relational databases. Wide-column stores use tables, rows and columns similar to a relational database, but the names and format of the columns can vary from row to row in the same table. Graph stores use graph structures to link data through edges, nodes, and properties. It can be one of the more complex types of non-relational databases.

terms to know
Document-oriented database
a non-relational database that pairs a key with a complex data structure.
Key-value store
a simple non-relational database that pairs each key with a single value.
Wide-column store
a non-relational database that allows the names and format of columns of its tables to vary from row to row.
Graph store
a non-relational database that links data through edges, nodes, and properties.

3. Relational Database Contrast

One of the most common examples of a non-relational database is a NoSQL database, which uses an approach to database design that enables the storage and querying of data outside the traditional structures found in relational databases.

NoSQL databases have a flexible data model which makes it easy to store and combine data of any structure and allow us to dynamically modify the schema without any down time. In contrast, making changes to the data model in a relational database can take time and planning to implement. Since the NoSQL databases are built on performance and scalability, they are set up to be able to quickly scale out, offering unlimited growth in comparison to relational databases. They are also designed for highly available systems so that they can provide a consistent, high-quality experience for all users around the world.

Relational databases, on the other hand, use the expressive query languages to access and modify data. They also use indexes within the database to provide efficient access to data rather than maintained in the application code for non-relational databases. With the relational models, there’s much stronger consistency through the primary and foreign keys such that applications should be able to read what has been written to the database immediately.

term to know

NoSQL database
an approach to database design that enables the storage and querying of data outside the traditional structures found in relational databases.

summary
In this lesson, you learned that there are different uses for non-relational and relational databases depending on the organizational need. Relational databases make use of structured tables of data and a formal query language to offer consistency and efficiency. Non-relational databases like NoSQL have document-oriented data storage that offers better flexibility and scalability than relational databases normally can achieve.

Next time, you will be introduced to the differences between a data warehouse and a transactional database.

Source: Authored by Vincent Tran

Terms to Know
Document-oriented database

a non-relational database that pairs a key with a complex data structure.

Graph store

a non-relational database that links data through edges, nodes, and properties.

Key-value store

a simple non-relational database that pairs each key with a single value.

NoSQL database

an approach to database design that enables the storage and querying of data outside the traditional structures found in relational databases.

Wide-column store

a non-relational database that allows the names and format of columns of its tables to vary from row to row.