Microservices Flashcards

1
Q

What is microservices?

A

Microservices is an architectural style that structures an application as a collection of small autonomous services, modeled around a business domain

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

What are the main advantages of microservices?

A
  • Independent Development
  • Speed of development
  • Independent Deployment
  • Security and access for some private services.
  • Mixed Technology Stack
  • Resielence (If one component of a system
    fails, you can isolate the problem)
  • Scaling
  • Optimizing for Replaceability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the main disadvantages of microservices?

A
  • Wrong splitting to context
  • Building integration between services
  • Managing dependencies could be hard
  • Much harder to test and monitor than traditional architectures.
  • Nearly impossible to carry transactions across API calls
  • Insufficient scaling of one service leads to scalability problems and frequently to a failure of other services which depend on it. This is known as backpressure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How small should be microservices?

A
  • If one team can’t handle this size, would be better to split into the fewer pieces.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What alternatives for microservices do we have?

A
  • Shared libraries (gems)

- Modules

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

What general points can help you take a good architectural decision?

A
  • Vision ( where a company going to be in the future? for example, become word wide platform)
  • Principles ( rules which will lead you to the company aim. for example write code which will be used for many years in the future)
  • Practices ( how to achieve principle, for example, guidelines)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Should we use a shared database for microservices?

A

Pluses
- easy

Minuses

  • can’t replace a database
  • everyone has access to the whole data ( you can break something accidentally )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is SOAP?

A

SOAP is an acronym for Simple Object Access Protocol. It is an XML-based messaging protocol for exchanging information among computers. SOAP is an application of the XML specification.

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

What are the main rules for creating good integration?

A
  • Avoid Breaking Changes.
    For example, if a microservice adds new fields to a piece of data it sends out, existing consumers shouldn’t be impacted. ( add a new field to API and fronted is broken)
  • Be APIs Technology-Agnostic

This means avoiding integration technology that dictates what technology stacks we can use to implement our
microservices. (Integration tools which works only in one env is not a good idea)

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

What does it mean ‘Cost of changes’?

A

This is how difficult to add new changes to the project.

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

What ways/tools you can use to build an integration between microservices?

A
  • Shared database
  • Remote Procedure Calls
  • REST
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Remote Procedure Calls? (RPC)

A

Remote procedure call refers to the technique of making a local call and having it execute on a remote service somewhere.

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

What is REST?

A

REpresentational State Transfer (REST)

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

What is RabbitMQ?

A

RabbitMQ is a messaging broker. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.

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

How to handle versioning?

A
  • gem version (1.2.23 bump when works)
  • old and new API endpoint works together
  • old API request converts to the new request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is concept of seam?

A

Seam — that is, a portion of the code that can be treated in isolation and worked on without impacting the rest of the codebase.

17
Q

What is a compensating transaction?

A

A compensating transaction is a set of database operations that perform a logical undo of a failed transaction.

18
Q

What is use a distributed transaction?

A

Solves transaction problem for microservices by 2 ways:

  • 2pc (two-phase commit)
  • Saga
19
Q

What is a two-phase commit?

A

2pc has two phases: A prepare phase and a commit phase. In the prepare phase, all microservices will be asked to prepare for some data change that could be done atomically. Once all microservices are prepared, the commit phase will ask all the microservices to make the actual changes. ( Check that all cases works, if yes -> commit)

20
Q

What is SAGA pattern for distributed transactions?

A

The Saga pattern is asynchronous.
We send and events one by one. And we create a transaction for each event. If something can’t be createn during this step we send Error event and rollback already created data.

If any microservice fails to complete its local transaction, the other microservices will run compensation transactions to rollback the changes

21
Q

What is Continuous integration? (CI)

A

Continuous integration (CI) is the practice of automating the integration of code changes from multiple contributors into a single software project. The CI process is comprised of automatic tools that assert the new code’s correctness before integration.

22
Q

What is continuous deployment? (CD)

A

Continuous Deployment (CD) is a software release process that uses automated testing to validate if changes to a codebase are correct and stable for immediate autonomous deployment to a production environment.

23
Q

What is continuous delivery? (CD)

A

Continuous Delivery is the ability to get changes of all types (new features, configuration changes, bug fixes) into production safely and quickly.

development -> fast tests -> slow tests -> UAT -> PROD

24
Q

What is consumer-driven contract testing?

A

Consumer-driven contract testing is a way to formalize expectations into a contract between each Consumer-Provider pair. Once this contract is established, contract testing ensures, automatically, that the contract doesn’t break unexpectedly. ( Checks that we don’t break way of communication between services)

25
Q

What is cross-functional testing?

A

Cross-functional testing is verification of non-functional requirements. These requirements are such characteristics of system that cannot be implemented like a normal feature. Eg. Number of concurrent users supported by system, usability of site, security, perfomance

26
Q

What is SSO?

A

Single sign-on (SSO) is an authentication scheme that allows a user to log in with a single ID and password to any of several related software systems.

27
Q

What is Circuit Bracker pattern?

A

Circuit breaker is a design pattern used in software development. It is used to detect failures and encapsulates the logic of preventing a failure from constantly recurring.
With a circuit breaker, after a certain number of requests to the downstream resource have failed, the circuit breaker is blown. All further requests fail fast while the circuit breaker is in its blown state.

28
Q

What is bulkhead pattern?

A

In general, the goal of the bulkhead pattern is to avoid faults in one part of a system to take the entire system down. The term comes from ships where a ship is divided in separate watertight compartments to avoid a single hull breach to flood the entire ship; it will only flood one bulkhead.

29
Q

What is load balancer?

A

The load balancer helps servers handle requests efficiently, optimizes the use of application delivery resources and prevents server overloads.

30
Q

What is SOA?

A

Service-oriented architecture (SOA) is a type of software design that makes software components reusable using service interfaces that use a common communication language over a network. ( Like microservices )