Storage and Retrieval Flashcards

1
Q

What are the two types of database workload?

A

Transactional Workload (write intensive), Analytical Workload (read-intensive)

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

What are logs?

A

Logs are used by databases to record the data in the database, they are read-only data files storing the records in sequence

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

What is the disadvantage of log files?

A

Reading the file is in O(n) which is slow for a large databse

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

How might log file access be sped up?

A

Using binary files rather than plain text

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

How are records deleted form log files?

A

Instead of scanning the entire log to delete a record a special delete (tombstone) record is appended to the end

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

What is a hash index?

A

An index for key-value data, similar to dictionaries.

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

How is disk space managed for log files?

A

The log is broken into segments of a certain size by closing the file when it reaches a given size. Subsequent writes are on a new file.

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

What is compaction?

A

The process of removing duplicate keys to reduce segment size.

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

What are the advantages of a Hash table?

A
  1. Sequential write operations are much faster than random access to disk
  2. Crash Recovery can be easier since when updating a value you’re not actually overwriting its old content
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the disadvantages of a hash table?

A
  1. The hash table must fit into memory
  2. Range queries are not possible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are SSTables?

A

Sorted String Tables in which keys appear only once per segment and the log is sorted by key.

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

How do SSTables locate keys?

A

A sparse selection of keys are held in memory pointing to segments. To find a specific key the segment is found by comparing alphabetically to the keys in index.

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

How is the SSTables log kept sorted by key?

A

Using an AVL tree

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