Podcast
Questions and Answers
What data structure is used to keep track of the number of tweets per user?
What data structure is used to keep track of the number of tweets per user?
What is the consequence if responseEntity.getStatusCode()
returns something other than 200?
What is the consequence if responseEntity.getStatusCode()
returns something other than 200?
What type of entity is created to send a tweet with the appropriate headers?
What type of entity is created to send a tweet with the appropriate headers?
Which method is used to dequeue tweets for processing?
Which method is used to dequeue tweets for processing?
Signup and view all the answers
What are the two main types of requirements in software engineering?
What are the two main types of requirements in software engineering?
Signup and view all the answers
Which architecture allows for easier scaling and isolation between services?
Which architecture allows for easier scaling and isolation between services?
Signup and view all the answers
Which non-functional requirement is focused on the system's ability to handle increasing loads?
Which non-functional requirement is focused on the system's ability to handle increasing loads?
Signup and view all the answers
What is the main focus of requirements engineering?
What is the main focus of requirements engineering?
Signup and view all the answers
What is one of the main advantages of using Kubernetes?
What is one of the main advantages of using Kubernetes?
Signup and view all the answers
Which deployment model for microservices offers the best isolation between services?
Which deployment model for microservices offers the best isolation between services?
Signup and view all the answers
What is a key characteristic of non-functional requirements?
What is a key characteristic of non-functional requirements?
Signup and view all the answers
What does the 'strangler pattern' aim to facilitate?
What does the 'strangler pattern' aim to facilitate?
Signup and view all the answers
What is a key benefit of cloud software architectures?
What is a key benefit of cloud software architectures?
Signup and view all the answers
Which stage in requirements engineering focuses on verifying that the system meets specifications?
Which stage in requirements engineering focuses on verifying that the system meets specifications?
Signup and view all the answers
What is the main purpose of the message broker in a microservices architecture?
What is the main purpose of the message broker in a microservices architecture?
Signup and view all the answers
Which HTTP methods are to be implemented in the OrderController class according to the content?
Which HTTP methods are to be implemented in the OrderController class according to the content?
Signup and view all the answers
What is included in the Dockerfile as the start command?
What is included in the Dockerfile as the start command?
Signup and view all the answers
What challenge does the microservices architecture aim to address?
What challenge does the microservices architecture aim to address?
Signup and view all the answers
What operation does the deleteOrder method perform?
What operation does the deleteOrder method perform?
Signup and view all the answers
What must be done to the start.sh script in the Dockerfile?
What must be done to the start.sh script in the Dockerfile?
Signup and view all the answers
Which of the following tasks is related to the message broker implementation?
Which of the following tasks is related to the message broker implementation?
Signup and view all the answers
What type of communication does the conversion of TweetMicroservice aim to achieve?
What type of communication does the conversion of TweetMicroservice aim to achieve?
Signup and view all the answers
What is the format of the jar file specified in the Dockerfile for copying?
What is the format of the jar file specified in the Dockerfile for copying?
Signup and view all the answers
What is the purpose of the webClient in the deleteOrder method?
What is the purpose of the webClient in the deleteOrder method?
Signup and view all the answers
What is the primary function of a message broker in the context of microservices architecture?
What is the primary function of a message broker in the context of microservices architecture?
Signup and view all the answers
What kind of architecture is being used for the TUM Social App according to the information provided?
What kind of architecture is being used for the TUM Social App according to the information provided?
Signup and view all the answers
Which operation is not directly mentioned as one of the functionalities of the TUM Social App?
Which operation is not directly mentioned as one of the functionalities of the TUM Social App?
Signup and view all the answers
What does the CompletableFuture in the sendTweet method signify?
What does the CompletableFuture in the sendTweet method signify?
Signup and view all the answers
What is the purpose of enqueuing tweets in the MBController?
What is the purpose of enqueuing tweets in the MBController?
Signup and view all the answers
Which aspect of communication is highlighted as important for enhancing client and microservices interaction?
Which aspect of communication is highlighted as important for enhancing client and microservices interaction?
Signup and view all the answers
What is the result returned to the client after enqueueing a tweet in the MBController?
What is the result returned to the client after enqueueing a tweet in the MBController?
Signup and view all the answers
Why is it advantageous to implement asynchronous calls in microservices like sendTweet?
Why is it advantageous to implement asynchronous calls in microservices like sendTweet?
Signup and view all the answers
What is the main benefit of using the strangler pattern during migration?
What is the main benefit of using the strangler pattern during migration?
Signup and view all the answers
Which of the following is NOT a characteristic of a REST API?
Which of the following is NOT a characteristic of a REST API?
Signup and view all the answers
In the migration of user operations, which method is responsible for checking if a username is already taken?
In the migration of user operations, which method is responsible for checking if a username is already taken?
Signup and view all the answers
What does the DELETE HTTP method typically do in a REST API?
What does the DELETE HTTP method typically do in a REST API?
Signup and view all the answers
Which functionality group is NOT identified in the migration of the Tummit application?
Which functionality group is NOT identified in the migration of the Tummit application?
Signup and view all the answers
What is the purpose of creating API endpoints for the microservices in Tummit?
What is the purpose of creating API endpoints for the microservices in Tummit?
Signup and view all the answers
In the context of REST APIs, what is meant by 'stateless'?
In the context of REST APIs, what is meant by 'stateless'?
Signup and view all the answers
What is the first step in implementing the strangler pattern?
What is the first step in implementing the strangler pattern?
Signup and view all the answers
What is the function of the 'createOrder' API method presented in the OrderResource class?
What is the function of the 'createOrder' API method presented in the OrderResource class?
Signup and view all the answers
Which method is used to authenticate a user in the Tummit application?
Which method is used to authenticate a user in the Tummit application?
Signup and view all the answers
What limitation is enforced on the number of tweets a user can send in a day?
What limitation is enforced on the number of tweets a user can send in a day?
Signup and view all the answers
Which component is responsible for redirecting the processing of tweets to the appropriate class?
Which component is responsible for redirecting the processing of tweets to the appropriate class?
Signup and view all the answers
What happens when the user exceeds their daily tweet limit according to the implemented logic?
What happens when the user exceeds their daily tweet limit according to the implemented logic?
Signup and view all the answers
How does the processTweets
method manage concurrent tweet processing?
How does the processTweets
method manage concurrent tweet processing?
Signup and view all the answers
Which HTTP status code is expected to confirm the successful sending of a tweet?
Which HTTP status code is expected to confirm the successful sending of a tweet?
Signup and view all the answers
What is the role of the notifyUser
method within the tweet processing logic?
What is the role of the notifyUser
method within the tweet processing logic?
Signup and view all the answers
In the context of microservices architecture, what is a key benefit of implementing the strangler pattern?
In the context of microservices architecture, what is a key benefit of implementing the strangler pattern?
Signup and view all the answers
What is the primary purpose of the Dockerfile in a microservices setup?
What is the primary purpose of the Dockerfile in a microservices setup?
Signup and view all the answers
What is the primary aim of implementing the strangler pattern when migrating from a monolithic architecture?
What is the primary aim of implementing the strangler pattern when migrating from a monolithic architecture?
Signup and view all the answers
Which of the following is a key characteristic of microservices architecture compared to monolithic architecture?
Which of the following is a key characteristic of microservices architecture compared to monolithic architecture?
Signup and view all the answers
In API design, which principle ensures that each request contains all the information needed for processing without relying on stored context?
In API design, which principle ensures that each request contains all the information needed for processing without relying on stored context?
Signup and view all the answers
What does the three-tier architecture typically include?
What does the three-tier architecture typically include?
Signup and view all the answers
Which deployment model allows for better isolation between services in a microservices architecture?
Which deployment model allows for better isolation between services in a microservices architecture?
Signup and view all the answers
When migrating legacy systems, one of the goals of using the strangler pattern is to achieve which of the following?
When migrating legacy systems, one of the goals of using the strangler pattern is to achieve which of the following?
Signup and view all the answers
Which non-functional requirement pertains specifically to the system's ability to handle an increasing number of users?
Which non-functional requirement pertains specifically to the system's ability to handle an increasing number of users?
Signup and view all the answers
What is one advantage of using Kubernetes in microservices deployment?
What is one advantage of using Kubernetes in microservices deployment?
Signup and view all the answers
In API-driven development, which concept strictly defines how resources are identified and manipulated?
In API-driven development, which concept strictly defines how resources are identified and manipulated?
Signup and view all the answers
What is a major advantage of using the strangler pattern during migration from a monolithic to a microservices architecture?
What is a major advantage of using the strangler pattern during migration from a monolithic to a microservices architecture?
Signup and view all the answers
Which of the following best describes a statelessness characteristic in REST architecture?
Which of the following best describes a statelessness characteristic in REST architecture?
Signup and view all the answers
In the context of the TUMMit application, which group is NOT part of the identified functionality for refactoring into microservices?
In the context of the TUMMit application, which group is NOT part of the identified functionality for refactoring into microservices?
Signup and view all the answers
What is the purpose of creating API endpoints for each microservice in the TUMMit application?
What is the purpose of creating API endpoints for each microservice in the TUMMit application?
Signup and view all the answers
Which REST method is typically used to retrieve a resource?
Which REST method is typically used to retrieve a resource?
Signup and view all the answers
What does the facade represent in the context of the strangler pattern?
What does the facade represent in the context of the strangler pattern?
Signup and view all the answers
Which of the following is NOT a characteristic of RESTful APIs?
Which of the following is NOT a characteristic of RESTful APIs?
Signup and view all the answers
When migrating user operations in TUMMit, which function checks if a username is already in use during registration?
When migrating user operations in TUMMit, which function checks if a username is already in use during registration?
Signup and view all the answers
What risk is reduced by gradually migrating components using the strangler pattern?
What risk is reduced by gradually migrating components using the strangler pattern?
Signup and view all the answers
What do API endpoints created for microservices enable in terms of application scalability?
What do API endpoints created for microservices enable in terms of application scalability?
Signup and view all the answers
Study Notes
Cloud Design Overview
- Focus on analyzing, designing, implementing, testing, and deploying cloud software systems.
- Key components include Cloud Design Requirements, Software Architectures, Software Testing, and Software Management.
Tutorial Structure
- Part I: Summary and Q&A of lecture material.
- Part II: Homework exercises for programming practice (Artemis).
- Part III: Fundamentals of programming.
- Part IV: Discussion of text exercises.
Requirements Engineering
- Involves several stages: Problem Elicitation, Analysis, Specification, Verification/Validation, Management, Maintenance.
- May require multiple iterations to refine system requirements.
Requirement Types
- Functional Requirements: Define specific tasks and functionalities of a system, often articulated through use cases or user stories.
- Non-Functional Requirements: Describe the system's performance, usability, and reliability characteristics including response time, availability, and transaction handling capacity.
- Both types are critical for meeting user needs.
Non-Functional Requirements Categories
- Performance
- Scalability
- Reliability
- Availability
- Security
- Maintainability
- Deployability
Software Architectures in the Cloud
- Architecture choice is influenced by requirements (functional/non-functional), development process, software size, and team size.
- Main architectures include:
- Monolithic Applications
- Microservice-based Applications
Deployment Models for Microservices
- Baremetal: Difficult to scale, lacks service isolation.
- Containers: Scalable on-demand, isolates services, simplifies environment packaging.
- Virtual Machines: Offers scaling and isolation; virtualization costs may be high.
- Function-as-a-Service (FaaS): Scales on demand, cost-efficient, but limited environment control.
Container Orchestration with Kubernetes
- Developed by Google, Kubernetes facilitates:
- Container deployment and scheduling on physical machines.
- Network management including service discovery and load balancing.
- Scaling operations by replicating or destroying containers as needed.
Homework Programming Exercise
- Focuses on migrating a legacy monolithic server (TUMMit) to a microservices architecture.
- Applies the Strangler Pattern to gradually reduce the monolith.
- Objectives are to understand the Strangler Pattern and streamline code refactoring.### TUMMit and Microservices Refactoring
- TUMMit is a social app with a monolithic structure that performs user registration, authentication, discussion creation, and comment management.
- Current implementation faces performance issues; refactoring to microservices is proposed to enhance efficiency.
- Functions within the Tummit class will be divided into three groups: User, Authentication, and Discussion.
- Each group will be implemented as separate microservices with defined API endpoints.
Strangler Pattern
- The Strangler Pattern facilitates gradual migration from a monolithic system to microservices without losing current functionality.
- Allows incremental testing and reduces the risk of complete application failure during migration.
- An intermediary facade handles external interactions, simplifying backend complexity for clients.
Steps to Microservices Migration
- Identify logical groups within the monolith for migration.
- Create corresponding microservices and establish API endpoints for user operations, authentication, and discussions.
Example Migration Functions
-
UserService will manage user registration and deletion:
- Registration checks for existing users before adding a new user.
- Deletion verifies user authentication before removing a user and associated comments.
-
AuthenticationService handles user login and token generation:
- Validates credentials and generates a unique authentication token.
-
DiscussionService manages discussion creation and comment management:
- Only authenticated users can create discussions and add comments.
- Methods to retrieve comments by topic or user are included.
REST Architectural Style
- REST (Representational State Transfer) is a set of constraints defining client-server communication.
- Key principles include client-server independence, statelessness, cacheability, a uniform interface, and layered systems.
- HTTP methods map to REST actions: GET for retrieval, POST for creation, PUT for updates, DELETE for removals.
Implementing REST API for Ordering
- OrderResource class implements CRUD operations through GET, POST, PUT, and DELETE methods.
- Each method checks for valid requests and returns appropriate responses based on operations performed.
Docker Deployment
- A Dockerfile defines the environment for the REST API server, using an OpenJDK base image.
- Includes steps to copy compiled JAR files and set up execution permissions for start scripts.
Microservices Architecture
- A message broker enables asynchronous communication between microservices.
- Each microservice manages its specific functionality (e.g., login, tweeting, following) independently.
- Adding a message broker improves scaling and load management for operations like sending tweets.
Asynchronous Method Implementation
- Example of an asynchronous sendTweet method highlights how to handle operations using CompletableFuture.
- Sending tweets is queued and acknowledged immediately, improving user experience by minimizing wait times.### Microservices Architecture Overview
-
Process Tweets Function: Handles tweet processing by implementing
processTweets
method inMBController
. - Threading: Each tweet is processed in a separate thread to maintain responsiveness.
-
Tweet Queue Handling: Tweets are taken from
tweetQueue
for processing; implements a blocking queue mechanism.
User Tweet Management
-
User Tweet Count: Maintains a count of tweets per user using a
userTweetCount
map. -
Daily Limit Enforcement: Each user is allowed a maximum of 5 tweets:
- If the limit is not reached, the tweet is sent and count is incremented.
- If the limit is reached, a message indicating it's over the daily limit is stored.
Response Handling
-
HTTP Headers: Sets content type to
APPLICATION_JSON
for outgoing tweet requests. -
Response Evaluation: Checks status code of HTTP response:
- Status code 200 indicates success and updates user count.
- Other statuses or limit exceedance triggers a different message.
Notification System
-
Notify User: Notifies users after each tweet processing via
notifyUser(tweet)
method.
Tutorial Structure
- Part I: Summarizes lecture content and includes Q&A.
- Part II: Homework programming exercises managed through Artemis platform.
- Part III: Basics of programming are covered.
- Part IV: Involves discussion of text exercises to enhance understanding.
Artemis Platform
- Central resource for managing programming exercises and discussions. Access available at: https://artemis.cit.tum.de/
Roadmap of Cloud Software Systems
- Focus on analyzing, designing, implementing, testing, and deploying cloud software.
- Covers areas such as Cloud Design Requirements, System Design, Software Testing, Implementation, Management, Deployment, and Monitoring.
Tutorial Outline
- Part I: Lecture summary and Q&A session.
- Part II: Homework programming exercises on Artemis.
- Part III: Basics of programming.
- Part IV: Discussion of text exercises, also on Artemis.
Lecture Overview
- Part I: Requirement engineering, including stages and types of requirements.
- Part II: Overview of cloud software architectures, featuring three-tier and monolithic architectures.
- Part III: Microservice architecture, transitioning from monolithic to microservices and deploying with Kubernetes.
Stages in Requirement Engineering
- Breakdown includes Problem Elicitation, Analysis, Specification, Verification/Validation, Management, and Maintenance.
- Process may require multiple iterations to refine specifications.
Types of Requirements
- Functional Requirements: Define specific tasks and functions of a system, expressed through use cases or user stories.
- Non-functional Requirements: Describe system characteristics like performance, usability, and reliability, expressed through quality attributes.
- Both types are vital for meeting user expectations and project success.
Key Non-functional Requirements
- Performance: Speed and efficiency of the system.
- Scalability: Ability to handle increased load.
- Reliability: Consistency and dependability of the system.
- Availability: System accessibility.
- Security: Protection against unauthorized access.
- Maintainability: Ease of updates and modifications.
- Deployability: Capability for quick deployment into production.
Software Architectures in the Cloud
- Architecture choice influenced by functional/non-functional requirements, development process, software size, and developer count.
- Main architectures are Monolithic and Microservice-based.
Deployment Models for Microservices
- Baremetal: Difficult to scale on-demand; lacks isolation between services.
- Containers: Scales on-demand; offers isolation and simplified environment packaging.
- Virtual Machines: Supports scaling and isolation but bears additional virtualization costs.
- Function-as-a-Service (FaaS): Scales efficiently and is cost-effective with limited control over the environment.
Kubernetes as a Container Orchestrator
- Developed by Google to manage container deployment and orchestration.
- Supports container deployment on physical machines, scheduling, service discovery, and load balancing.
- Facilitates scaling operations, enabling replication and destruction of containers as needed.
Homework Programming Exercises
- Tasks include explaining and implementing assignments through Artemis platform.
Strangler Pattern - Problem Statement
- Objective: Migrate a legacy monolithic system (TUMMit) to microservices gradually using the strangler pattern.
- Implementation focuses on Java to simplify code refactoring of complex systems.### TUMMit Refactoring to Microservices
- TUMMit has a monolithic structure that includes functionalities for user registration/deletion, authentication, discussion creation, and comment management.
- Current implementation is identified as slow and inefficient, prompting a shift to a microservices architecture.
- Functionalities can be logically grouped into three categories: User, Authentication, and Discussion.
Strangler Pattern
- The strangler pattern facilitates gradual replacement of an old system by introducing an intermediary facade.
- Allows for incremental testing and reduces complexity without losing functionality.
- Provides a higher-level interface, concealing backend migration complexity from clients.
- Minimizes risks associated with completely breaking the application during transition.
Microservice Implementation Steps
- UML Diagram is created to visualize the microservice application architecture.
- Functions from the monolithic TUMMit class are redistributed into standalone microservices.
User Service Functions
- User Registration: Registers a new user if the username does not already exist.
- User Deletion: Deletes a user after confirming authentication and removing associated comments.
Authentication Service Functions
- User Authentication: Validates user credentials and generates a unique token upon successful login.
Discussion Service Functions
- Create Discussion: Initiates a new discussion only after verifying user authentication.
- Add and Get Comments: Users can add comments to discussions if authenticated; methods also allow retrieval of comments by topic or user.
REST Architectural Style
- REST is based on several constraints, including client-server independence, statelessness, cacheable data, and a uniform interface for communication.
- Common HTTP methods used in REST:
- GET: Retrieve resources.
- POST: Create resources.
- PUT: Update resources.
- DELETE: Remove resources.
REST API Design and Implementation
- Online ordering and take-away functionality is to be implemented via REST API for a restaurant.
- OrderResource Class: Handles CRUD operations for food orders using HTTP methods.
- OrderController Class: Acts as a REST controller managing customer-related operations with external API interactions.
Microservices Architecture Example
- Utilizes a thread to process tweets, managing user limitations and ensuring responses are sent to the correct user.
- Implements concurrency management to handle multiple user requests efficiently.
Tutorial Structure
- Part I involves a lecture summary with Q&A.
- Part II focuses on programming exercises.
- Part III covers programming basics.
- Part IV promotes discussion of text exercises via the provided platform.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
This quiz covers key functionalities of the processTweets
method in the MBController class. It examines how the method manages user tweet limits, exception handling for interruptions, and the data structure used for tracking tweets per user. Additionally, the quiz explores preconditions for sending a tweet and the implications of non-200 HTTP responses.