Databases Flashcards

1
Q

What are the two primary types of consistency model?

A

Immediately available and eventually available

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

What is volatile storage?

A

Volatile storage is temporary storage usually held in-memory by a cache. It is not persistent and therefore lost if the cache is restarted.

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

What is another name for horizontal database scaling?

A

Sharding

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

How is a sharded database implemented?

A

Typically with a hash function to allocate a shard for storing the requisite data. Each shard contains different data, unlike a replicated database.

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

What determines how data is distributed in a sharded database?

A

The sharding key.

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

What is CAP theorem?

A

CAP theorem states it is impossible for a distributed system to simultaneously provide more than two of three guarantees: Consistency, Availability, Partition tolerance.

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

What are the two types of database scaling?

A

Vertical and horizontal scaling.

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

How do you vertically scale a database?

A

You ‘scale up’ a database by adding more power (CPU, RAM, DISK).

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

How do you horizontally scale a database?

A

You horizontally scale a database using a technique called sharding. The practice of adding more servers.

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

What function is used to find a database shard?

A

A hash function.

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

What is the most important factor to consider when implementing sharding?

A

The selection of the sharding key. This is also known as the partition key - consisting of one or more columns that determine how data is distributed.

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

What is the difference between UNION and INTERSECT?

A

Both union and intersection are the two fundamental operations through which sets can be combined and related to each other. In terms of set theory, union is the set of all the elements that are in either set, or in both, whereas intersection is the set of all distinct elements that belong to both the sets.

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

What is the difference between OLTP and OLAP?

A

An OLTP database is an on-line transaction processing database designed for persisting transactions, and typically follows a 3NF approach. An OLAP database is an on-line analytical processing database used to provide analytics such as in a data warehouse.

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

What is a data lake?

A

A data lake is a system or repository of data stored in its natural/raw format, usually object blobs or files.

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