Introduction to NoSQL Databases Flashcards

Course 1/3 (46 cards)

1
Q

What does the acronym “NoSQL” stand for, and what is its core meaning in the context of database types?

A

NoSQL stands for “Not Only SQL”. It refers to a family of non-relational databases that offer alternative ways of storing and querying data compared to traditional relational database management systems (RDBMS).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List four general characteristics or benefits of using NoSQL databases compared to traditional relational databases.

A
  • Flexible data models (no fixed schemas)
  • Horizontal scalability
  • High availability and fault tolerance
  • Often lower cost compared to traditional RDBMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the primary architectural concept behind Key-Value NoSQL databases and provide a common use case.

A

Key-Value databases store data as key-value pairs, where the value is often an opaque blob. They are architecturally simple and excellent for quick CRUD operations where data isn’t highly interconnected, such as storing user session information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do Document-based NoSQL databases differ from Key-Value databases in terms of value handling and flexibility? Name two popular implementations.

A

Document-based databases make the value visible and queryable, typically storing data in formats like JSON or XML. Each document can have a flexible schema, unlike the opaque values in Key-Value stores. Popular implementations include MongoDB and Apache CouchDB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the fundamental architecture of Column-based NoSQL databases, focusing on column families and rows.

A

Column-based databases store data in columns and groups of columns called column families. Rows within a column family do not need to share the same columns, allowing for sparse data and efficient querying of specific columns across many rows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What types of data and use cases are Graph NoSQL databases best suited for, and what is a key difference in their transaction handling compared to most other NoSQL types?

A

Graph databases are best for highly connected data and relationships, such as social networks, routing applications, and recommendation engines. Unlike most other NoSQL types, Graph databases are often ACID transaction compliant.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define the ACID acronym and briefly describe what each letter represents in the context of database transactions.

A

ACID stands for Atomicity (transactions are all or nothing), Consistency (transactions transform the database from one consistent state to another), Isolation (concurrent transactions do not interfere), and Durability (committed changes are permanent).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the BASE acronym stand for, and what is the core principle it prioritises over immediate consistency?

A

BASE stands for Basically Available, Soft State, and Eventually Consistent. Its core principle is to prioritize high availability over immediate consistency, allowing data to be temporarily inconsistent across replicas but eventually reaching a consistent state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the context of distributed databases, explain the concepts of fragmentation (or sharding) and replication and why they are used.

A

Fragmentation (or sharding) is the process of breaking a large dataset into smaller pieces (shards) and distributing them across multiple servers to manage and store data. Replication involves creating and maintaining copies of data fragments on multiple nodes to ensure availability and fault tolerance.Atomicity, Consistency, Isolation, Durability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does ACID stand for?

A

Atomicity, Consistency, Isolation, Durability

Properties guaranteeing reliable processing of database transactions in traditional relational databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the Approximation Pattern in MongoDB?

A

A design pattern for calculating values where exact precision is not required

Useful for frequent reads and maintaining statistically valid numbers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define Atomic in the context of database transactions.

A

An operation that is indivisible and either completes entirely or is fully rolled back.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the Attribute Pattern in MongoDB?

A

A design pattern to document characteristics and similar fields that are difficult to identify in queries

Useful for sorting and querying small subsets of documents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does Availability refer to in the CAP theorem?

A

The property of a distributed system to remain operational and responsive even with failures or network partitions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does BASE stand for?

A

Basically Available, Soft state, Eventually Consistent

An alternative consistency model to ACID prioritizing availability and scalability over strict consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Basically Available in BASE systems?

A

A characteristic where the system remains operational even in the presence of failures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the Bucket Pattern in MongoDB?

A

A design pattern for managing time series or streaming data by grouping related data points into fewer, larger documents (buckets).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the CAP theorem state?

A

A distributed system can only guarantee two out of three properties in the event of a network partition: Consistency, Availability, and Partition Tolerance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Define Column-based Database.

A

A type of NoSQL database that stores data in columns and groups of columns (column families)

Suitable for sparse data and analytics.

20
Q

What is Consistency in the context of the CAP theorem?

A

The guarantee that all nodes in a distributed system have the same data at the same time.

21
Q

What does Consistent mean in ACID?

A

The property ensuring a database transaction transforms the database from one consistent state to another.

22
Q

What is Denormalized in database design?

A

A technique where redundant data is intentionally introduced to improve query performance and reduce the need for joins.

23
Q

Define Distributed Database.

A

A collection of multiple interconnected databases spread physically across various locations.

24
Q

What is a Document Database?

A

A type of NoSQL database that stores data in flexible, semi-structured documents, typically in JSON or XML format.

25
What does Durability guarantee in ACID transactions?
That committed changes are permanent and survive system failures.
26
What does Eventually Consistent mean in BASE systems?
The system reaches a consistent state given no new updates, although data might be temporarily inconsistent.
27
What is fragmentation in database management?
The process of partitioning a database into smaller, manageable pieces (shards) for horizontal scaling.
28
Define Graph Database.
A type of NoSQL database that stores data in entities (nodes) and relationships (edges) ## Footnote Optimized for traversing connections between data points.
29
What does Isolated mean in ACID transactions?
The property that multiple transactions can run concurrently without affecting each other.
30
What are joins in database terminology?
Combining data from two or more database tables based on a related column between them.
31
Define Key-Value Database.
The simplest type of NoSQL database storing data as pairs of keys and associated values.
32
What does Normalized mean in database design?
A practice to minimize redundancy and maintain data integrity by organizing data into separate tables with relationships.
33
What is the Outlier Pattern in MongoDB?
A design pattern for handling documents or queries that deviate significantly from the typical data pattern.
34
What does Partition Tolerance refer to in the CAP theorem?
The ability of a distributed system to continue functioning even when network partitions or communication failures occur.
35
What is the Polymorphic Pattern in MongoDB?
A design pattern allowing different types of documents to be stored within the same collection.
36
What is Replication in database systems?
Creating and maintaining copies of data on multiple nodes to ensure data availability and fault tolerance.
37
What does RDBMS stand for?
Relational Database Management System.
38
What does Soft State mean in BASE systems?
Acknowledging that the system's state might be transiently inconsistent due to factors like network partitions.
39
Explain what is a **transaction** in database operations.
It's a sequence of one or more operations (such as reads/writes) on a database that **must** be executed as a **single unit**. It either completes fully or doesn’t happen at all.
40
What is a Vector Database?
A newer NoSQL database designed to store, manage, and index high-dimensional vector data efficiently.
41
Define Vectors in the context of databases.
Numerical representations of data transformed using embedding functions for similarity searches.
42
List the four main types of NoSQL databases and briefly explain each.
**Key-Value stores**: Every data element in the database is stored in key-value pairs **Document-based stores**: Every data element is stored inside a **document** that has underlying structure similar to a Python dictionary, i.e. a set of fields (keys) and values pairs. **Graph stores**: Every data element is represented as nodes and its edges (connections). **Wide-column stores**: Data is stored in columns and groups of columns (column families) instead of rows (like in a relation database).
42
What does CRUD stand for?
Create, Read, Update and Delete (operations)
43
Explain the difference between replication and partioning under BASE systems.
NoSQL databases are often distributed across multiple nodes or data centers for scalability and availability. Replication consists in copying data across nodes while partitioning consists in splitting data across nodes.
44
How can the *eventually consistent* characteristic of BASE systems be considered acceptable given consistency of ACID systems?
**Depending on the use case**, * Temporary inconsistency doesn't break functionality. * Users don't even notice (e.g., social apps, news feeds). * Systems are designed to tolerate and reconcile inconsistencies.
45
What are Design Patterns when using MongoDB?
Best practices for structuring data and queries based on common use cases.