CHAPTER 1 Flashcards

1
Q

What does NoSQL stand for?

A

Not Only SQL

Refers to a set of modern databases that do not use traditional relational models.

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

What is a key trait of NoSQL databases?

A

Schema-less

Data can be stored as key-value pairs, documents, columns, or graphs.

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

Why are NoSQL databases needed?

A

Traditional SQL databases can’t scale for volume, variety, and velocity of modern data.

Examples include social media, IoT, and e-commerce.

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

What are the 7 V’s of Big Data?

A
  • Volume
  • Velocity
  • Variety
  • Variability
  • Veracity
  • Visualization
  • Value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Who defined relational databases (RDBMS) and when?

A

Edgar Codd in 1970.

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

What are the ACID properties in RDBMS?

A
  • Atomicity
  • Consistency
  • Isolation
  • Durability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a limitation of RDBMS?

A

Fixed schemas, hard to scale horizontally, not suitable for massive or semi-structured data.

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

What are the main characteristics of NoSQL?

A
  • Horizontal Scalability
  • Schema-less
  • High Performance
  • Open-source and cost-effective
  • Eventual Consistency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the challenges of NoSQL?

A
  • Immature technology
  • Lack of standards
  • Limited professional support
  • Complex administration
  • Fewer experts compared to SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Key-Value Store?

A

The simplest form of a NoSQL database, storing data as (key, value) pairs.

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

Name an example of a Key-Value Store.

A

Redis, Amazon DynamoDB, Voldemort.

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

What are the basic operations of a Key-Value Store?

A
  • put(key, value)
  • get(key)
  • delete(key)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When is it appropriate to use Key-Value Stores?

A

For storing data accessed only by key, such as session data, user profiles, and shopping cart data.

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

When should you avoid using Key-Value Stores?

A
  • Need for relationships between data
  • Require multi-key transactions
  • Need queries based on values
  • Need batch operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Redis?

A

An open-source, in-memory, key-value store.

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

What are some key features of Redis?

A
  • Data types: strings, lists, sets, sorted sets, hashes
  • Atomic operations
  • Persistence options
  • Pub/Sub messaging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the CAP Theorem?

A

Consistency, Availability, Partition Tolerance. You can’t have all three in a distributed system.

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

What does the BASE model stand for?

A
  • Basically Available
  • Soft state
  • Eventual consistency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the difference between vertical and horizontal scaling?

A
  • Vertical Scaling: Add more power to a single machine
  • Horizontal Scaling: Add more machines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is sharding in NoSQL?

A

Data partitioning across multiple machines based on a key.

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

What is eventual consistency in NoSQL?

A

Data updates are not always immediately visible across all nodes but will eventually become consistent.

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

What is MapReduce?

A

A programming model for processing large datasets across many machines.

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

What are the phases of MapReduce?

A
  • Map Phase
  • Shuffle Phase
  • Reduce Phase
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is a combiner in MapReduce?

A

An optional optimization that aggregates data locally before shuffling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does HDFS stand for?
Hadoop Distributed File System.
26
What is the role of the NameNode in HDFS?
Manages metadata such as file locations and directory structure.
27
What happens if a DataNode doesn’t send a Heartbeat?
It is considered dead, and the NameNode replicates blocks from dead nodes.
28
What is the purpose of the JobTracker in Hadoop?
Coordinates the job execution.
29
What is the main use case for MapReduce?
Batch processing of large datasets.
30
What are some characteristics of MapReduce?
* Shared nothing architecture * Highly parallel and fault-tolerant * Not suitable for real-time processing
31
What is an aggregate in NoSQL?
A group of logically related data processed as a unit.
32
What is the primary feature of Redis regarding data storage?
In-memory data storage ## Footnote Data is stored in RAM, making reads and writes extremely fast.
33
What happens if Redis runs out of memory?
It can be killed by OS, crash, or slow down ## Footnote Monitoring with INFO command is recommended.
34
What is the maximum length of a Redis String?
512 MB
35
Which commands are used with Redis Strings?
* GET * SET * APPEND * INCR * DECR * STRLEN
36
What is a List in Redis?
An ordered collection of strings
37
Which commands are used with Redis Lists?
* LPUSH * RPUSH * LPOP * RPOP * LRANGE * LLEN
38
What defines a Set in Redis?
An unordered collection of unique strings
39
Which commands are used with Redis Sets?
* SADD * SREM * SINTER * SUNION * SISMEMBER
40
What is a Sorted Set in Redis?
Each element has a score to keep them sorted
41
Which commands are used with Redis Sorted Sets?
* ZADD * ZINCRBY * ZRANGE * ZCOUNT * ZREM
42
What does a Hash in Redis resemble?
Like a row in a relational table (fields and values)
43
Which commands are used with Redis Hashes?
* HSET * HGET * HGETALL * HDEL * HINCRBY
44
How are transactions handled in Redis?
Commands are queued using MULTI and executed with EXEC
45
What is the behavior of Redis transactions if one command fails?
Other commands still run
46
What is the role of Redis Master-Slave Replication?
One master handles writes, slaves copy data and handle reads
47
What happens if a slave disconnects in Redis Replication?
It reconnects automatically
48
What is Redis Sentinel used for?
Ensures high availability and performs automatic failover
49
What is the purpose of Redis Partitioning?
Splitting data across multiple Redis servers
50
What are the two types of partitioning in Redis?
* Range Partitioning * Hash Partitioning
51
What are the two methods of persistence in Redis?
* RDB (Snapshot) * AOF (Append-Only File)
52
What command makes a snapshot in Redis?
SAVE
53
What is the CAP Theorem in relation to Redis?
Redis cannot have Consistency, Availability, and Partition Tolerance all at the same time
54
Which feature does Redis favor according to the CAP theorem?
Availability + Performance over strict Consistency
55
What is the command to set a key with an expiration in Redis?
EXPIRE
56
What is the command to retrieve a key in Redis?
GET
57
What is the structure of a Map function in MapReduce?
function map(text): for each word in text: emit(word, 1)
58
What is the structure of a Reduce function in MapReduce?
function reduce(word, counts): total = sum(counts); emit(word, total)
59
How do you add an item to a Redis List?
Using LPUSH or RPUSH commands
60
What command retrieves all items in a Redis List?
LRANGE
61
What command removes the last item from a Redis List?
RPOP
62
What command is used to increase a score in a Redis Sorted Set?
ZINCRBY
63
What command counts items in a Redis Sorted Set within a specific range?
ZCOUNT
64
What command displays items in a Redis Sorted Set within a score range?
ZRANGEBYSCORE
65
What command is used to store product inventory using hashes in Redis?
HSET
66
What command reduces quantity by 1 when a product is sold in Redis?
HINCRBY