Businesses use relational and non-relational databases to store, retrieve, and analyse data. Explore how they differ to gain a better understanding of their uses.
![[Featured Image] A person works on a database on a laptop computer.](https://d3njjcbhbojbot.cloudfront.net/api/utilities/v1/imageproxy/https://images.ctfassets.net/wp1lcwdav1p1/3kMunbCTQEAZftqEMttzez/66b97e09ff31c660c477939be387983f/iStock-853931168__1_.jpg?w=1500&h=680&q=60&fit=fill&f=faces&fm=jpg&fl=progressive&auto=format%2Ccompress&dpr=1&w=1000)
Whether you’re an aspiring data scientist or are simply in a job that requires you to use data on a daily basis, you’ve probably encountered the terms relational and non-relational databases. Although both types of databases exhibit clear differences, you may still find yourself intrigued by their specifics and applications, prompting a desire to understand them further.
Read on to delve deeper into relational and non-relational databases, view lists of common databases used today, and gain insights into selecting the optimal database solution for your needs.
A relational database stores data in tables composed of rows and columns.
Relational databases contain data within a table, which links to data contained within other tables through unique identifying keys. Specifically, relationships between tables form when a primary key, which uniquely identifies a row in one table, connects with a foreign key identifying a row of data in another table.
In effect, relational databases store structured or well-defined data like names, dates, and quantities that can be easily standardised within a table. SQL, or Structured Query Language, is the most common programming language for interfacing with relational databases within relational database management systems (RDMS).
Relational databases are easy to use for storing, retrieving, and manipulating well-defined, structured data. Some of the well-known relational databases include:
MySQL
IBM Db2
Snowflake
Amazon Aurora
PostgreSQL
Microsoft SQL Server
A non-relational database is a type of database that doesn’t store data in tables but instead in whatever format is best for the data. In effect, non-relational databases contain unstructured or loosely defined data like email messages, videos, images, and business documents that aren’t easily standardised. Users can also employ these databases to store a mix of structured and unstructured data.
Non-relational databases are said to be NoSQL, meaning they don’t use Structured Query Language, even though many NoSQL databases support SQL queries.
Unlike relational databases, which only support a tabular design, you can choose from many different types of non-relational databases. Some of the standard approaches to organising non-relational databases include:
Key-value stores: In a key-value store, data receives a unique identifier, which allows users to retrieve and sort it. The system consists of "keys”, or unique identifiers like a string of numbers, and the "values" with which they're associated, which can be either data itself or simply its location within the database.
Column-family data stores: This type of non-relational database organises data into a "keyspace" containing multiple families of different columns. The column families, in turn, include rows that each also contain columns containing data. Users can access and identify the data using keys.
Graph databases: Graph databases store data in nodes and structure them based on their relationships to one another, allowing for a much more flexible schema than tabular designs facilitate.
Document databases: Document databases store data within documents, typically containing one object and all its associated metadata.
Some of the most common non-relational databases include:
MongoDB
IBM Cloundant
Amazon DynamoDB
Apache Cassandra
Structured query language (SQL) is the language used in relational databases to store structured data. NoSQL stands for “not only structured query language” and is used for non-relational databases that store structured and unstructured data.
In short, SQL databases are relational databases, and NoSQL databases are non-relational databases.
Relational databases are optimal for managing data with predictable size, structure, and usage frequency. Conversely, non-relational models prove more effective for storing data adaptable in form or dimension or subject to future changes over time.
If you want to learn more, the Learn SQL Basics for Data Science Specialisation from UC Davis teaches beginners with no previous coding experience the basics of SQL, data wrangling, AB testing, and more.
编辑团队
Coursera 的编辑团队由经验丰富的专业编辑、作者和事实核查人员组成。我们的文章都经过深入研究和全面审核,以确保为任何主题提供值得信赖的信息和建议。我们深知,在您的教育或职业生涯中迈出下一步时可能...
此内容仅供参考。建议学生多做研究,确保所追求的课程和其他证书符合他们的个人、专业和财务目标。