Microservices and Docker Flashcards

1
Q

What is Microservices?

A

Small independent services that handles some logic.

Some call it a variant of SOA - but services have a smaller scope.

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

What does the Microservices guidelines describe its services as and what does it enable?

A

Highly maintainable and testable.
- Enables rapid development and deployment.

Loosely coupled with other services
- enables cross team collaboration.

Independent and deployable
- enables deployment freedom.

Capable of being developed by small teams
- agility and prevents communication problems.

Single responsibility principle.
- a microservices does on thing only.

Stateless
- just like rest

Data handling only through the use of API’s

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

What does it mean that the microservice is loosely coupled?

A

It is independent and handles its own responsibility. So it does not need to contact other services to fulfil its tasks.

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

Why are microservices maintainable?

A

Because they are small and loosely coupled. If you change things in a microservice it does not affect others. This also makes it deployable since it can work on its own.

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

What is meant by stateless microservice?

A

It does not keep track of requests or anything. It receives a request performs the tasks and that’s it.

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

Why does microservices enable agility and cross team collaboration?

A

No dependencies and they communicate via protocols.

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

What are some characteristics with microservice architecture?

A

Many small components (services) makes the architecture flexible, scalable and maintainable.

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

What does it mean that Microservice architecture is use case driven?

A

The solution is organised around business capabilities and needs that it should perform.

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

What is simple routing when talking about Microservice architecture?

A

do not require complex system for routing, its based on a simple request/response pattern. (unlike SOA with ESB)

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

What does it mean that microservice architecture is decentralised?

A

That information is not in one central place or ressource. its divided out onto many services.

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

Why is microservice architecture failure resistant?

A

There are often multiple instances of each microservice. The services are also most often hosted on the cloud.
The microservices are independent so even if one service goes down the rest can work.

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

When talking about SOA and microservices what can you mention about code reusability and duplication?

A

In SOA code reusability is essential.

In Microservices some code duplication will always happen. For example connection to a database.

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

What is the scope of SOA and Microservices?

A
SOA = Enterprise scope
Microservices = application scope.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When would you pick microservices?

A
  • For scalability.
  • You multiple small.
  • For flexibility.
  • For decentralisation.
  • To decouple systems.
  • To become language agnostic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why are microservices Versatile?

A

Versatile and independent

Scalability and maintainable

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

Why are microservices scalable?

A

Because they are usually hosted on cloud and more instances of the services are easily added.

17
Q

Why are Microservices maintainable?

A

Because changes in one microservice does not affect other services or functionality.

18
Q

Is it easy to globally test microservices?

A

No. To test all the microservices together requires complicated tests, and to see where it fails is hard.

19
Q

What performs better Microservices or a Monolith and why?

A

Monolith because it does not have to go outside of the program to perform tasks.

Microservices have to communicate over the network.

20
Q

What is Docker?

A

It is a program that virtualises operation systems and delivers software in packages called containers.

21
Q

What is a container?

A

It is an environment in which a program can run or be developed. It has all the requirements for a program to run and nothing more.

22
Q

What is a Docker image?

A

It is the blueprint which containers are created from.

“A Docker image is a read-only template that contains a set of instructions for creating a container”

23
Q

What is Docker registry?

A

Where Docker retrieves its images from.

A Docker registry is a storage and distribution system for named Docker images.

24
Q

What is the features with docker?

A

Easy to create environments and add host machines.

Reduces the resources needed to execute the system because it is in isolated environments.

Swarm tool - helps clustering and scheduling docker containers AKA tool helps manage containers on different computers.

Routing Mesh - another Docker tool. Doing load balancing.
- “Routing Mesh is a feature which make use of Load Balancer concepts.It provides global publish port for a given service. The routing mesh uses port based service discovery and load balancing. So to reach any service from outside the cluster you need to expose ports and reach them via the Published Port. “

Security management: Allows to save secrets and use them in certain containers from a cluster.

25
Q

What do you need to consider before using Docker?

A

The size of the app - docker is better for small discrete robust apps.

How will you update the service? Do you need to setup a pipeline?

How will you assign an URL to that service / container?

How important is security?

26
Q

What is the pros with Docker?

A

Super fast

Super flexible - as each app lives in its own environment

Solid documentations and considered industry standard

Strong features - check card 25.

Easy to setup

Integrates nicely with CI/CD and custom repos

27
Q

What are some cons with Docker?

A

Not all applications benefit from containers - Mostlysuited for discrete services

Not GUI friendly - It was designed for server-side applications that do not require a GUI

Persistent data storage is complicated - Container data disappears when the container is shut down, unless saved somewhere else

Containers are sometimes resource intensive - dependingon your usecase, containers are still subject toperformance overhead due to networking