Microservices Architecture Quiz

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 are 'dynos' in the context of this platform?

  • Database management systems
  • Physical servers for application hosting
  • Serverless computing components (correct)
  • Integration tools for continuous delivery

Which programming languages are supported by the platform?

  • Ruby, Python, and Java only
  • Only Ruby and Python
  • Ruby, Python, Java, Scala, Clojure, and node.js (correct)
  • Java, Scala, and Clojure only

What is a key feature of worker dynos?

  • Run computationally intensive tasks outside the web layer (correct)
  • Store database information persistently
  • Execute user HTTP requests directly
  • React to real-time user input immediately

What is the pricing structure for dynos?

<p>Charged per second of usage (A)</p> Signup and view all the answers

Which service is NOT mentioned as part of the managed support services?

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

What is the primary advantage of decomposing a monolithic application into microservices?

<p>Improved resilience and scalability (D)</p> Signup and view all the answers

Which service is responsible for sending notifications about newly available trips to drivers?

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

What communication method can backend services use besides APIs?

<p>Asynchronous event-based communication (D)</p> Signup and view all the answers

How can interfaces be organized in a microservices architecture?

<p>By splitting interfaces for each type of client (B)</p> Signup and view all the answers

Which of the following options best describes how functional areas are implemented in a microservices architecture?

<p>Functional areas are implemented as separate microservices (A)</p> Signup and view all the answers

What is a primary drawback of clients directly calling multiple microservices?

<p>Increased dependency on client-side architecture (D)</p> Signup and view all the answers

Which platform is known for built-in support for micro-service deployment?

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

What aspect of the client application must change when there is a modification in the microservices?

<p>The client application's service calls (D)</p> Signup and view all the answers

What is suggested as a better approach than direct client-to-microservices communication?

<p>Communicating through a service mesh (C)</p> Signup and view all the answers

What does runtime support for discovery and configuration facilitate?

<p>Efficient management of microservices (D)</p> Signup and view all the answers

What is the primary function of AWS Lambdas?

<p>To execute code in response to triggers or events (D)</p> Signup and view all the answers

What is a typical use case for AWS Lambdas?

<p>Pairing with communication services like SQS or SNS (A)</p> Signup and view all the answers

Which of the following limitations applies to AWS Lambdas per running instance?

<p>1,000 maximum concurrent executions (D)</p> Signup and view all the answers

What is the maximum execution time for an AWS Lambda function?

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

In the provided example, which Python feature is primarily used for generating the response?

<p>String concatenation with the format method (B)</p> Signup and view all the answers

What is the rationale behind not including photo resizing in the client event-response loop?

<p>It could increase response time significantly (C)</p> Signup and view all the answers

Which programming languages are supported by AWS Lambdas?

<p>Node.js, Java, Python, Go, C# (D)</p> Signup and view all the answers

What does Amazon S3 allow users to do?

<p>Store and retrieve elements using unique keys (D)</p> Signup and view all the answers

What is a key advantage of using spatial databases in driver management systems?

<p>They enable efficient queries for locating drivers near passengers. (A)</p> Signup and view all the answers

What challenge arises from the partitioned database architecture in microservices?

<p>Difficulty in modifying multiple database entries atomically. (D)</p> Signup and view all the answers

Which of the following is essential to handle fault tolerance in distributed systems?

<p>Developing interprocess or event-based communication methods. (B)</p> Signup and view all the answers

How does the absence of shared state in microservices affect application architecture?

<p>It necessitates more complex communication protocols. (D)</p> Signup and view all the answers

What is a potential impact of faults occurring during the interaction of microservices?

<p>Inconsistency in state across different services. (A)</p> Signup and view all the answers

What architectural pattern is favored for managing driver, passenger, and trip data in taxi-hailing applications?

<p>Microservices architecture with partitioned databases. (A)</p> Signup and view all the answers

Which communication method is recommended for dealing with complex interactions in microservices?

<p>RPC or event-based communication. (D)</p> Signup and view all the answers

Which statement best describes the complexity introduced by microservices?

<p>It requires careful planning for interservice communication. (A)</p> Signup and view all the answers

What is the primary role of an API Gateway in a microservice architecture?

<p>To serve as the sole entry point to the microservice ecosystem (D)</p> Signup and view all the answers

Which of the following functions is NOT typically performed by an API Gateway?

<p>Data storage (A)</p> Signup and view all the answers

How many microservices does a client request typically involve when using an API Gateway?

<p>6 to 7 (C)</p> Signup and view all the answers

What does the API Gateway provide to different types of clients?

<p>Custom APIs tailored to each client type (B)</p> Signup and view all the answers

Which of the following is an example of how an API Gateway orchestrates microservices?

<p>By handling client requests differently based on device type (B)</p> Signup and view all the answers

Which of the following best describes a primary benefit of using an API Gateway?

<p>It simplifies load balancing across microservices. (B)</p> Signup and view all the answers

When can an API Gateway work with multiple microservices?

<p>In all client requests from various devices (C)</p> Signup and view all the answers

What is a common communication protocol used by an API Gateway?

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

Which component of the architecture is directly involved with managing client authentication?

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

Flashcards

Web Dyno

A serverless computing component in Heroku that responds to incoming HTTP requests, handling user interactions with an application.

Worker Dyno

A serverless computing component in Heroku designed for handling computationally intensive tasks or background processes, running independently of user requests.

Heroku

A cloud platform-as-a-service (PaaS) known for its ease of deployment and support for various programming languages. It utilizes dynos for serverless computing.

CI/CD (Continuous Integration & Continuous Delivery/Deployment)

A continuous integration and continuous delivery/deployment (CI/CD) approach to development, where changes are automatically built and pushed to production seamlessly.

Signup and view all the flashcards

PostgreSQL (in Heroku)

A managed database service offered by Heroku, ideal for storing structured data like user information, orders, or inventory.

Signup and view all the flashcards

Microservices Architecture

A software architecture style where an application is broken down into smaller, independent units called microservices, each responsible for a specific function.

Signup and view all the flashcards

Notification Service

A specialized service (microservice) in a system that handles sending notifications, such as SMS messages or emails, to users.

Signup and view all the flashcards

Driver Management Service

A dedicated service that manages and interacts with drivers within a system, such as a ride-sharing application.

Signup and view all the flashcards

REST API

A software component enabling communication between different parts of a system, often using RESTful APIs.

Signup and view all the flashcards

Client-Specific Interfaces

A software design approach where interfaces are tailored to specific types of clients, catering to their unique needs and interactions with the system.

Signup and view all the flashcards

Partitioned Database Architecture

A distributed database system where data is partitioned across multiple databases, often across different microservices.

Signup and view all the flashcards

Data Consistency in Microservices

The challenge of ensuring data consistency and integrity in a partitioned database architecture, where simultaneous writes across multiple databases can lead to conflicting states.

Signup and view all the flashcards

Fault Tolerance in Microservices

A common problem in distributed systems when components (like microservices) can fail or become unavailable, requiring mechanisms to handle these failures gracefully.

Signup and view all the flashcards

Interprocess Communication in Microservices

Communication between microservices using Remote Procedure Calls (RPC) or asynchronous messaging, as they typically don't share a common memory space.

Signup and view all the flashcards

High Availability in Microservices

The ability to handle requests and respond to users even if some parts of the system are down or unavailable.

Signup and view all the flashcards

Distributed Transactions in Microservices

Managing and coordinating data changes to multiple databases in a consistent and reliable manner, especially in a partitioned database architecture.

Signup and view all the flashcards

Consistency Challenges in Microservices

The potential for inconsistencies or errors in data due to failures or delays in communication between different microservices and their associated databases.

Signup and view all the flashcards

What is AWS Lambda?

AWS Lambda is a serverless computation service that allows developers to run code without managing servers. It operates similar to Heroku's dynos and executes code in response to specific events like HTTP requests or periodic triggers.

Signup and view all the flashcards

How does AWS Lambda integrate with messaging services?

AWS Lambda functions are often paired with communication services such as Amazon Simple Queue Service (SQS) or Amazon Simple Notification Service (SNS). This enables asynchronous communication where tasks are added to queues and Lambda functions consume them, triggering automated actions.

Signup and view all the flashcards

What are the limitations of a single AWS Lambda instance?

AWS Lambda functions have resource limitations for each running instance, including a memory limit of roughly 3GB and a temporary disk size of 512MB. They can run for a maximum of 300 seconds.

Signup and view all the flashcards

How does a typical Lambda function in Python look like?

The my_handler function is a typical structure for an AWS Lambda function written in Python. It accepts two arguments, event and context, and performs the desired actions based on the received event.

Signup and view all the flashcards

What is Amazon S3?

Amazon Simple Storage Service (S3) is a key-value storage service provided by AWS. It offers a simple interface for storing and retrieving data using unique keys. S3 is ideal for storing large amounts of data, such as images, videos, and documents.

Signup and view all the flashcards

How can Lambda functions be used for creating thumbnails from uploaded photos in a social media application?

When a user uploads a photo to a social media application, generating thumbnails or resizing large images can be time-consuming. Instead of processing this within the client's event-response loop, we can store the raw photo in an S3 bucket and use an AWS Lambda function triggered later to create the thumbnail.

Signup and view all the flashcards

What is one-to-many decoupled communication with AWS Lambda?

One-to-many decoupled communication refers to a communication pattern where tasks are added to a queue or topic, and multiple Lambda functions can concurrently consume and process these tasks independently. This architecture ensures scalability and flexibility, as individual tasks are processed by separate functions.

Signup and view all the flashcards

Which programming languages are supported by AWS Lambda?

AWS Lambda offers support for several popular programming languages such as Node.js, Java, Python, Go, and C#. This allows developers to choose their preferred language based on project requirements and existing skills.

Signup and view all the flashcards

API Gateway

A layer in a microservices architecture that acts as a single entry point for all external requests. It shields the internal microservices from outside clients, providing an API for each client type.

Signup and view all the flashcards

API Gateway Orchestration

The process of setting up an API Gateway to direct traffic to the correct microservices based on the type of client request.

Signup and view all the flashcards

Authentication in API Gateway

Ensuring all external requests are validated.

Signup and view all the flashcards

Monitoring in API Gateway

Tracking the performance of microservices and detecting issues like slow response times.

Signup and view all the flashcards

Load Balancing in API Gateway

Distributing traffic across multiple instances of a service to prevent overload.

Signup and view all the flashcards

Direct from client

A method of connecting a mobile/native app to a collection of microservices, where the client communicates directly with each service using unique public endpoints like 'https://serviceName.api.company.name'.

Signup and view all the flashcards

Drawbacks of direct client communication

Direct communication between a mobile/native app and microservices can be complex, potentially involving hundreds of services for a single task. This can result in many network requests and a client application heavily tied to the backend architecture.

Signup and view all the flashcards

Communication: API Gateway

A design pattern in which a dedicated layer acts as an intermediary between mobile/native app clients and microservices, simplifying the communication and reducing the complexity.

Signup and view all the flashcards

API Gateway: Simplifying communication

An API Gateway is designed to handle communication between a mobile client and microservices. It acts as a single entry point, routing requests to the appropriate services and simplifying the client-side code.

Signup and view all the flashcards

Benefits of an API Gateway

An API Gateway can consolidate requests, improve security, handle authentication, and manage rate limiting, providing a more robust and manageable communication layer for microservices.

Signup and view all the flashcards

Study Notes

Course Information

  • Course Title: Cloud Computing
  • Course Code: LINFO2145
  • Instructor: Pr. Etienne Rivière
  • Contact Email: [email protected]
  • University: Université catholique de Louvain

Announcements

  • Project starts this Friday
  • ULB students without Moodle access should provide their GitHub account to TAs in person or by email
  • Peer review for Quiz #1 opens after this lecture
  • Deadline for peer review: Before the next Wednesday's lecture
  • New quiz on lectures 3 and 4 available after the deadline

Course Objectives

  • Discuss Platform-as-a-Service (PaaS) including development environments and serverless cloud computing
  • Describe service-oriented architectures including classical Web services, REST APIs, microservices, API gateways and service meshs

Platform-as-a-Service (PaaS)

  • A cloud service model that provides developers with a managed environment for creating and deploying applications
  • Benefits include relief from administration and maintenance tasks like installing and maintaining OS, database servers, web servers (reduced overhead for developers)
  • Less flexible than Infrastructure-as-a-Service (IaaS)
  • Vendor lock-in is greater than with IaaS
  • Easier to relocate virtual machines or containers between IaaS providers compared to specific PaaS platform code

PaaS Examples

  • Google App Engine
  • Heroku
  • AppFog
  • Engine Yard
  • OpenShift
  • CleverCloud

Comparing PaaS

  • Comparing PaaS is more complex compared to IaaS
  • No longer solely focused on pricing, security features or machine performance
  • Factors to consider include supported programming languages, libraries, database management systems, communication features, deployment and testing support, cost and billing models

Google App Engine

  • Provides a complete, managed environment
  • Supports development tools, runtimes, libraries and Operating Systems
  • Primarily designed for distributed web applications
  • Supports Java, Ruby, Python, PHP, Go, and Node.js
  • Applications are designed to be small and stateless, with components that are only invoked when there's an incoming web request
  • Data stored in a managed database
  • Can include IaaS-like usage through containers with arbitrary code functions (using Kubernetes)

Google App Engine: Pricing

  • Billing based on actual usage per second, with a one-minute minimum charged per hour
  • Pricing per resource:
    • vCPU: $0.0526 per core hour
    • Memory: $0.0071 per GB hour
    • Persistent disk $0.0400 per GB per month
  • Cost for outgoing traffic: $0.12 / GB
  • Shared Google services like caching, email, and libraries charge nothing extra

Deployment: Google App Engine

  • Use the Google Cloud Platform to create a new project
  • Use the provided SDK to test your application locally
  • Install the SDK for testing applications locally
  • Deploy via command line tool (appcfg.py)

Python (GAE) - Code Example

  • webapp2 : Depricated GAE web code framework
  • MainPage : Class to handle requests
  • Configuration file (YAML format) including runtime, api_version, threadsafe, handlers ,regexp, and script

Deployment: Create Project

  • Instructions cover the steps to create a new project on GCP.

Deployment: Uploading a Project

  • Steps to deploy the application using appcfg.py from the local machine.
  • Requires authentication and uses project IDs.

Other concepts

  • Discusses deployment best practices
  • Emphasizes considerations for using microservices, including performance and architecture choices
  • Illustrates architectural aspects and considerations in a Cloud Computing context (Scalability cube, Restful APIs)
  • Discusses communication models (one-to-one, one-to-many, synchronous, asynchronous) and implementation details
  • Emphasizes important considerations like service meshes, payloads, and database considerations with microservice architectures.

Platform-as-a-Service (PaaS) and portability

  • Discussion of portability: running applications built using GAE on a private cloud or moving to an IaaS platform for cost reasons. Introducing an open-source alternative, CapeDwarf, running on WildFly.

"Serverless" Computing

  • Describes serverless computing as a common form of PaaS
  • Highlights that code does not run directly in thin air but on actual compute resources, with the location not being managed by the user. This includes examples like AWS lambdas, Heroku.

Heroku

  • Discussion of Heroku's dynos (serverless components).
  • Details on web dynos and worker dynos. Shows execution flow diagrams for different microservice interaction strategies and the advantages and disadvantages
  • Describes the choice between on-demand (cheap, higher latency) and persistent (expensive, better response times)

AWS Lambdas

  • Discusses how this technology is a mechanism analogous to Heroku’s dynos
  • Describes common use cases: invoking the lambda periodically, in response to external HTTP requests or events
  • Details AWS Lambda limitations including memory, temporary disk usage, and execution time constraints
  • Illustrates Python programming example for lambda functions

Image Thumbnails

  • Illustrates using Amazon S3 (a key/value store) as the storage for raw images and then generating thumbnails for web display. Explains why putting thumbnail storage and creation within the main client request loop is not efficient.
  • Recommends storing raw images in Amazon S3 bucket and creating thumbnails separately, and then returning thumbnail URLs.

High-level architecture for AWS Lambdas

  • Visual representation diagram illustrating the interaction between an AWS account user, Amazon S3 buckets, an execution role, and an AWS Lambda function.

Steps for uploading images and creating thumbnails

  • Details the process of receiving image uploads through a channel
  • Highlights the use of "ObjectCreated" events

Intermediate conclusion

  • Discusses core design principles of PaaS and serverless models based on the idea of services
  • Shows how an application is formed from a set of services linked through APIs
  • Highlights that these services are designed to scale, and deploy in isolation, characteristics that make them compatible with cloud computing paradigms

REST Interfaces

  • Introduction to Representational State Transfer (REST), an architectural style for designing web applications
  • Explains REST general guidelines, bottom-up normalization, HTTP 1.1 and URIs

REST key features

  • Describes uniform interface, statelessness, client-server, and other characteristics of REST
  • Explains resource-based interactions, using URIs to identify "things" and representations for exchanging resource data

REST API - Uniform Interface

  • Describes the uniform interface within RESTful APIs that utilizes common verbs such as GET, PUT, POST, PATCH, and DELETE
  • Covers the role of the HTTP request method in specifying API operations
  • Discusses the standardization of HTTP responses, including success, error codes, etc.

HTTP verbs - Semantics

  • Explains how different HTTP verbs are used
  • Describes GET as a read-only operation and POST, PUT, PATCH and DELETE for creating, replacing, updating and deleting items respectively

HTTP verbs - Example usage

  • Provides examples of how HTTP verbs work in the context of resources (ex: a list of students or a specific student)

Design effective & safe APIs

  • Discusses importance of resource naming, consistency, idempotent usage of API, rate limits, and secure access with example use cases

HTTP responses

  • Discusses HTTP response codes and their uses to identify the status of a request or message sent to a server.
  • Explains how those codes are grouped in five families with various intended uses and meanings.

JSON

  • Describes JSON (JavaScript Object Notation)
  • Highlights its use as a common data format in modern applications, being human-readable and machine-parseable

Constraint 2 - Statelessness

  • Discusses the lack of session state stored on the server during interactions with RESTful interfaces. Explains why this approach is well suited to a Cloud environment and how it enables scalability.

Interest of REST APIs

  • Explains the benefit of using REST APIs in an elastic and scalable system and in terms of portability, clarity, and implementation

REST Maturity Model

  • Details Richardson's model for REST APIs, outlining various maturity levels (0-3)

Example of RESTful APIs (OpenStack)

  • Illustrates a platform (OpenStack) API using GET/POST/PUT/DELETE examples for launching VMs, creating/editing/removing images, etc.

Example of OpenStack API use

  • Covers specific examples of calls using curl instructions to interact with a real system (OpenStack)

Microservices

  • Describes micro services, an architecture focusing on small, interconnected services
  • Explains that each micro-service is implemented as a single functionality
  • Defines important considerations to be mindful of when implementing microservices including: independent databases, separate deployment for new/old service, and different languages/frameworks
  • Uses example of a taxi-hailing application

Monothic vs. Microservices Application Structure

  • Presents diagrams describing typical architectures for an application before (monolithic) and after (microservices) implementing design principles, and presents the differences in complexity

Advantages of a monolith

  • Shows the benefits of a monolithic architecture from a developer's perspective (simplicity of deployment + tooling support - IDEs, etc.) and the advantages of a shared programming language, or how to deploy.

Monothic Hell (1 & 2)

  • Shows the disadvantages or limitations to a monolith from the view point of a developer (complexity in scaling up, adding features and maintenance) and a DevOps/Operations person (complexity in deployment time, scaling and resource allocation)

Microservices Communication

  • Highlights the various strategies used to communicate between microservices such as synchronous and asynchronous communication styles, direct from client and through API Gateways, or through message driven architectures

API Gateways

  • Explains that a specific microservice will act as the sole entry point into your system (an API Gateway)
  • Discusses how API gatekeeps knowledge of the inner system's architecture
  • Explains the benefits of using API gateways, including encapsulation and centralized control of communication

Interaction Styles

  • Highlights "one-to-one" interactions where each client request generates a processing instance by just one service
  • Describes "one-to-many" interactions where a single request gets handled by several services
  • Discusses synchronous (blocking, fast) and asynchronous communication modes (non-blocking)

Mixing Interaction Styles

  • Shows a visual representation of how to implement various interactions styles in order to communicate between several microservices
  • Discusses synchronous, event-based interactions, and how these are applied in scenarios

Synchronous Request/Response

  • Explores using REST over HTTP and the overhead added, emphasizing better, more efficient approaches such as RPC and other options (Thrift) for data communication between services. Explains how these communication technologies offer different levels of direct communication
  • Shows how Thrift can be utilized as a language-neutral solution

Asynchronous communication, event-based

  • Discusses client-service communication where events are triggered by clients.
  • Explains that once the event has been sent, the client does not wait for feedback or a response, but continues its execution and receives feedback via events or messages.
  • Explains the role of communication channels in asynchronous event-based communication
  • Explains the use of message brokers

Payload formats

  • Discusses various payload formats for exchanging data, such as JSON, XML, structured binary formats (Protocol Buffers and Avro)

Service Meshes

  • Explains the concept with use cases and details on how a service mesh can help maintain performance consistency while handling communication between microservices
  • Highlights the benefits in cloud deployments and management of different instances and nodes
  • Explains the use cases and describes various concepts used in microservices implementation

Conclusion

  • Summarizes the benefits of using PaaS and microservices in the Cloud, including features such as serverless computing, well-suited implementation for operations tasks, compatibility with containers, and various benefits from a scalability perspective.

Additional resources

  • Lists supplementary learning materials, including videos by industry experts, and ebooks

Studying That Suits You

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

Quiz Team

Related Documents

More Like This

Microservices Architecture Fundamentals
16 questions
Microservices et Cloud Computing
45 questions
Architecture Microservices et Scalabilité
44 questions
AWS X-Ray and Microservices Architecture Quiz
45 questions
Use Quizgecko on...
Browser
Browser