Microservices Questions Flashcards

1
Q

What do you understand of Microservices?

A

An architectural style that structures an application as a collection of services that are:

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities
  • Owned by a small test
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is event driven architecture?

A

Is a software architecture and model for application design. With an event-driven system, the capture, communication, processing and persistence of events are the core structure of the solution. This differs rom a traditional request driven Model.
Event driven enables minimal coupling which makes a good option for modern distributed apps. architecture.

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

What’s an event?

A

Any significant occurrence or change in state in a system.

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

How does event driven architecture work?

A

It’s made up of event producers and consumers. An event producer detects or senses an event and represents the event as a message. It does not know about the consumer of the event or the outcome.
The event processing platform will execute the correct response to an event and send the activity downstream to the right consumers

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

What are the types of event-driven architecture models?

A

Pub/Sub model. After an event occurs, or is published, it is sent to subscribers that needs to be informed.

Event streaming model. Events are written to logs. Events consumers don’t subscribe to an event stream. Instead, they can read any part of the stream and can join the stream at any time.

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

What are the main features of microservices?

A
  • Multiple individually deployable components
  • Service distribution based on business capabilities
  • Decentralized data management
  • DevOps implementation
  • Technical independence
  • Hidden component complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the microservice architecture work?

A

Under microservice, an application is simplified into multiple modules that independently perform a single precise task

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

What are the benefits of microservices?

A
  • Improves modularity
  • reduce complexity by making smaller code bases per microservice
  • allow you to update functionalities with minimal or no impact on the other parts of the system
  • greatly reduces the chances of breaking something unrelated to the system
  • more collaboration between teams
  • enables continuous delivery
  • can be deployed independently
  • highly scalable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the disadvantages of microservices?

A
  • Complicated as a whole
  • requires accurate planning
  • modular dependencies are hard to calculate
  • complete end-to-end testing is hard
  • deployment challenges
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Domain Driven Design?

A

Is an architectural style based on Object-Oriented Analysis design concepts and principles. It helps developing a complex system by connection the related components of the software system and continuously evolving the system.
Based on three principles:
- Focus on core domain and domain logic
- base complex designs on models of the domain
- regularly collaborate with the domain experts to improve the application model and resolve any emerging domain-related issues

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

What is Restful API?

A

Is a Web API ( Application Programming Interface) or service that is based on REST(representational state transfer).

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

What is REST?

A

defines how clients communicate with the API over HTTP. Client requests generally consists of Http verb, URI, Request Headers

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

What is an API Gateway?

A

An API Gateway creates a unified entry point that clients applications can use to access microservices. Acts as a reverse proxy that routes the HTTP requests that are made by the clients to the desired backend microservice. They also have important functions such as client auth, SSL, load balancing.

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

Why do we need CQRS?

A

Generally data is more queried than altered. Separating commands and queries allows us to optimize each for high performance

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

What is SAGA pattern?

A

Design Pattern solution for implementing transaction in form of sagas that span across two or more microservices. When one transaction in the saga fails, that saga executes a series of compensating transactions to undo the changes

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

What is CAP theorem?

A

In the presence of network partition, you must choose between consistency and availability. (Eventual consistency like Cassandra)

17
Q

What is a Stateless Service?

A
  • Not a cache or database
  • frequently accessed metadata
  • no instance affinity
  • loss of a node is a non-event
18
Q

What is a stateful service?

A
  • databases and caches
  • custom apps which holds large amounts of data
  • loss of a node is a notable event
19
Q

What is Conways law?

A

Any piece of software reflects the organizational structure that produced it

20
Q

What is Backpressure?

A

Input is coming in faster than we can output

You can deal with it with three ways:

  • control( slow down/speed up is decided by the consumer) (gRPC)
  • buffer
  • drop