no sql Flashcards

1
Q

what are the 4 types of data

A

structured and unstructured
dynamic and static

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

dynamic

A

changing frequently

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

static

A

never changes

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

strcutured

A

formal predefined
easy to store and process

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

unstructured

A

e.g. audio, image, music
usually still has internal structural properties

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

sharding data

A

splitting the data to allow concurrent/parallel access using multiple machines
can simultaneously access each shard

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

in which two ways can we scale databases

A

vertically and horizontally

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

vertical scaling

A

upgrading hardware e.g. increasing memory

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

what is the limitaiton of vertical scaling

A

limited by the amount of cpu ram disk etc that can be configured on a single machine

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

horizontal scaling

A

adding more machines which requires shading and replication so you can work with them simultaneously

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

what is the limitation of horizontal scaling

A

read-to-write ratio and communication overhead

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

in which three ways can we benefit form parallelisation

A

maximise the fraction of the program that can be parallelised
balance the work load and parallel process
minimise the time spent on communication

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

how does the two phase commit protocol work

A

the coordinator requests cote for commit and the participants either approve or reject
if all participants accept then everything gets committed at the same time

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

what is the issue with two phase commit

A

hard to find a time where all servers are ready to commit

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

what is the CAP theorem

A

any distributed database with shared data can have at most 2/3
usually sacrificing consistency

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

what are the three components of cap theorem

A

consistency; every node always sees the same data at the same time
availability; the system continues operating even if nodes crash or software or hardware is down
partition tolerance; the system works well when distributed

17
Q

what are the BASE properties

A

basically available; the system guaranteed availability
soft state; system state may change over time
eventual consistency; will eventually become consistent

18
Q

what does it mean for a db to be eventually consistent

A

if all replicas will gradually become consistent in the absence of updates

19
Q

what makes no sql no sql

A

no strict schema requirements
no strict adherence to acid properties
consistency is traded in favour of availability

20
Q

document database/store

A

loosely structured set of key value pairs in documents encapsulate and encode data in some standard formats/encodings
treated as a whole
query languages can help retrieve documents based on their contents
addressed in the db via the unique key

21
Q

in mongo what is the primary key

A

key; “_id”

22
Q

sorted ordered column-oriented stores

A

columns are grouped in column families which data is stored in rather than tables
each unit of data is a set of key value pairs identified by row-key

23
Q

graph db

A

everything is stored as an edge node or attribute
each node and edge can have any number attributes and can be labelled which narrows searches

24
Q

what do document db use instead of an fk

A

embedded documents and referencing

25
Q

what can be a value in document db

A

any data type

26
Q

references

A

including links from one document in another which normalises the db

27
Q

what are some benefits of using referencing

A

can represent more complex many-to-many relationships
good for large hierarchical datasets

28
Q

what is a negative of using referencing

A

requires follow up queries to find all the data you need

29
Q

embedded data

A

having a doc inside another via an array

30
Q

embedded data positive

A

can get all the data in one call using less queries

31
Q

negative of embedded data

A

the db isn’t normalised an not all values are atomic

32
Q

data model

A

displays a set of tables and the relationship between them providing a blueprint so you can identify which data is important and what should be maintained