Cross cutting concerns Flashcards

1
Q

Cross cutting concerns

A

Microservice chassis

Externalized configuration

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

Microservice chassis: context

A

When you start the development of an application you often spend a significant amount of time putting in place the mechanisms to handle cross-cutting concerns. Examples of cross-cutting concern include:

  • Externalized configuration - includes credentials, and network locations of external services such as databases and message brokers
  • Logging - configuring of a logging framework such as log4j or logback
  • Health checks - a url that a monitoring service can “ping” to determine the health of the application
  • Metrics - measurements that provide insight into what the application is doing and how it is performing
  • Distributed tracing - instrument services with code that assigns each external request an unique identifier that is passed between services.

Even though in a monolith application this first configuration is insignificant as a spend of time. In a microservice architecture there will have many services, this time must be taken in account.

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

Microservice chassis: forces

A

Creating a new microservice should be fast and easy
When creating a microservice you must handle cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.

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

Microservice chassis: solution

A

Build your microservices using a microservice chassis framework, which handles cross-cutting concerns

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

Microservice chassis: example

A

Examples of microservice chassis frameworks:
Spring Boot and Spring Cloud
Dropwizard
Gizmo

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

Microservice chassis: result

A

The major benefit of a microservice chassis is that you can quickly and easy get started with developing a microservice.

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

Microservice chassis: drawback

A

You need a microservice chassis for each programming language/framework that you want to use. This can be an obstacle to adopting a new programming language or framework.

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

Microservice chassis: related

A

Microservices - this pattern motivates the need for the Microservice Chassis pattern
Self Registration - the microservice chassis is often responsible for registering the service with the service registry
Client-side discovery - the microservice chassis is often responsible for client-side service discovery
Circuit Breaker - the microservice chassis framework might implement this pattern
Distributed tracing - the microservice chassis framework might instrument the code

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

Externalized configuration: context

A

An application typically uses one or more infrastructure and 3rd party services. Examples of infrastructure services include: a Service registry, a message broker and a database server. Examples of 3rd party services include: payment processing, email and messaging, etc.

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

Externalized configuration: problem

A

How to enable a service to run in multiple environments without modification?

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

Externalized configuration: forces

A

A service must be provided with configuration data that tells it how to connect to the external/3rd party services. For example, the database network location and credentials
A service must run in multiple environments - dev, test, qa, staging, production - without modification and/or recompilation
Different environments have different instances of the external/3rd party services, e.g. QA database vs. production database, test credit card processing account vs. production credit card processing account

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

Externalized configuration: solution

A

Externalize all application configuration including the database credentials and network location. On startup, a service reads the configuration from an external source, e.g. OS environment variables, etc.

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

Externalized configuration: examples

A

Spring Boot externalized configuration reads values from a variety of sources including operating system environment variables, property files and command line arguments. These values are available within the Spring application context.

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

Externalized configuration: result benefits

A

The application runs in multiple environments without modification and/or recompilation

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

Externalized configuration: issues

A

How to ensure that when an application is deployed the supplied configuration matches what is expected?

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

Externalized configuration: related

A

The service discovery patterns, Server-side service discovery and Client-side service discovery, solve the related problem of how a service knows the network location of other application services.