Chapter 9 - Microservices
48 Questions
22 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is a fundamental scaling strategy for monolithic applications?

  • Decomposing into microservices
  • Implementing a service-oriented architecture
  • Scaling up on a single powerful server (correct)
  • Horizontal scaling using multiple servers

Which of the following is a disadvantage commonly associated with monolithic architectures as application features grow?

  • Complexity in testing
  • Increased deployment time
  • Single point of failure
  • Difficulty in independent scaling (correct)

In a microservices architecture, what does each microservice encapsulate?

  • A shared resource pool for efficiency
  • An API for communications with the server
  • Common data storage for all services
  • Its own data storage where needed (correct)

What methodology is suggested for identifying microservices?

<p>Domain-driven design (DDD) (D)</p> Signup and view all the answers

What is a key advantage of using a microservices architecture as systems grow?

<p>Ability to independently scale each microservice (C)</p> Signup and view all the answers

How can multiple copies of a monolithic application be scaled out?

<p>Using a load balancer to distribute requests (C)</p> Signup and view all the answers

What aspect of microservices helps address the challenges faced by monoliths during significant request volume increases?

<p>Independent service management (A)</p> Signup and view all the answers

What is a requirement for load balancers when managing stateful services in a microservices architecture?

<p>Maintaining session affinity (C)</p> Signup and view all the answers

What must be balanced when designing microservice-based applications?

<p>Purity of the domain model and costs of distributed communications (D)</p> Signup and view all the answers

Which scenario may lead to merging microservices?

<p>Requests involving excessive communications and latency (C)</p> Signup and view all the answers

What is a common method to improve local data access in microservices?

<p>Duplicating data across coupled microservices (A)</p> Signup and view all the answers

What is a potential downside of duplicating data across microservices?

<p>Additional storage capacity and development effort (D)</p> Signup and view all the answers

Why might periodic duplication of data be considered in microservice architecture?

<p>To minimize immediate data inconsistencies without extra overhead (B)</p> Signup and view all the answers

Which approach is essential for deploying microservices effectively?

<p>Facilitating easy and rapid deployment of new microservice versions (A)</p> Signup and view all the answers

Which aspect of microservices does continuous deployment influence?

<p>The ease of scalability for microservices (D)</p> Signup and view all the answers

What condition could justify the complexity of maintaining duplicated data in microservices?

<p>When performance and scalability demands grow substantially (C)</p> Signup and view all the answers

What happens when microservice C becomes overloaded?

<p>Response times increase significantly. (D)</p> Signup and view all the answers

Which issue can cause microservice A's threads to be blocked?

<p>High volume of requests to B. (C)</p> Signup and view all the answers

What is a consequence of TCP requests timing out?

<p>Errors are thrown to the caller. (D)</p> Signup and view all the answers

What often exacerbates overload situations in microservices?

<p>Clients retrying operations immediately upon failure. (A)</p> Signup and view all the answers

What may happen if the overloaded microservice continues to receive requests?

<p>Response times may continue to grow. (D)</p> Signup and view all the answers

What does the call pattern during overload situations often lead to?

<p>Cascading failures and blocked threads. (A)</p> Signup and view all the answers

What can cause hidden bugs to surface in a microservice?

<p>Increased load and resource exhaustion. (B)</p> Signup and view all the answers

What typically characterizes the nature of cascading failures in microservices?

<p>They occur due to slow response times of dependent services. (B)</p> Signup and view all the answers

What is a primary advantage of using serverless platforms for deploying microservices?

<p>Ability to scale automatically based on demand (D)</p> Signup and view all the answers

Which pattern is recommended to avoid exposing backend API changes to clients?

<p>API gateway pattern (C)</p> Signup and view all the answers

What potential issue can arise under heavy request spikes when using an API gateway?

<p>The API gateway may become a bottleneck (B)</p> Signup and view all the answers

What is an essential function of an API gateway in a microservices architecture?

<p>To unify client request routing (B)</p> Signup and view all the answers

How does the API gateway pattern relate to the facade pattern in object-oriented systems?

<p>Both simplify client interactions by hiding complexity (B)</p> Signup and view all the answers

Which of the following is NOT a functionality typically associated with API gateways?

<p>Database schema management (A)</p> Signup and view all the answers

What challenge do multiple endpoints present when deploying microservices on a serverless platform?

<p>Clients need to manage host IP addresses and ports (D)</p> Signup and view all the answers

Which of the following statements is true regarding the potential need to refactor microservices?

<p>Refactoring can merge services to reduce network calls (D)</p> Signup and view all the answers

What is the primary purpose of bulkheads in a microservice architecture?

<p>To limit damage of resource starvation (A)</p> Signup and view all the answers

In the described microservice, which type of request is typically more demanding on the system?

<p>New order requests (D)</p> Signup and view all the answers

How many threads can be reserved for new order requests in the bulkhead example?

<p>150 (D)</p> Signup and view all the answers

What problem arises when a surge of new order requests occurs in a microservice without a bulkhead pattern?

<p>Starvation of status requests (A)</p> Signup and view all the answers

Which Java library provides a bulkhead pattern implementation using Java 8 functional programming features?

<p>Resilience4j (B)</p> Signup and view all the answers

What happens to status requests when all threads in the thread pool are occupied by new order requests?

<p>They may see unacceptable response times (C)</p> Signup and view all the answers

What is the main function of the thread pool in the microservice?

<p>To handle concurrent requests (C)</p> Signup and view all the answers

What could be a potential consequence of using a fail-fast approach in the microservice?

<p>Client exceptions when resources are not available (C)</p> Signup and view all the answers

Which book provides a comprehensive introduction to Continuous Delivery?

<p>Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (A)</p> Signup and view all the answers

What is the primary focus of Part III of the referenced book?

<p>Storage layer principles and algorithms (A)</p> Signup and view all the answers

Which of the following statements is true regarding DevOps?

<p>It encompasses various platforms for build, configuration, and testing. (D)</p> Signup and view all the answers

Who emphasizes the advantages of standardizing the development stack across microservices?

<p>Susan Fowler (C)</p> Signup and view all the answers

What should be considered when interpreting performance benchmark results from API gateways?

<p>The studies are performed by vendors, implying potential bias. (A)</p> Signup and view all the answers

Which database focuses are discussed regarding distributed systems?

<p>Scalability, availability, and consistency (B)</p> Signup and view all the answers

What is an essential resource for finding current information about DevOps tools?

<p>Your favorite search engine (D)</p> Signup and view all the answers

Which book was published in 1994 and focuses on design patterns?

<p>Design Patterns: Elements of Reusable Object-Oriented Software (A)</p> Signup and view all the answers

Flashcards

Monolithic Application

A single, large application package that manages all components of a software system.

Microservices Architecture

Breaking down an application into multiple, independent, and self-contained services that communicate and coordinate.

Scaling Up (Monolithic)

Increasing the resources of a single server to handle more requests (for a monolithic application).

Scaling Out (Monolithic)

Adding more servers and using a load balancer to distribute requests across multiple servers to handle growing demand in a monolithic app.

Signup and view all the flashcards

Microservices Scalability

Individual services can be scaled independently, meaning you can add or remove resources for each service based on its specific needs.

Signup and view all the flashcards

Bounded Context (DDD)

A way to divide a system's functionality into distinct areas of concern, each suitable for a microservice.

Signup and view all the flashcards

Microservice API

A set of publicly available methods and resources for each microservice to interact with other services in a microservice architecture.

Signup and view all the flashcards

Self-Contained Microservice

A microservice that encapsulates its own data storage and functionality, independent of other services, reducing dependencies among microservices, improving scalability/flexibility.

Signup and view all the flashcards

Microservice Balancing

Finding the right balance between the benefits of microservices (like independent deployment) and the costs of distributed communication and complexity of management.

Signup and view all the flashcards

Distributed Communications Cost

The extra time and potential problems caused by data transfer between microservices.

Signup and view all the flashcards

Domain Model Adjustment

Modifying the way data is structured in microservices to deal with the reality of distributed communications.

Signup and view all the flashcards

Duplicate Data

Keeping identical copies of data in different microservices to speed up data access.

Signup and view all the flashcards

Data Consistency

Making sure all copies of duplicated data stay the same.

Signup and view all the flashcards

Microservice Deployment

The process of releasing new versions of microservices to production.

Signup and view all the flashcards

Continuous Deployment

A process of frequently releasing new code or updates without manual intervention.

Signup and view all the flashcards

Microservices Deployment on Serverless Platform

A microservice deployment approach where each microservice exposes its API on a serverless platform.

Signup and view all the flashcards

API Gateway Pattern

A design pattern where a single entry point (API gateway) handles all client requests to microservices.

Signup and view all the flashcards

Client Insulation

API gateways isolate clients from changes in the underlying microservice architecture and deployment.

Signup and view all the flashcards

API Gateway's Role

API gateways act as intermediaries between clients and microservices, routing requests and managing access.

Signup and view all the flashcards

Microservice Refactoring

The process of modifying or restructuring the microservices to improve functionality or maintainability.

Signup and view all the flashcards

Scalability Concerns (API Gateway)

API gateways might become bottlenecks during periods of high traffic.

Signup and view all the flashcards

API Gateway Implementations

Various open-source and cloud-vendor-specific solutions that handle API gateway functionalities.

Signup and view all the flashcards

Client-Side Impact in Microservice Refactoring

Changes in microservice architecture or deployment should not directly affect the client interaction.

Signup and view all the flashcards

Cascading Failures

A series of failures that occur in a system when one failure triggers other failures in dependent services. This happens when overloaded services slow down and cause delays, leading to cascading effect throughout the system.

Signup and view all the flashcards

Overload Situation

When a service receives more requests than it can handle, leading to performance degradation, increased response times, and potential instability.

Signup and view all the flashcards

Retry Logic

Code that attempts to re-execute an operation if it fails, often used to handle temporary network issues or transient errors. It can worsen performance by increasing load on a failing service.

Signup and view all the flashcards

Fixed-size Thread Pool

A pool of threads with a fixed number of threads, used by application servers to handle incoming requests. Once all threads are occupied, new requests are queued until a thread becomes available.

Signup and view all the flashcards

TCP Request Timeout

A situation where a TCP request fails to receive a response within a specific time limit, causing the request to time out and generate an error.

Signup and view all the flashcards

Delayed Responses vs. Failures

Overloaded services produce delayed responses rather than immediate failures. This makes cascading failures more insidious as it takes time for the problem to fully manifest.

Signup and view all the flashcards

Exacerbating Overload

Retry logic can worsen overload because repeated attempts increase the load on a failing service, making it harder to recover.

Signup and view all the flashcards

Recovery Time

The time it takes for an overloaded service to return to a stable state and resume normal operations.

Signup and view all the flashcards

Bulkhead Pattern

A strategy that isolates different parts of an application to prevent failures in one part from affecting others. It's like having separate compartments in a ship to prevent flooding.

Signup and view all the flashcards

Thread Pool Starvation

When a thread pool is overwhelmed with requests from one type of task, other tasks are unable to access threads and are delayed or fail. Like a line of people trying to enter an elevator that's already full.

Signup and view all the flashcards

Microservice Thread Pool

A group of threads dedicated to handling requests for a specific microservice. Each thread can handle a single request.

Signup and view all the flashcards

Bulkhead Thread Pool

A thread pool reserved exclusively for a specific type of request, like in our example, new order requests. This ensures that other requests can still be processed even when a surge of specific requests occurs.

Signup and view all the flashcards

How does the bulkhead pattern help?

It prevents a sudden burst of requests for one service from impacting the performance of other services within the same thread pool. This ensures better performance and reliability.

Signup and view all the flashcards

Resilience4j Library

A Java library that provides an implementation of the bulkhead pattern, allowing you to manage thread pools for different tasks.

Signup and view all the flashcards

Concurrent Requests Limit

The maximum number of requests that can be processed concurrently by a particular bulkhead. This helps control the resources used by a specific task.

Signup and view all the flashcards

Remote Resource Calls Segregation

The bulkhead pattern isolates requests to external services or resources, so that failures or overloads in one resource do not impact others. This ensures better overall stability and performance.

Signup and view all the flashcards

What book covers Continuous Delivery?

The book "Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation" by Jez Humble and David Farley (Addison-Wesley Professional, 2011) provides a comprehensive introduction to the concepts of continuous delivery.

Signup and view all the flashcards

What's an alternative book for DevOps information?

The book "DevOps: A Software Architect's Perspective" by Len Bass, Ingo Weber, and Liming Zhu (Addison-Wesley Professional, 2015) offers another valuable resource for understanding DevOps concepts and practices.

Signup and view all the flashcards

Where to find DevOps tools?

Search engines are the best resource for finding details about specific platforms used within DevOps pipelines, including those for building, configuring, testing, deploying, and monitoring software.

Signup and view all the flashcards

Standardization across microservices

Standardizing the development stack across multiple microservices can offer significant advantages, as explained by Susan Fowler in her book "Production-Ready Microservices" (O'Reilly, 2016).

Signup and view all the flashcards

Design Patterns

The book "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma et al. (Addison Wesley Professional, 1994) offers a comprehensive exploration of design patterns for software development.

Signup and view all the flashcards

API Gateway Benchmarking

An NGINX study (provided in the book) benchmarks the performance capabilities of API gateways. However, it's crucial to exercise caution when interpreting results as they are conducted by a vendor.

Signup and view all the flashcards

Scaling Microservices Performance

Certain limitations in microservices can be potentially addressed and increased through scaling. This involves adapting the architecture and resources to meet growing demands.

Signup and view all the flashcards

Data Stores in Distributed Systems

This book focuses on the principles and techniques for distributing data stores, aiming to achieve scalability, availability, and consistency. It explores how popular databases operate in distributed systems, highlighting architectural trade-offs.

Signup and view all the flashcards

Study Notes

Microservices and Pizza

  • Microservices are a software architectural style linked to pizza's popularity.
  • The "two-pizza rule" at Amazon established a limit on team size for managing a single system component, becoming a microservice.

Defining Microservices

  • Microservices are finely-grained, highly cohesive, and loosely coupled services focused on a business capability, not necessarily smaller than a service.
  • They are independently deployed and must communicate to handle requests, making them distributed systems.
  • Microservices deal with issues like scalability, performance, and availability.

Advantages of Microservices

  • Microservices enable quick iteration and feature evolution by agile teams.
  • Each microservice acts as a black box, allowing technology choices optimized for the team and application.
  • New system functionalities are easily built as microservices without impacting other parts of the system.

Monolithic Applications

  • Traditional applications are monolithic, with all modules, services, and capabilities contained in a single application.
  • They are easily understood, offer extensive automation in frameworks, and straightforward deployment & management.

Scaling Monoliths

  • Scaling up involves improving processing power on a single server for better responsiveness.
  • Scaling out involves distributing requests to multiple copies of the application, using load balancers for efficient handling of increasing traffic.

Monolithic Disadvantages

  • Complexity increases with application size, requiring significant engineering and refactoring efforts
  • Challenges occur in maintaining architectural integrity
  • Scaling out leads to replicating the entire application, making it complex.

Breaking Up the Monolith

  • Microservices architecture separates application functionality into independent services.
  • Each service communicates when necessary and contains its own data storage or handles data retrieval independently.
  • This allows for independent scaling of individual components.

Microservice Advantages

  • Smaller, manageable codebases which are easier to build, test, and debug that individual development teams can handle.
  • They allow for easier scaling and response-times, using separate instances of microservices to accommodate increasing demands
  • Different technologies can be used to develop individual microservices given their functions and use cases
  • Faster updates and deployment as teams can make changes without affecting other parts of the application.

Deploying Microservices

  • Serverless platforms (e.g., cloud computing services) offer a simpler deployment process for microservices since microservices packages are uploaded to function environments.
  • Deploying microservices allows for reduced costs incurred in handling low-volume requests.
  • Deployment also increases scalability, since the platform handles scaling issues automatically when a program is deployed to a serverless platform.

API Gateways

  • API gateways act as a central entry point for all client requests, insulating clients from the underlying service implementations.
  • This allows decoupling client interactions from changes in the internal service architecture.
  • They offer valuable capabilities such as rate limiting, authentication, and authorization.

Isolating Failure

  • Microservices should be independently deployable such that if a component fails, it will not affect the entire application.
  • Microservices are designed such that the failure of one microservice should not affect other microservices

Circuit Breaker Pattern

  • The circuit breaker pattern isolates failures by stopping requests from failing microservices, and providing a predetermined amount of time for a service to recover.
  • Transient errors or temporary service outages are handled by the circuit breaker pattern.

Bulkhead Pattern

  • The bulkhead pattern assigns specific requests to isolated components to prevent failures in one component from affecting others, when high demand is encountered/experienced.

Microservice Principles

  • Modeled around business domains (DDD).
  • Highly observable (monitoring).
  • Hide implementation details (APIs).
  • Decentralize all components.
  • Isolate failure.
  • Deploy independently.
  • Culture of automation.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Chapter 9. Microservices PDF

Description

Test your knowledge on microservices and their comparison to traditional monolithic applications. Explore concepts like the two-pizza rule, advantages of microservices, and their role in scalability and performance. Discover how microservices can enhance agile development teams.

More Like This

Use Quizgecko on...
Browser
Browser