MicroServices Flashcards

1
Q

What are microservices?

A

Decomposing an application’s processes into separate services that work together independently of one another to process user requests.

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

Advantages to microservices

A
  • Services are independently deployable and scalable
  • It allows for different services to be written in different programming languages.
  • Scalability and reusability
  • Work well with containers such as Docker
  • Better fault isolation; if one microservice fails, the other will continue to work
  • Handling traffic well - instances of services created as needed
  • Loose coupling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Disadvantages to microservices

A
  • DevOps complexity - Due to several moving parts of the application. It becomes complex.
  • Increased Resource use - Initial investment to run these applications are high because all the independently running components need their own containers
  • Ease overhead - people need to communicate to make sure update doesn’t occur error on other services, Cost to monitor each individual service
  • Databases are more difficult to keep normalized
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is eureka?

A
  • client side discovery pattern
  • client obtains the location of a service instance by querying a service registry, which knows the locations of all service instances.
  • Ribbon creates requests by load balancing algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is zuul?

A
  • Zuul acts as an API gateway. It receives all the requests coming from the UI and then delegates the requests to internal microservices.
  • The client calls this service as a proxy for an internal microservice, then this service delegates the request to the appropriate service
  • The advantage of this type of design is that common aspects like CORS, authentication, and security can be put into a centralized service.
  • we can implement any routing rules or any filter implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a configuration server?

A
  • Configuration server to centralise management of all the configuration files
  • mainly responsible for providing properties files to each microservice connected to the discovery server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Hystrix?

A
  • Circuit breaker module
  • wrap a protected function call in a circuit breaker object, monitors for failures,. and when it happen it trips and further calls to circuit breaker return an error without call being made at all. This will prevent cascade error across multiple system by run out of critical resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is docker?

A

Docker is a computer program that performs operating-system-level virtualization also known as containerization

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

Annotations of Eureka and what they do?

A
  • @EnableEurekaServer - to stand up a registry that other applications can talk to
  • @EnableEurekaClient - to in the list of registered applications
  • @EnableZuulProxy - sets up Zuul so that you can configure routing without Eureka; will turn the Gateway into a reverse proxy that forwards relevant calls to other services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does Zuul employ discovery for the routes to services?

A

@EnableDiscoveryClient - to be used with Discovery to enable dynamic routing

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

Annotations of Hystrix and what they do?

A
  • @HystrixCommand(fallbackMethod = “methodName”) - place this annotation above a method you want Spring Cloud Netflix Hystrix to look for
    • The annotation wraps that method in a proxy connected to a circuit breaker so that Hystrix can monitor it
    • ONLY WORKS in a class marked with @Component or @Service
    • Example of fallbackMethod is reliable; specify it to provide a placeholder of what you need for users
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is spring boot?

A

Opinionated view of the Spring platform to make it easy to configure Spring applications for various use cases.

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

What is spring data?

A

Spring module for abstracting database connection and querying operations using Hibernate as its ORM (Object Relational Mapper)

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

What is the docker workflow?

A
  • code app
  • make a docker file
  • build an image using the docker file
  • run a container from the image
  • push to docker hub if you want
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a docker image?

A

A snapshot of the system that contains everything needed to run the application on any machine. Build code plus the needed environment.

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

What is docker hub?

A

A cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts.

17
Q

What is a docker file?

A

A text document that contains a list of steps to preform to create a docker image.

18
Q

What are some keywords in the docker file?

A
  • FROM-used to define the base image
  • COPY-where to copy the base image from
  • EXPOSE- which port to use
19
Q

What are the two ways volumes work?

A

One enables communication and persistence between containers and the other lets you share folders between hosts and containers which is good for development.