EC Flashcards

1
Q

What does the characteristic: ‘small in size’ mean for a microservice?

A

Very compact pieces of software

Measured in lines of code or number of features

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

What does the characteristic: ‘messaging enabled’ mean for a microservice?

A

Microservices can communicate with each other and between different machines

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

What does the characteristic: ‘bounded by contexts’ mean for a microservice?

A

Business domain model may be broken down into smaller pieces which bound the boundaries of microservices

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

What does the characteristic: ‘independently deployable’ mean for a microservice?

A

No microservice depends on another microservice, therefore deployment carries less risk, therefore less testing is required

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

What does the characteristic: ‘built and released with automated processes’ mean for a microservice?

A

Build tools make the process repeatable and reliable, while version control allows for reversability

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

What does the characteristic: ‘built and released with automated processes’ mean for a microservice?

A

Build tools make the process repeatable and reliable, while version control allows for reversibility

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

What does the property: ‘technological heterogeneity’ mean for a microservice?

A

Microservices can be created in any technology in any language, a suite of MS can be written in a variety of langs

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

What does the property: ‘resilience’ mean for a microservice?

A

MS can mask failures by using timeouts, circuit breakers or bulkheads

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

What does the property: ‘ease of development’ mean for a microservice?

A

MS can be deployed incrementally and at different speeds making it easier to exploit new business opportunities

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

What does the property: ‘scaling’ mean for a microservice?

A

MS can be allocated different amounts of computing capacity

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

What does the property: ‘organizational alignment’ mean for a microservice?

A

Companies can change their organisational structure to correspond with their system structure

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

What does the property: ‘composability’ mean for a microservice?

A

Microservices can be combined in multiple different ways to meet new business requirements

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

What does the property: ‘replacability’ mean for a microservice?

A

Replacing portions of an application is easy as applications are small

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

What is the Single Responsibility Principle?

A

One should gather together those things that change for the same reason, and separate things that change for different reasons

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

What is the Law of Demeter?

A

The LoD states that one should make components which only know about the structure and properties of components they deal with directly

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

What is the rule of ‘Dont Repeat Yourself’?

A

One should only merge things that are duplicated to avoid wasting effort making something that is needlessly complicated and hard to maintain

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

What is high-cohesion?

A

Behaviour related to a microservice is found within that microservice - nowhere else

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

What is loose coupling?

A

A change to one microservice does not require a change to another - high levels of encapsulation

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

What is the ‘client-server’ property of a system of microservices?

A

Client deals with UI, server deals with processing and storage

20
Q

What is the ‘stateless’ property of a system of microservices?

A

The stateless principle means that the session state is kept entirely on the client - none on server

21
Q

What is the ‘cache’ property of a system of microservices?

A

The client may reuse cached response data for later requests

22
Q

What is the ‘uniform interface’ property of a system of microservices?

A

Utilize the CRUD operations to manipulate resources

23
Q

What is the ‘layered system’ property of a system of microservices?

A

The client cannot ‘see’ beyond the immediate layer it is interacting with

24
Q

What is the ‘code-on-demand’ property of a system of microservices?

A

Client functionality may be extended by downloading applets or scripts

25
Q

What is the ‘REST’ property of a system of microservices?

A

Highly cohesive, loosely coupled microsystem designs mean resources will be exchanged using representations of them

26
Q

What are ‘documents’ in the context of microservices?

A

Akin to a file - can contain data or links to other resources - CRUD available

27
Q

What are ‘collections’ in the context of microservices?

A

Akin to a directory of resources - can only CREATE or READ

28
Q

What are ‘stores’ in the context of microservices?

A

Akin to a directory of resources - can only UPDATE or READ an entire store

29
Q

What are ‘controllers’ in the context of microservices?

A

Akin to a procedure, a client may ask the server to CREATE some change in the state of the world by executing a procedure

30
Q

What are the advantages of shared databases?

A

Rapid integration between different departments

Complete consistency of data between departments

31
Q

What are the disadvantages of shared databases?

A

Changes made to departments are slow or breaking

Database technology used by departments gets fixed

32
Q

What are the three ways to implement transactions in a database?

A

Try again later
Abort the entire operation
Distributed transactions

33
Q

What is the ‘try again later’ approach to transactions?

A

We accept that the eventual consistency will ensure the data is consistent in the end

34
Q

What is the ‘abort the entire operation’ approach to transactions?

A

Stop the entire operation - undo what has been done so far

35
Q

What is the ‘distributed transactions’ approach to transactions?

A

A transaction manager asks participants to perform a two-phase commit

36
Q

What is the CAP theorem?

A

Consistency - every read returns the result of the most recent write
Availability - every node always performs a read or write
Partition Tolerance - even if nodes become disconnected C and A are maintained
You can only ever have two of these at once

37
Q

What are the most common patterns of communication between microservices?

A

Orchestration

Choreography

38
Q

What is the orchestration model of microservice communication?

A

Centralized controller tells each part of the system what it should be doing

39
Q

What is the choreography model of microservice communication?

A

One part of the system publishes an event to which others subscribe - like subscribing to an event listener

40
Q

What is a timeout?

A

A timeout is triggered when a downstream service fails to respond in time, allowing for alternative action

41
Q

What is a circuit breaker?

A

A CB is blown when a downstream service fails to respond in time or fails with an error
Subsequent attempts to access the downstream service will immediately fail without tying up the resources that they otherwise would if they actually tried to access the service without the CB

42
Q

What is a bulkhead?

A

Closed when a downstream service fails to respond in time or fails with an error - perhaps by limiting the size of a connection pool
Attempts to use downstream service either fail or switch to an alternative until bulkhead is open again

43
Q

What is vertical scaling?

A

Effectively buying more computing power - limited by moore’s law

44
Q

What is horizontal scaling?

A

Adding more replicas - this is easy with services and avoids the limitations of moore’s law

45
Q

What is load balancing?

A

Distributes requests to two or more replica machines that deliver the same service