MS Flashcards

1
Q

What are microservices?

A
  1. Small and fast to build by a small team.
  2. Responsible for doing “one” thing well (SRP). Really group of things that change for the same reason.
  3. Organizationally aligned in terms of the business unit chosen to be responsible for the service makes sense business wise.
  4. For part of the distributed whole.
  5. Self-contained and autonomous. They can stand on their own without relying too much on other things.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the benefits of microservices?

A
  1. Easier to change and deploy* (may not be easier to setup deploy pipeline but they are smaller and decoupled, so when a pipeline is setup it is generally easier).
  2. Can be build using different technologies (can be a double edged sword since more technologies require more knowledge about updates and security).
  3. Increased organizational ownership and alignment. Different parts of an organization can priorities and develop the services they own.
  4. Resilient. Services can break independently without bringing down all the other services. (They may have the same data but do not share the same data store).
  5. Easier to scale. We can scale individual services instead of the entire monolith application.
  6. Build to be highly replaceable / swappable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the disadvantages of microservices?

A
  1. It is difficult to implement an entire microservice architecture.
  2. Can result in analysis paralysis. If we do not understand the problem domain then we may spend too much time breaking down components without understanding the “change for the same reason” part and even worse we may get stuck with a model that is incorrect and hard to update because its split into many parts.
  3. Distributed systems are hard. Network failures happen.
  4. They are always coupled to something, otherwise they are just mini monoliths.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can we use RabbitMQ to couple services to each other?

A

If one service needs information from another service then we can publish an event to a RabbitMQ message bus which other services subscribe to and thereby receive information from services in a decoupled fashion. With this approach we employ eventual consistency, which is a tradeoff that may not be appropriate in all situations.

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

What are best practices when developing a repository pattern?

A
  1. One repository per business object.
  2. Provide a contract or interface.
  3. Use generic implementation.
  4. Implement crud operations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly