Lesson 5: Microservices Flashcards

1
Q

What does it mean if we want to design our application as loosely coupled microservices?

A
  • small functionality granularity organized around capabilities
  • Lightweight communication protocols
  • Independently deployable and replaceable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are fat services?

A
  • slow development
  • scalability issues
  • reusability issues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a microservice?

A

A way of designing software applications as suites of independently deployable services

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

Give some characteristics of microservices

A
  • Built around business capabilities
  • Independently deployable by fully automated deployment machinery
  • Bare minimum of centralized management
  • Written in different programming languages
  • Using different data storage technologies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are advantages of the monolith design?

A
  • Well known layered architecture
  • IDE-friendly
  • Easy sharing, simplified testing, easy deployment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are disadvantages of the monolith design

A
  • Limited agility
  • Obstacle for continuous delivery
  • Stuck with a technology stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why choose services over libraries?

A
  • services are independently deployable
  • changes in libraries = redeploying entire application
  • explicit component interface when using services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a component and which variants do we know?

A

Component = unit of software that is independently replaceable or upgradable

  • libraries = linked into a program
  • services = out of process component
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the Enterprise Service Bus do?

A

Sophisticated message routing, choreography, transformation and business rule application

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

Describe decentralized governance.

A
  • Each service picks the right technology
  • Service contracts define the interfaces
  • Allows for different conceptual models, even of the same entity
  • Polyglot persistence
  • Transaction-less so cope with eventual consistency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the goal of the Reactive Manifesto?

A

To condense knowledge on how to design highly scalable and reliable applications

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

What are the three steps of continuous delivery automation?

A
  • Continuous integration:
    integrating, building and testing code within the development environment
  • Continuous Deliver:
    Software can be released to production at any time
  • Continuous Deployment:
    Software is automatically pushed into production
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which 4 architectural traits are there in the Reactive Manifesto?

A
  • Message Driven
  • Responsive
  • Elastic
  • Resilient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the “Message Driven” trait in the Reactive Manifesto?

A
  • Asynchronous message-passing between components
     Addressable recipients await the arrival of messages and react to them
     Establish a boundary that enables loose coupling, isolation and location transparency
  • Enables load management, elasticity and flow control by monitoring and shaping the message queues in the system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the “Responsive” trait in the Reactive Manifesto?

A
  • The system responds in a timely manner (aim: 0.1 seconds)
     Client side: lazy loading – first load important stuff and show it ASAP
     Show progress
     Individual slow performing service should not slow down others
  • As far as users know, when the response time exceeds their expectation the system is down
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the “Elastic” trait in the Reactive Manifesto?

A
  • System stays responsive under varying workload
     Changes in input rate lead to increased or decreased resource allocations
     No contention points or central bottlenecks
     Distribution of input amongst components
  • An elastic system can allocate / deallocate resources for every individual component dynamically to match demand
  • Predictive and reactive elastic scaling
17
Q

What is the “Resilient” trait in the Reactive Manifesto?

A
  • Any service can fail
  • Detect failures quickly by monitoring and automatically restore services when issues are detected
     Service metrics (request/seconds)
     business metrics (orders per minute received)
  • Provide fallback services
18
Q

Which components are there in the Simian Army of Netflix and what do they do?

A

 Chaos Monkey
* Introducing random failures in their production AWS services
* Team of engineers ready to intervene
 Latency Monkey
* Introducing artificial delays
 Janitor Monkey
* Seeks unused resources and disposes of them
 Security Monkey
* Seek misconfigured services / security issues

19
Q

How do you build a future proof distributed architecture from an architectural view?

A
  • Step 1: Split your application idea into logic containers (groups)
  • Step 2: Make these containers truly independent
  • Step 3: define REST APIs & connections
20
Q

How do you build a future proof distrubuted architecture from a deployment view?

A
  • Step 1: Choose which technology & platform is most suited for each microservice
  • Step 2: Package each service in a container
  • Step 3: Let Kubernetes manage the containers + setup scaling rules
  • Step 4: Deploy them on your cloud or infrastructure
21
Q

When we say a container is lightweight, what do we mean by that?

A
  • No entire OS in each container
  • Sharing of bins and libraries
  • Provisioned/instantiated in milliseconds to seconds
  • Minimal per-container penalty
  • “ just enough OS” on the server
22
Q

What are some pros of using a container

A

 No performance hit due to emulation of instructions
 Flexibility (containerize a ‘system’, containerize ‘application’)
 Lightweight

23
Q

What are cons of using a container?

A

 No performance hit due to emulation of instructions
 Flexibility (containerize a ‘system’, containerize ‘application’)
 Lightweight

24
Q

Compare Virtual Machines and Containers

A
  • VMs
     Virtualization of hardware
     Flexible, robust and safe, but big performance hit
  • Containers
     Lightweight
     Better use of resources (sharing host OS an potentially binaries/libraries)
25
Q

Give the container checklist

A
  • Processes
  • Throttling/limits
  • Prioritization
  • Resource isolation
  • Root file system
  • Security
26
Q

How do I throttle, prioritize, control and obtain metrics for a group of tasks?

A

By using control groups

27
Q

How do I provide an isolated view of global resources to a group task?

A

By using namespaces.

=> Create abstraction of a system resource and make it appear as a separated instance to processes within a namespace

28
Q

What do control groups do/control ?

A
  • Device Access
     Limit device visibility; isolation
     Segment device access
     Device whitelist/blacklist
  • Resource Limiting
  • Prioritization: who gets more of the CPU, memory
  • Accounting: resource usage per group
  • Control: freezing and checkpointing
  • Injection: packet tagging