Relational vs. Non-Relational Databases

IBM Technology
29 Jun 202208:12

Summary

TLDRThis script contrasts relational and non-relational databases, explaining the structured approach of relational databases using tables and relationships, and the flexibility of non-relational databases with their various types like key-value, column store, graph, and document store. It highlights the benefits of relational databases in ensuring data consistency, security, and ease of backup, while non-relational databases offer scalability, flexibility, and cost-effectiveness, catering to different use cases and client needs.

Takeaways

  • 🗃️ Relational databases are structured and store data in interconnected tables, creating a relational model that ensures data consistency and security.
  • 🔑 Primary keys in relational databases uniquely identify each record, while foreign keys link related data across different tables.
  • 🔒 Relational databases offer benefits such as data consistency, security through encryption and access control, and ease of backup and recovery.
  • 📊 Non-relational databases provide a flexible alternative to relational databases, with different types like key-value, column store, graph, and document store databases.
  • 🔄 Non-relational databases excel in scalability, allowing horizontal scaling without the need for additional resources, and offer cost-effective storage solutions.
  • 🛠️ The choice between relational and non-relational databases depends on the specific needs of the application, such as traditional workloads versus new applications requiring flexibility.
  • 📈 Relational databases are suitable for structured data storage with clear relationships, like in point of sale systems or record tracking.
  • 🌐 Non-relational databases are advantageous for handling large volumes of unstructured or semi-structured data, offering flexibility in data storage and retrieval.
  • 🔑 In relational databases, each table focuses on a single entity, ensuring that the information is organized and easily accessible.
  • 🔍 Non-relational databases offer various storage options that can be optimized for specific use cases, such as performance optimization in column stores or the graphical representation of connections in graph databases.
  • 💻 Both relational and non-relational databases have their place in modern data management, allowing clients to choose the best fit for their data storage and operationalization needs.

Q & A

  • What are the two main types of databases discussed in the script?

    -The script discusses relational databases and non-relational databases.

  • How is data structured in a relational database?

    -In a relational database, data is structured in tables that are connected to each other, forming relationships.

  • What is the purpose of a primary key in a relational database?

    -A primary key in a relational database uniquely identifies each record within a table.

  • Can you explain the concept of a foreign key in the context of relational databases?

    -A foreign key is a field in a table that refers to the primary key of another table, establishing a link between the two tables.

  • What are the benefits of using a relational database?

    -The benefits of using a relational database include data consistency, ease of management, enhanced security, and ease of backup and recovery.

  • What are the different types of non-relational databases mentioned in the script?

    -The script mentions key-value databases, column store databases, graph databases, and document store databases as types of non-relational databases.

  • Why might a customer choose a non-relational database over a relational one?

    -Customers might choose a non-relational database for its added flexibility, high scalability, and cost effectiveness.

  • How does a key-value database store data?

    -A key-value database stores data as pairs of keys and values, where each key is unique and associated with a specific value.

  • What is a document store database and how is it different from a relational database?

    -A document store database stores data in the form of documents within collections. Unlike relational databases, it does not require a fixed schema and can store varied data types.

  • What are some use cases for relational databases?

    -Relational databases are suitable for traditional workloads such as point of sale systems and tracking large amounts of structured records.

  • What are some scenarios where non-relational databases might be preferred?

    -Non-relational databases might be preferred when developing new applications that require added flexibility and can benefit from horizontal scaling.

Outlines

00:00

💾 Understanding Relational Databases

This paragraph introduces the concept of relational databases, emphasizing their structured approach to data storage. It explains that data is organized into interconnected tables, each centered around a single entity and linked through primary and foreign keys. The paragraph illustrates the concept with the example of a customer and an order table, highlighting how these tables relate to each other and the importance of unique identifiers like customer ID and order ID. It also discusses the benefits of relational databases, such as ensuring data consistency, enhancing security, and facilitating easy backup and recovery processes.

05:01

🌐 Exploring Non-Relational Databases

The second paragraph contrasts relational databases with non-relational ones, which offer a more flexible and varied approach to data storage. It outlines different types of non-relational databases, including key-value, column store, graph, and document store databases, and explains their unique characteristics. The paragraph emphasizes the flexibility, scalability, and cost-effectiveness of non-relational databases, which can be horizontally scaled without the need for additional resources. It also discusses the different use cases for both relational and non-relational databases, suggesting that the choice between them depends on the specific needs and operational requirements of the company.

Mindmap

Keywords

💡Relational databases

Relational databases are structured systems for data storage that organize information into tables with defined relationships. They are central to the video's theme, as they represent a traditional method for organizing data. In the script, relational databases are described as having tables that connect to each other, forming relationships, which is exemplified by the customer and order tables that link via a customer ID.

💡Non-relational databases

Non-relational databases, also known as NoSQL databases, offer a flexible, schema-less approach to data storage, contrasting with the structured nature of relational databases. They are highlighted in the video as an alternative for storing data, especially when flexibility and scalability are required. The script mentions different types of non-relational databases, such as key-value, column store, graph, and document store databases, each serving different data retrieval and storage needs.

💡Data consistency

Data consistency refers to the property of a database ensuring that all data is accurate and up-to-date across the system. It is a key benefit of relational databases discussed in the video, as it allows for reliable data management. The script illustrates this by stating that the structured nature of relational databases helps maintain consistency, which is crucial for applications like hospital record-keeping where accuracy is paramount.

💡Primary key

A primary key is a unique identifier for each record in a database table, ensuring that each entry can be distinctly recognized. In the context of the video, the primary key is used to uniquely identify customers and orders in their respective tables, with the customer ID serving as an example of a primary key that helps in establishing relationships between the customer and order tables.

💡Foreign key

A foreign key is a field in a database table that points to the primary key of another table, creating a link between the two. The video script explains how the customer ID, which is a primary key in the customer table, becomes a foreign key in the order table, thereby connecting the data of who placed each order.

💡Scalability

Scalability is the ability of a system to handle a growing amount of work, or its potential to be enlarged to accommodate that growth. The video emphasizes the scalability of non-relational databases, noting that they can be scaled out horizontally without the need for additional resources, making them cost-effective and flexible for handling large volumes of data.

💡Key-value databases

Key-value databases store data as a collection of keys, with each key mapped to a single value. This simple data model allows for quick data retrieval and is one of the types of non-relational databases mentioned in the video. The script describes how these databases work by using the analogy of retrieving data through unique keys.

💡Column store databases

Column store databases are designed to store and manage data in separate columns, which can optimize query performance, especially for analytical processing. The video script positions column store databases as a type of non-relational database that is particularly useful for performance optimization.

💡Graph databases

Graph databases represent data as nodes, edges, and properties to depict the relationships between different entities. The video script introduces graph databases as a type of non-relational database that visually maps connections between data points, making them suitable for complex relationship analysis.

💡Document store databases

Document store databases, also known as document-oriented databases, store data in the form of documents, which can be JSON, XML, or similar formats. The video script describes these databases as a collection of documents that allow for flexible and schema-free data storage, making them a popular choice for modern applications that require storing diverse data types.

💡Data operationalization

Data operationalization is the process of leveraging data to drive business operations and decision-making. The video script discusses the importance of data storage options, such as relational and non-relational databases, in enabling companies to effectively operationalize the vast amounts of data they collect.

Highlights

Relational databases are structured ways to store data with tables connected to each other.

A table in a relational database revolves around a single entity, such as a customer.

Primary keys, like customer ID, uniquely identify each record in a table.

Relational databases connect tables through relationships, such as between customers and their orders.

Foreign keys in one table link to primary keys in another, creating a relational connection.

Data consistency is ensured in relational databases, making data management straightforward.

Relational databases enhance security by allowing encryption and access control for sensitive information.

Backup and recovery are simplified due to the consistent state of data in relational databases.

Non-relational databases offer a break from structured approaches with more flexibility.

Key-value databases store data as pairs of keys and unique values for quick retrieval.

Column store databases optimize performance by storing data in separate columns.

Graph databases visually represent how different entities in a database are connected.

Document store databases group documents in collections for related information retrieval.

Non-relational databases provide high scalability, allowing horizontal scaling without additional resources.

Cost effectiveness is a key advantage of non-relational databases due to their scalability.

Different use cases determine whether a relational or non-relational database is more suitable.

Relational databases are ideal for traditional workloads like point of sale systems.

Non-relational databases offer flexibility for new applications, making them a popular choice.

Clients have options to choose how to store and operationalize their data based on their needs.

Transcripts

play00:00

Hi, everyone.

play00:01

Today I'm going to be talking to you about relational versus non-relational databases.

play00:04

These are two different ways in which clients store the data that they have and operationalize it.

play00:09

And we know there is so much data that is coming into every single company today

play00:12

that it's important that customers have options for how they want to store that data.

play00:17

So, let's start with relational databases.

play00:20

Relational databases are a very structured way to store your data.

play00:25

But to really understand a relational database, first we need to understand a table.

play00:30

So all the data is stored in tables and those tables are connected to each other.

play00:34

That's why we have the name "relational" and we see a relation in the name

play00:38

because all these tables connect to each other.

play00:40

They all have relations with each other.

play00:42

So let's start with one table.

play00:45

We have our customer.

play00:48

So each table revolves around a single entity.

play00:52

And with our customer, there is a lot of different information that we would want to know about them, right?

play00:56

We'd want to know what their first name is,

play01:01

their last name,

play01:05

maybe their date of birth, their email,

play01:09

and etcetera, etcetera, whatever other information would be relevant to know about the customer.

play01:14

But we might also have customers that have the same first name or the same last name,

play01:18

and we need a way to uniquely identify each customer.

play01:21

So that's why we have our primary key, which is our customer ID.

play01:26

And this is a unique identifier for each record in this table.

play01:30

But like I said, with relational databases, we want to view each table as it connects to other tables.

play01:35

So let's think about what a customer does.

play01:37

A customer places an order, right?

play01:39

So an order is actually a separate entity that would connect to our customer table.

play01:44

So let's draw out our order table.

play01:48

And what would we want to know about an order?

play01:50

We'd want to know maybe what time it was placed,

play01:53

what items are in it, and whatever else you think is relevant to know here.

play01:59

But again, like with the customer ID, we need a unique way to identify each order.

play02:03

So we have another primary key here called an order ID.

play02:08

And if we look at each of these tables and we look at the data in them, we can really see how they connect to each other.

play02:15

So let's take a customer table, for example.

play02:19

We know we have all these different pieces of information that are relevant to know about the customer.

play02:24

So I'm going to start with the customer ID.

play02:28

And then we have their first name, last name, etc..

play02:36

So like we said, each customer ID is unique.

play02:39

There's only one for each record in the database.

play02:42

So we have our first customer, let's call him John Doe.

play02:48

Our second customer, let's say, is named Jane Smith.

play02:54

And third customer.

play02:57

We can just continue populating information about every single customer that we have.

play03:03

And then with our order table, we start with our order ID,

play03:11

and we have other information that we want to know, right?

play03:14

Time, items, etc..

play03:17

But what we also need to know is which customer placed what order, right?

play03:21

So, in order to do that, we actually connect the customer ID to the order table.

play03:25

So we take this information and we move it over here.

play03:29

So in the customer table, this is the primary key.

play03:31

But when we move it over, this becomes the foreign key.

play03:34

So now we can add in our customer ID here.

play03:39

And we have our first order.

play03:40

It's placed at this time.

play03:42

Second order.

play03:43

Third order.

play03:45

And looking at our customer ID, let's say that this is 1.

play03:49

And our second one is 2, our third one is also 2.

play03:54

And now we can see, through connecting these two databases,

play03:57

that customer John Doe made the first order.

play04:00

We see what time, what items.

play04:02

He also made the second order, and Jane Smith made the third order.

play04:06

So as we can see with relational databases, this is a very structured way to view the information that's coming into a company.

play04:14

But with that, there's a lot of benefits that come in.

play04:16

So one of them is that the structure really ensures data consistency.

play04:22

And you can see that all the data that we have over here is very consistent, right?

play04:27

We can see that it's easy to manage that data and easy to get an overview of what is in your database.

play04:34

This also helps with security.

play04:37

So, let's say that you are in hospital and you have a lot of patients.

play04:40

You have information about their medical history, what medications are taking.

play04:44

That is all protected information.

play04:46

So through using a relational database, you can encrypt certain tables,

play04:49

you can hide information,

play04:51

and you can make sure the right people have access to the right data.

play04:54

And then finally, we have ease of backup and recovery.

play05:00

So, because this data is very consistent and at all times it remains consistent,

play05:05

it's easy to save the database at any point and easily recover from what you recently had.

play05:10

So this gives us an idea of what a relational database looks like.

play05:14

Now on the other hand, we have non-relational databases.

play05:17

So this is a break from the very structured approach of a relational database.

play05:22

There are a few different types of non-relational databases.

play05:25

First, we have key value databases.

play05:30

And this shows data as a key and a value, right?

play05:33

We have one key that ties to one unique value.

play05:37

Another key that ties to another unique value.

play05:40

And you can retrieve these values through plugging in the keys and getting that information back.

play05:45

We also have column store databases.

play05:50

And this stores data in separate columns and is optimized for performance.

play05:58

And then we have graph databases.

play06:01

So this shows different entities in the database and how they connect to each other in a graphical way.

play06:09

And finally, we have our document store databases.

play06:17

So this has data and documents, and a group of documents is called a collection,

play06:21

and you can essentially retrieve the information as it relates to a single collection.

play06:26

So you see that there are a lot more options here with the non-relational databases.

play06:30

And that's really why customers might choose a non-relational option as opposed to a relational one.

play06:35

There is added flexibility in going with a non-relational database.

play06:41

So that's really one of the key differentiators and why customers choose non-relational over relational.

play06:47

And it also has high scalability.

play06:52

It's easy to scale non-relational databases out horizontally

play06:56

and this means that they can essentially scale out without adding more resources.

play07:03

And finally, cost effectiveness.

play07:11

And this ties back into the scalability, right, because you're not adding more resources, but you're able to scale out and add more data in.

play07:18

So we see that we have a lot of different ways in which customers can store their information

play07:22

and make sense of all the data that's coming into the company.

play07:25

There are different ways that people can leverage both of these databases.

play07:29

There are different use cases.

play07:30

People might use relational databases for more traditional workloads.

play07:34

If you have a point of sale system, if you're tracking a large amount of records and you want to do so in a very structured way,

play07:40

then relational databases might be what you go for, for that.

play07:43

But if you're developing a new application, you want added flexibility,

play07:47

then customers might defer to a non-relational database.

play07:50

But either way, our clients have options as to how they want to store their data and how they want to best operationalize it.

play07:56

Thank you.

play07:59

Thank you.

play07:59

If you like this video and want to see more like it, please like and subscribe.

play08:03

If you have any questions, please drop them in the comments below.

Rate This

5.0 / 5 (0 votes)

Связанные теги
Relational DatabasesNon-RelationalData StorageCustomer DataOrder ManagementData ConsistencySecurityBackupScalabilityFlexibilityDatabase Options
Вам нужно краткое изложение на английском?