Building microservice book Flashcards

1
Q

Right approach to design microservices? explain strategic goals, principles, practices

A

Strategic goals - where business wants to move

Principles - designed around strategic goals eg if one of your strategic goals as an organization is to decrease the time to market for new features, you may define a principle that says that delivery teams have full control over the lifecycle of their soft‐ware to ship whenever they are ready, independently of any other team.

Practices - Practices should underpin our principles, like CI/CD should be fast

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

Loose coupling? High cohesion?

A

Loose coupling -When services are loosely coupled, a change to one service should not require a
change to another. The whole point of a microservice is being able to make a change
to one service and deploy it, without needing to change any other part of the system.

High Cohesion - We want related behavior to sit together, and unrelated behavior to sit elsewhere.
Why? Well, if we want to change behavior, we want to be able to change it in one
place, and release that change as soon as possible. If we have to change that behavior
in lots of different places, we’ll have to release lots of different services (perhaps at the
same time) to deliver that change

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

Orchestration Versus Choreography

A

Revise when to use both

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

HAL - Hypertext Application Language to design Json structure for response

A

https://stateless.co/hal_specification.html

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

Should we pick DB structure and deserialize and provide it to users?

A

No, this would mean tight coupling of you DB schema, design and customer need. With this, you design will depend on customer needs.

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

Fanout pattern

A

NA

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

Be wary of the freshness of data when you send data from one service to another, it might happen when the event reaches the consumer service the data might have changed

A
  • the load on the customer service can be too great
  • Another problem is that some of our services might not need to know about the whole Customer resource, and by insisting that they go look it up we are potentially increasing coupling. It could be argued, for example, that our email service should be more dumb, and that we should just send it the email address and name of the cus‐
    tomer. There isn’t a hard-and-fast rule here, but be very wary of passing around data in requests when you don’t know its freshness.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Distributed tracing

A

Distributed tracing is a method of tracking application requests as they flow from frontend devices to backend services and databases. Developers can use distributed tracing to troubleshoot requests that exhibit high latency or errors.
eg. X-ray in AWS

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

Distributed transaction

A

also read 2-phase commit

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

Tornado python framework , non-blocking IO calls

A

https://www.tornadoweb.org/en/stable/guide/intro.html

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

Drawbacks of WSGI

A

https://medium.com/475cumulus/wsgi-is-not-enough-anymore-part-i-bc9713a79841

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