Module 8.2- Database Concepts & Structures Flashcards

(11 cards)

1
Q

Types of Databases

A
  • databases can be categorised into two broad groups: relational and non-relational databases
  • each type is designed to handle specific kinds of data and relationships between data points
  • understanding the differences between these databases helps determine which type is best suited for different use cases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Relational Databases (SQL)

A
  • most common type in business environments
  • store data in tables with rows and columns, similar to a spreadsheet, but with much more structure and rigor

Key Features:
- they organise data into relationships using keys; this is where the name relational comes from

  • Tables- data is stored in tables, where each row represents a record and each column represents a field
  • Relationships- tables are linked together by primary keys (unique identifiers for each record) and foreign keys (used to connect related data across tables)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Examples of Relational Databases

A
  • Microsoft SQL
  • MySQL
  • PostgreSQL
  • Oracle
  • e.g. in an e-commerce system, you might have one table for customers and another for orders- these tables are linked by a customer ID that appears as a primary key in the customer table and as a foreign key in the orders table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Non-Relational Databases (NoSQL)

A
  • these databases don’t use predefined tables
  • instead, they offer flexible data models, making them ideal for large amounts of unstructured or semi-structured data, such as documents or social
  • Flexible Schema- non-relational databases can store different kinds of data without requiring a fixed table structure
  • Scalability- these databases are often designed to scale horizontally, meaning they can handle large volumes of data by spreading it across multiple servers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Examples of Non-Relational Databases

A
  • MongoDB
  • Cassandra
  • Amazon
  • DynamoDB
  • a non-relational database like MongoDB stores data as JSON-like documents, ideal for applications with evolving or variable data structures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Key-Value Databases

A
  • specific type of non-relational database
  • this type of database stores data as pairs of keys and values
  • Simple Structure- each entry in a key-value database is a pair, with a unique key used to retrieve a specific value
  • Speed and Efficiency- since these databases are optimised for fast lookups, they are often used in scenarios where performance is critical, like caching or session management
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Examples of Key-Value Databases

A
  • Redis
  • Amazon
  • DynamoDB
  • e.g. in an online store, a key-value database could be used to store and quickly retrieve the price of a product based on its product ID
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Document Databases

A
  • another important type of non-relational database
  • these databases store data in the form of documents, often using JSON or XML formats
  • great for handling unstructured or semi-structured data, where the data fields can vary from one document to another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What makes Document Databases stand out?

A
  • Schema Flexibility- documents can vary in structure, making it easy to store diverse types of data without needing predefined schemas
  • Hierarchical Data Representation- documents can store nested data, allowing you to capture complex relationships within a single document
  • MongoDB
  • Couchbase
  • e.g. a document database might store a user profile, including their name, email, address, and even purchase history, all within a single document; this flexibility makes it ideal for applications like content management systems or product catalogs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Relational Database Structure

A
  • Tables- as mentioned earlier, data is stored in tables where each row is a record, and each column is a field that describes the data
  • Primary and Foreign Keys- these are used to link tables together, ensuring that data is properly related and organised
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Non-Relational Database Structure

A
  • Collections and Documents- in document databases, data is stored in collections, which are made up of documents
  • each document can have a unique structure, allowing for greater flexibility in how data is organised
  • Key-Value Pairs- in key-value databases, data is stored as pairs, where a key is associated with a specific value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly