Microservices Architecture
71 Questions
0 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

Which of the following best describes the primary shift in focus when moving from traditional eServices to REST architectural style?

  • From interface-centric design to an emphasis on communication and protocols. (correct)
  • From resource-oriented conversation to an emphasis on interface definition.
  • From focusing on proprietary protocols to relying exclusively on TCP/IP.
  • From prioritizing communication protocols to emphasizing interfaces.

A development team is tasked with updating a core library used by multiple microservices. What potential challenge should they anticipate, based on the principles of microservices architecture?

  • Potential impact on multiple independent services, requiring careful testing and deployment strategies to mitigate risks. (correct)
  • The need for coordination with other teams to ensure compatibility and avoid breaking changes, emphasizing tight coupling.
  • Ensuring that all microservices can be updated simultaneously to maintain system consistency.
  • Increased reliance on ESBs to manage dependencies, increasing complexity of the update process.

An organization is transitioning from a monolithic application to a microservices architecture. What is a key consideration regarding database management in the new architecture?

  • Using distributed transactions to maintain data consistency across services.
  • Ensuring every service can directly access all the data in the legacy monolithic database
  • Each microservice should have distinct schema to follow single responsibility principle. (correct)
  • Enforcing a single, enterprise-wide data model across all microservices.

In a microservices architecture, what is the primary role of an API Gateway?

<p>To handle cross-cutting concerns such as load balancing, authentication, and monitoring. (C)</p> Signup and view all the answers

A company is considering adopting microservices. What should they consider regarding team structure, based on microservices principles?

<p>Small, cross-functional teams aligned with individual microservices. (D)</p> Signup and view all the answers

An organization is decomposing a monolithic application into microservices. What strategy can help identify service boundaries based on business needs?

<p>Decompose by business capability to align services with specific business functions. (A)</p> Signup and view all the answers

While microservices offer many advantages, what is a key challenge introduced by this architectural style?

<p>Increased operational overhead due to distributed nature. (B)</p> Signup and view all the answers

What does 'Single Responsibility Principle' mean in the context of microservices design?

<p>Each microservice should have one reason to change, focusing on a specific business function. (B)</p> Signup and view all the answers

Which of the following is a significant advantage of microservices concerning technology choices?

<p>Ability to choose the best technology for each service, promoting innovation. (D)</p> Signup and view all the answers

An organization wants to improve the resilience of their application. How can microservices architecture contribute to this goal?

<p>Isolating failures so that one failing service doesn't bring down the entire application. (D)</p> Signup and view all the answers

In Y-axis scaling, how is an application scaled?

<p>By splitting the application into multiple, different services. (A)</p> Signup and view all the answers

What is a key consideration when implementing changes that span multiple microservices?

<p>Planning and coordinating the rollout of changes to each service to maintain system integrity. (D)</p> Signup and view all the answers

What is a major difference in deployment strategy between a monolithic application and a microservices-based application?

<p>Microservice application consists of a large number of services with multiple runtime instances. (C)</p> Signup and view all the answers

What is a common approach to automating the deployment of microservices?

<p>Using off-the-shelf Platform as a Service (PaaS) solutions and clustering solutions. (D)</p> Signup and view all the answers

What is meant by Permissionless Innovation in the context of microservices?

<p>Enabling teams to create new functionalities on top of existing services without centralized approval. (C)</p> Signup and view all the answers

What is a key goal of leveraging a microservices architecture with regards to system failures?

<p>To ensure that the entire system remains operational even if a small subset of services fail. (A)</p> Signup and view all the answers

Which of the following is a key advice given by Martin Fowler regarding the adoption of microservices?

<p>Consider microservices only if you have a system that's too complex to manage as a monolith. (D)</p> Signup and view all the answers

What is meant by the term pattern in software architecture?

<p>Reusable solution to a problem that occurs in a context. (B)</p> Signup and view all the answers

In pattern structure, what does the 'Forces' section describe?

<p>The issues that you must address when solving a problem (C)</p> Signup and view all the answers

Which of the following is a type of relationship between patterns?

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

Which of the following concerns does application infrastructure patterns deal with?

<p>Security and Observability (A)</p> Signup and view all the answers

Consider the context of hexagonal architecture style, which of the following is true?

<p>Adapters depends upon business logic (A)</p> Signup and view all the answers

Which of the following best describes the key difference between Monolithic architecture and Micorservice architecture?

<p>Microservice is collection of loosely coupled, independantly deployable services (C)</p> Signup and view all the answers

According to the material, what is the description of a service in context of Microservices Architecture?

<p>Standalone, independently deployable software component. (D)</p> Signup and view all the answers

Which the following best describes the bounded context in DDD?

<p>It includes the code artifacts that implement the model. (C)</p> Signup and view all the answers

In order to organize services, what are the main strategies?

<p>Business capabilities and Domian-driven design subdomains. (C)</p> Signup and view all the answers

Which of the following is an example of synchronous Inter-Process Communication?

<p>HTTP based REST (B)</p> Signup and view all the answers

Which of the following is a functionality to protect the system?

<p>Networking timeout (C)</p> Signup and view all the answers

What async message contains?

<p>All of the above except C (D)</p> Signup and view all the answers

Which the following of communication async pattern?

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

What's are the type of message channels?

<p>point-to-point and publish-subscribe (B)</p> Signup and view all the answers

When transitioning from a monolithic application to a microservices architecture, which aspect requires the MOST significant change in approach?

<p>Database management and data consistency. (B)</p> Signup and view all the answers

In the context of database architecture, why are distributed transactions generally discouraged in microservices?

<p>They hinder independent deployment and scalability. (C)</p> Signup and view all the answers

What is the main reason for designing microservices according to business capabilities?

<p>To align services closely with business functions for easier maintenance and evolution. (C)</p> Signup and view all the answers

How does the concept of 'bounded context' from Domain-Driven Design (DDD) relate to microservices?

<p>Each microservice should define one its bounded context (C)</p> Signup and view all the answers

What is one of key principle to ensure a robust microservice?

<p>The limit has been reached, it's probably pointless to make additional requests, and those attempts should fail immediately. (D)</p> Signup and view all the answers

All true about Circuit Breaker pattern, EXCEPT?

<p>Sends more requests if the service is unavailabl (B)</p> Signup and view all the answers

In a microservices architecture, how does the 'Inter-Process Communication' (IPC) typically occur?

<p>Using messaging queues or synchronous calls like HTTP/REST. (D)</p> Signup and view all the answers

When designing microservices based on business capabilities, what is a crucial aspect to consider?

<p>Defining services that reflect specific functions within the business domain. (D)</p> Signup and view all the answers

What is the primary goal of 'permissionless innovation' in the context of microservices?

<p>To allow different groups to innovate on top of existing communication patterns. (A)</p> Signup and view all the answers

When a system is described as having a 'single responsibility', what does this typically mean for microservices?

<p>Every module or class focuses on only one part of the overall functionality. (A)</p> Signup and view all the answers

How does the concept of 'bounded context' in Domain-Driven Design (DDD) relate to the design of microservices?

<p>It helps determine service boundaries by aligning with business capabilities. (D)</p> Signup and view all the answers

Which of the following is a key benefit directly resulting from the independent deployability of microservices?

<p>Faster deployment cycles and easier updates. (D)</p> Signup and view all the answers

What is the primary purpose of 'service discovery' in a microservices architecture?

<p>To automatically locate and communicate with available service instances. (D)</p> Signup and view all the answers

In the context of microservices, what does 'evolutionary design' emphasize?

<p>The importance of being easy to refactor them. (C)</p> Signup and view all the answers

When is it appropriate to consider microservices architecture, according to Martin Fowler's recommendation?

<p>When you have a system that's complex for a monolith. (C)</p> Signup and view all the answers

What is a major challenge introduced by the partitioned database architecture often used with microservices?

<p>Business transactions that update multiple business entities. (C)</p> Signup and view all the answers

What does the concept of 'forces' refer to within the structure of a software pattern?

<p>The issues that you must address when solving a problem. (D)</p> Signup and view all the answers

What does 'Duplication' means in context of microservices?

<p>It often results in duplication of some data. (A)</p> Signup and view all the answers

What is the main advantage of using asynchronous messaging in a microservices architecture?

<p>Improved scalability and resilience through loose coupling. (B)</p> Signup and view all the answers

What is the primary benefit of adhering to the pattern of 'Decompose by business capability' in microservices architecture?

<p>Ensure close alignment of services to business needs and priorities. (B)</p> Signup and view all the answers

In what kind of situation would a team usually apply the circuit breaker pattern to a microservice?

<p>When a service needs to be shielded to other services. (A)</p> Signup and view all the answers

In contrast to monolithic architecture, one of the goals of microservice is?

<p>To offer the autonomy of developers to choose whatever technologies make sense. (A)</p> Signup and view all the answers

When designing a microservice, what describes the high-level domain model?

<p>Creating key Classes. (B)</p> Signup and view all the answers

What does 'The Hidden Dividends' means?

<p>Ability of others to create new things on top of the communications constructs that we create. (B)</p> Signup and view all the answers

What does mean that each microservice is a mini‐application?

<p>Its interface an API to other microservices,and Web UI. (A)</p> Signup and view all the answers

Within a microservice architecture, what does the 'application infrastructure pattern' typically address?

<p>Issues such as deployment, service discovery, and external APIs. (D)</p> Signup and view all the answers

In microservice architecture, what approach should organizations take regarding technology lock-in?

<p>Each service team is free to choose tools/technology but honoring API contract. (A)</p> Signup and view all the answers

In the context of microservices, what is a key focus when adopting asynchronous communication?

<p>Improving scalability and resilience by minimizing dependencies. (A)</p> Signup and view all the answers

In a Microservice Architecture, is the following is true regarding databases?

<p>Each service has its own database schema. (C)</p> Signup and view all the answers

What are the main difference between traditional eServices and REST architectural style?

<p>The focus has moved from interfaces to communication and conversation. (B)</p> Signup and view all the answers

Considering large-sized monoliths, what is true?

<p>Are difficult to maintain and evolve. (B)</p> Signup and view all the answers

When decomposing a monolithic application into microservices, what are we hoping to create?

<p>A set of smaller, interconnected service (C)</p> Signup and view all the answers

Regarding the Microservices Architecture, is similar to what?

<p>Pattern is similar to SOA. (B)</p> Signup and view all the answers

Are advantages of microservices?

<p>Replaceability and Compossability. (D)</p> Signup and view all the answers

Regarding to 'You Build It, You Own It'?

<p>Has a team associated with it, and that team is responsible for the microservice. (D)</p> Signup and view all the answers

The Microservices implements a client/server focusing on what?

<p>On resources (products in business terms). (C)</p> Signup and view all the answers

In microservices architecture, what is the role of 'Related patterns'?

<p>The five different types of relationships. (D)</p> Signup and view all the answers

What does the Y-axis scaling consist on?

<p>Splitting the application into multiple, different services. (D)</p> Signup and view all the answers

What is the primary benefit of the hexagonal architectural style in the context of microservices?

<p>To improve the isolation between the application's logic and its external dependencies. (C)</p> Signup and view all the answers

Each microservice expose what for interactions?

<p>Its API. (A)</p> Signup and view all the answers

Flashcards

Traditional Systems

Traditional systems are single client/server systems developed top-down.

Tight Coupling

A single organization maintains the entire system.

Loose Coupling

Each component is maintained independently from the others.

Component Flexibility

Components can serve different systems in different ways.

Signup and view all the flashcards

Shift from Interfaces

Focus is on communication and conversation protocols

Signup and view all the flashcards

The Web as Infrastructure

The Web is the de-facto communication infrastructure.

Signup and view all the flashcards

REST and Resources

The Web implements focusing on resources.

Signup and view all the flashcards

HTTP's role

HTTP is the core protocol for connecting services.

Signup and view all the flashcards

Microservice Focus

Services are small and do one thing well

Signup and view all the flashcards

Microservice Autonomy

Components are autonomous and independent.

Signup and view all the flashcards

Team Size for Microservices

Small enough to be handled by a single cross-functional team.

Signup and view all the flashcards

Functionality Segregation

Microservices architecture puts each element of functionality into a separate service

Signup and view all the flashcards

Independent Deployment

Microservices architecture ensures each service an independent unit of deploy

Signup and view all the flashcards

Accelerated Delivery

Microservices accelerates delivery by minimizing communication and coordination between people while reducing the scope and risk of change

Signup and view all the flashcards

Lightweight Protocols

Microservice-based applications favor simpler, lightweight protocols such as REST.

Signup and view all the flashcards

Business Capabilities

Microservices are organized around business capabilities

Signup and view all the flashcards

High Cohesion

High cohesion facilitates management and maintenance

Signup and view all the flashcards

Low Coupling

Low coupling facilitates coordination

Signup and view all the flashcards

Team Responsibility

Development team takes full responsibility for the software in production.

Signup and view all the flashcards

Evolutionary Design

Recognizes the difficulties of getting boundaries right

Signup and view all the flashcards

Y-axis scaling

splitting the application into multiple, different services

Signup and view all the flashcards

X-axis scaling

Running multiple copies of an application behind a load balancer.

Signup and view all the flashcards

Z-axis scaling

Each server is responsible for only a subset of the data

Signup and view all the flashcards

Complexity

Implementing changes that requires changes to services

Signup and view all the flashcards

High cohesion for microservices

Implementing changes that span multiple services is difficult and requires high cohesion.

Signup and view all the flashcards

Automation

Requires a high level automation for running all instances successfully

Signup and view all the flashcards

Forces

Code must be easy to understand and have good performance

Signup and view all the flashcards

Pattern structure

describes the forces that you must address when solving a problem

Signup and view all the flashcards

Predecessor

Patterns that motivates the need for this pattern.

Signup and view all the flashcards

Successor

Patterns that solves an issue that has been introduced by this pattern

Signup and view all the flashcards

Analyzing nouns

High level domain model

Signup and view all the flashcards

Domain model

Use standard techniques to collect and analyze information from the microservice

Signup and view all the flashcards

Microservice

A standalone, independently deployable software component.

Signup and view all the flashcards

Loosely Coupled Services

The services must be loosely coupled.

Signup and view all the flashcards

Defining Services

The steps in defining the microservices architecture

Signup and view all the flashcards

Distill requirments

Distill the application's requirements.

Signup and view all the flashcards

Business operationss

External requests should be extracted from the user stories

Signup and view all the flashcards

Business operationss

Defines services corresponding to business capabilities.

Signup and view all the flashcards

IPC

The application's microservice architecture needs good inter-process communication.

Signup and view all the flashcards

IPC definition

A high level over view and description of the inter-process communication

Signup and view all the flashcards

Collaboration

Each step for defining each service

Signup and view all the flashcards

Study Notes

Microservices

  • Microservices refers to an approach to application development
  • Each element of functionality is placed into a separate service
  • Each service is deployed independently
  • Microservices relies on software engineering principles and best practices
  • Low coupling and high cohesion are important aspects of microservices
  • Asynchronous communication is used

History

  • Traditional distributed systems are single, client/server based, and developed top-down
  • Contemporary distributed systems need to include third-party sub-systems, such as insurance contracts and event tickets
  • Traditional eServices relied on TCP/IP and proprietary protocols
  • The focus has moved from interfaces to communication and protocols, and the Web is the de-facto communication infrastructure
  • REST architectural style is the current trend for building applications

Advantages

  • Microservices accelerate delivery by minimizing communication and coordination between people and change
  • It is SOA without the commercialization
  • Microservices are about people
  • Microservices emphasize small, focused components that are autonomous and independent
  • They are small enough to be handled by a single cross-functional team in a business area
  • Microservices are composable, replaceable, and offer deployment benefits with lower risk
  • Microservices allow for selective scaling, improve resilience against failure, and alignment with the organization structure
  • Composability refers to the ability to construct complex systems by combining simpler components
  • Replaceability refers to the ability to exchange components without affecting other parts of the system
  • Deployment involves smaller pieces with decreased risk

Disadvantages

  • They may also add complexity for simplicity, as there is no silver bullet for every problem
  • Microservice-based applications favor simpler, lightweight protocols such as REST
  • There are potential pitfalls if monolithic applications are not properly decomposed into microservices
  • There are added challenges like implementing changes that span multiple services

Key Points

  • Microservice-based applications avoid using ESBs and instead implement ESB-like functionality in the microservices themselves\
  • A microservice architecture is similar to SOA
  • High cohesion facilitates management and maintenance.
  • Low coupling facilitates coordination
  • With microservices, every module or class should have responsibility over a part of the functionality provided by the software
  • High cohesion enables the implementation of the service to change without impacting its clients

The Hype

  • As of March 2016, 68% of organizations were using and/or investigating microservices
  • They report a 75% drop in development lead times

Microservices Adoption Status

  • In 2020, most adopters are successful -Under 10% report "complete success", most (54%) describe their use as "mostly successful,” and 92% say "some success"
  • Many are betting big on microservices with almost a third (29%) migrating a majority of their systems (over 50%). -Respondents cite adopting containers as a reason -Teams who were using containers for microservices indicated more success in adoption
  • Also culture plays a key role

Monolithic Application

  • Core is business logic, is implemented by modules that define services, domain objects, and events.
  • The core is surrounded by adapters, the interface with the external world ie. database access, messaging, and web
  • Has logically modular architecture that is packaged and deployed monolithically
  • Is packaged as WAR files and deployed on application servers like Tomcat or Jetty.

Issues in Monolithic Software

  • It is difficult to maintain and evolve
  • It can suffer from "dependency hell,” adding or updating conflicting libraries
  • "Rebooting" is required for any change
  • It can show expensive or suboptimal delivery, for the requirement
  • CPU-intensive ideally is Amazon EC2 Compute Optimized
  • Memory-intensive would ideally be Amazon EC2 Memory optimized
  • Can represent a tech "lock-in” for developers
  • reliability problems, such as memory leaks, can potentially bring down the entire process

Architecture

  • Splits the application into a set of smaller, interconnected services.
  • Each service handles a set of features like order management, customer management, etc.
  • Each microservice is a small application that exposes: -An API for other microservices; -A Web UI.
  • Each instance is usually a cloud VM or a Docker container.
  • Some REST APIs are exposed to mobile apps, using an API Gateway.
  • It can be complex due to Developers needing to implement an inter-process communication
  • It must also be able to handle partial failures like slowness and unavailability

Other elements

  • API Gateway: Responsible for tasks such as load balancing, caching, access control, and monitoring. -Load balancing, caching, access control, API metering, and monitoring are also duties
  • Each service has its own database schema.
  • Is against the enterprise-wide data model.
  • Can result in some data duplication
  • Ensures loose coupling

Benefits of Microservices

  • Tackles the problem of complexity
  • It breaks it into manageable chunks or services
  • Helps makes it easier to understand and maintain
  • Enables each service to be developed independently
  • Free to choose whatever technologies that make sense, provided that the service and API contract
  • Ability to Rewrite an old service using current technology

Scaling

  • Microservices can scale and deploy each service on its own.
  • One can deploy a CPU-intensive image processing service on EC2 Compute Optimized instances
  • One can also setup a in-memory database service on EC2 Memory-optimized instances.
  • Microservice architecture is based on the single responsibility principle and high cohesion.

Scaling Dimensions

  • The three major dimensions for scaling: -X-axis scaling runs multiple copies of the app -Y-axis scaling splits the application into microservices -Z-axis scaling splits the data
  • Microservice architecture is an application of Y-axis scaling

Deployment

  • Deploying a microservices-based application can be more complex than using a monolithic application
  • With a monolithic application, you deploy on identical servers behind a traditional load balancer.
  • Each app instance is configured with databases/message brokers
  • With a microservice app, you have a large number of services.
  • Need 100s of “moving parts” to configure, deploy, scale, monitor

Microservice Architecture Automation

  • Automation can be done by using something Off the shelf ie. PaaS like Cloud Foundry.
  • They'll allow easier management, deployment etc
  • It lets them comply with company best practices, and compliance
  • Create your own, use containerization to help
  • Can use Kubernetes (clustering solution) & Docker (technology)

Drawbacks to Architectures

  • One can place excessive emphasis on the size of your microservice
  • Goal of microservices is to enable easy applications
  • Complexity can also be a drawback
  • The developers can pick and choose the approach to communication based on RPC messaging
  • Microservices require partitioned architecture
  • Another major drawback is the complexity that arises from the fact that a microservices application is the distributed system. -Need for inter-process communication -Handle partial failure. -All of which results in a system much more complex
  • Business needs in microservices require different databases that are owned by different systems
  • For that, one needs to update those databases which are not allowed

Microservices Adoption In 2020 and Beyond

  • Permissionless Innovation -“the ability of others to create new things on top of the communications constructs that we create".
  • Enable Failure -Mature one should enable failure
  • Disrupt Trust -Effective model for evolving orgs

Hidden dividends in microservices

  • Consist of the Build it, Own it methodology based on the idea of small teams being able to build and manage their own
  • Microservices are encouraged to use the "you build it, you own it" model
  • Deprecations
  • Easy deprecations via a clear call
  • Easily create different versions of a service, or build a new service
  • Can be used to end centralized metadata
  • Focuses on concentrate pay
  • Makes Test Differently
  • Eng team sees that as a chance to readdress tests as a team

Microservices in practice

  • A pattern is a re-usable solution to a common problem. -forces to state other ignore-able parts. -Must identify context where it belongs. -If a bad match, it may not work.
  • For the pattern, one must
  • Define their forces, the issues that have too, be addressable during the resolution -Their context
  • And related patterns.

Key Terms

  • Pattern - reusable solution to a problem
  • Forces
  • Resulting context -What benefits -Drawbacks -Issues
  • Related patterns -Predecessor -Successor -Alternative -General -Specific -Monolithic Architecture Pattern - Structure as single executable / deployable
  • One can choose between Remote Proc Invocation and async patterns

Studying That Suits You

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

Quiz Team

Related Documents

Description

This lesson explores the microservices architectural style. It covers the history of distributed systems and how microservices have evolved. The advantages of using microservices are also discussed in detail and how its faster to deliver.

More Like This

Microservices Architecture Quiz
15 questions

Microservices Architecture Quiz

WarmheartedHeliotrope avatar
WarmheartedHeliotrope
Service Mesh and Proxy Terminologies Quiz
30 questions
Microservices: Définition et Concepts
24 questions
Use Quizgecko on...
Browser
Browser