Week 3 - Spreadsheets and Storage Flashcards

1
Q

What type of programming are spreadsheets a form of?

A

Functional programming

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

Give 2 use cases of spreadsheets.

A

Reading a cell
Updating a cell

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

How else can a spreadsheet be seen?

A

As a store of documents

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

What does the repository design pattern encapsulate?

A

A set of objects persisted in a data store and the operations performed over them. It provides a clean separation between the domain and mapping layers.

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

How can an enterprise computer system store data?

A

Using a centralised or decentralised/distributed database

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

What is an enterprise using a monolith likely to store its data in?

A

A centralised database

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

What are some pros of using centralised database organisation?

A

It is easy to ensure that the accuracy, completeness, and consistency of data is maintained

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

What are the two things a transaction can do?

A

Commit (completes successfully), and the database is moved to a new consistent state.

Aborts (completes unsuccessfully), and the database is restored to its previous consistent state.

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

Transactions have the ACID properties. What does ACID stand for?

A

Atomicity, Consistency, Isolation, Durability

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

What does atomicity mean in terms of centralised database transactions?

A

All or nothing - transactions either happen or they don’t

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

What does consistency mean in terms of centralised database transactions?

A

Before a transaction the database is in a consistent state, and after the transaction the database is in a consistent state

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

What does isolation mean in terms of centralised database transactions?

A

Serialisability - transactions cannot view other in-progress transactions

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

What does durability mean in terms of centralised database transactions?

A

If a transaction takes place, its effects will be seen

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

What is an enterprise using microservices likely to store its data in?

A

A distributed/decentralised database

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

What are some cons of distributed databases?

A

It is difficult to ensure the accuracy, completeness and consistency of data is maintained

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

How can a distributed database be managed?

A

With two-phase commit or sagas

17
Q

Describe a two-phase commit.

A

A coordinator transaction asks a number of participant transactions to vote on whether they are prepared to commit a change.

Each participant holds locks on its data involved in the transaction until the coordinator decides to commit or abort.

If all participants vote to commit, then the coordinator instructs all participants to commit. Otherwise, if any participant votes to abort or times out, the coordinator instructs all participants to abort.

18
Q

What is a problem with a two-phase commit?

A

The locks on the transaction data means other transactions can’t take place at the same time.

19
Q

Describe a saga.

A

A coordinator transaction asks each participant to commit or abort in sequence.

Each participant holds a lock on its data involved in the transaction only until it decides to commit or abort.

20
Q

What happens in a saga if a participant aborts?

A

The sequence ends immediately and compensating transactions are made to undo the work of those participants that have already committed - a saga sacrifices atomicity and relies on eventual consistency.

21
Q

Among the desirable properties of a distributed system are CAP - what does this stand for?

A

Consistency, Availability, Partition-tolerance

22
Q

What does consistency mean in the CAP Theorem?

A

The same response is received from any node/microservice

23
Q

What does availability mean in the CAP Theorem?

A

A response is received from every node/microservice

24
Q

What does partition-tolerance mean in the CAP Theorem?

A

The system works even if nodes/microservices become disconnected

25
Q

What does Eric Brewer’s CAP Theorem say?

A

Although there are three fundamental guarantees (CAP) that a distributed system could make, one can only ever have two of them at the time.

26
Q

What are the three ways in which you can decompose a database and what do they mean?

A

Split the database then the code - this change is unlikely to deliver much short-term benefit as the monolith remains, and transaction atomicity is lost.

Split the code then the database - this change will hopefully deliver immediate short-term benefit from the new service, and the confidence to complete the decomposition.

Split the code and the database - this is a much bigger change, and the benefit will be long-term as there is so much work to do, so this should be avoided.