L6 - Microservices Flashcards

1
Q

What does it mean that microservices are network enabled?

A
  • In order for each service to be interacted with, they need to be connected to over a network.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give a brief summary of what microservices is…

A

A type of software architectue in which the software is split into services, each of which are network enabled. Each microservice should provide a different functionality.

  • Each microservice waits until a network connection is made to it, which it then responds to.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Talk about the ideal complexity and size of each microservice…

A

Each service should be small, but can be functionally complex.

  • However, should always have a small and simple API.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

If a service starts increasing in size, what actions should be taken?

A

The microservice should be split into smaller sub-services.

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

What does it mean that microservices are message enabled?

A
  • They are network enabled i.e each service is interacted with through network connections. When a connection is made, the service responds to it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What protocol is most commonly used for microservices? And which style?

A

Protocol - HTTP
Style - Representational State Transfer (REST).

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

What are the 4 resources that mciroservices use? Briefly define each…

A
  • Document: Stores file-like resources which can be read GET, written PUT, deleted DELETE.
  • Collection: Stores directory-like resources. Can read GET and write PUT.
  • Controller: For interacting with external resources. E.g Accommodating a POST request to trigger the external resource to perform some action.
  • Store: Stores directory-like resources similar to a collection.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Talk about the effect that a Microservices architecture has on testing. Draw comparisons to Monolithic testing.

A

Con: (Distributed Testing and Debuggin) Testing can be tricker regarding performing tests and locating bugs due having to test all separate services individually. As opposed to Monolithic, where there is one testing location and one debugging location.

Pro: Modular services prevents the central point of failure risks that a monolithic system has. Debugging, smaller and simpler services should be easier with less risks.

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

What type of Scaling occurs when using Microservices architecture?

A
  • Horizontal Scaling
  • Rather than migrating software to a larger system, more systems that can run the microservice instance are added to deal with the workload.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What type of database do microservice systems often use? What is a pro and con of this?

A

Distributed databases.

Pros:
- Quicker due to data locality to the microservice it provides.
- Scalable

Cons:
- Can’t monitor data consistency well
- May incur data duplication across databased.
- Can lead to non-uniformity in data.

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

What are the names of the 2 distributed database transactions?

A
  • Two-phase commit
  • Sage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain the Two-phase commit transaction…

A
  • Used to performing transactions on a distributed database.
  • When a change is to be made, the controller proposes the data change to all distributed databases which contain the data. Once they all give consent, the data change is applied to all concerned databases.

Pros:
→ Ensures consistency.
→ Ensures data uniformity.
Cons:
→ Each database is locked waiting for voting.

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

Explain Saga transactions…

A
  • A sequential transaction in which the transaction coordinator asks each database to commit or abort in sequence. Each database holds locks on the data until it either commits or aborts. All databases in the sequence must commit. If one aborts, a rollback of all committed databases is executed.

Success → All databases in sequence commit successfully.

Failure → At least one database in the sequence aborts, resulting in a rollback to previous states for all databases in the sequence.

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