Week 6: Software Architecture and Architectural Style

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

33 Terms

1
New cards

What is domain modelling and why is it important?

Domain modelling is the process of visually representing real-world entities, their attributes, and relationships. It helps in understanding and designing the software requirements more clearly by using class diagrams, entity-relationship models, etc.

2
New cards

How to model asynchronous behavior in sequence diagrams?

Use asynchronous messages (open arrowheads) to represent non-blocking calls. For browsing and payment, indicate separate threads or concurrent lifelines to show parallel execution.

3
New cards

How to represent a failure scenario in sequence diagrams?

Add a conditional guard (e.g., [searchFailed]) on a return path. Use alt fragment to depict both success and failure branches in the sequence. X at the lifeline shows object deletion or failure end.

4
New cards

What is software architecture and what are architectural styles?

Software Architecture: The high-level structure of a software system, defining its components and their interactions. Architectural Style: A reusable solution and design pattern for recurring system organization problems (e.g., layered, microservices).

5
New cards

. What’s the difference between architecture and architectural style?

- Architecture = actual system blueprint.

- Style = template or guideline used in designing architectures (e.g., client-server, SOA).

6
New cards

Difference between decomposition and modularity?

- Decomposition: Breaking down a system into smaller parts (e.g., classes, components).

- Modularity: Designing these parts to function independently, promoting maintainability and reusability.

7
New cards

Describe Pipe-and-Filter architecture.

  • Concept: Data is passed through sequential filters connected by pipes.

  • Pros:
    Modularity – Filters are independent and easily replaced.
    Reusability – Same filters can be used across different workflows.
    Scalability – Filters can be run in parallel on large datasets.

  • Cons:
    Latency – Each stage adds delay to data processing.
    Error Handling – Debugging across filters is difficult.
    Bottlenecks – One slow filter affects the whole pipeline.

  • Best For: Streaming pipelines, compilers, ETL.

  • Focus: Performance, Scalability.

8
New cards

Blackboard

  • Concept: A shared central repository (“blackboard”) is updated by independent knowledge sources.

  • Pros:
    Flexibility – Easy to plug in new components.
    Parallelism – Multiple modules can contribute concurrently.
    Fault Tolerance – System continues even if some modules fail.

  • Cons:
    Coordination Complexity – Hard to manage module interaction.
    Unpredictability – Execution depends on data availability.
    Overhead – Frequent access to shared data can slow performance.

  • Best For: AI systems, robotics, decision systems.

  • Focus: Fault Tolerance, Flexibility.

9
New cards

🔹 Layered

  • Concept: System split into hierarchical layers: Presentation(handles the UI/user interaction → Business( manages the core application logic) → Persistence( manages access to the database) → Database (actual data storage layer)

  • Pros:
    Separation of Concerns – Cleanly divides logic.
    Maintainability – Layers can be changed independently.
    Security – Can implement access controls per layer.

  • Cons:
    Performance Cost – Each request passes through many layers.
    Rigidity – Difficult to bypass layers for optimization.

  • Best For: Enterprise systems, OS design.

  • Focus: Maintainability, Security.

10
New cards

SOA (Service-Oriented Architecture)

  • Concept: Distributed system using services that communicate via standardized protocols (e.g., REST, SOAP).

  • Pros:
    Reusability – Services can be shared across apps.
    Scalability – Services scale independently.
    Technology Agnostic – Different services can use different tech.

  • Cons:
    Complexity – Requires orchestration and service discovery.
    Security – Requires strong inter-service protection.
    Latency – Network-based communication adds delay.

  • Best For: Large distributed systems, legacy modernization.

  • Focus: Scalability, Security, Flexibility.

11
New cards

🔹 Microservices

  • Concept: Apps broken into independent services, each owning a specific responsibility.

  • Pros:
    Scalability – Services scale based on demand.
    Faster Development – Small teams own different services.
    Fault Isolation – Failure in one service doesn’t crash system.

  • Cons:
    DevOps Burden – Deployment and monitoring of many services.
    Data Consistency – Difficult to maintain across services.

  • Best For: High-traffic, cloud-native systems.

  • Focus: Performance, Scalability, Fault Tolerance.

12
New cards

🔹 Event-Based

  • Concept: Components communicate through publish/subscribe async events.

  • Pros:
    Loose Coupling – Services don't call each other directly.
    Real-Time – Fast, responsive systems.
    Scalability – Event queues allow high throughput.

  • Cons:
    Debugging – Hard to trace event flow.
    Out-of-Order Events – Requires handling and retry logic.
    Infrastructure Needs – Needs brokers like Kafka or RabbitMQ.

  • Best For: Real-time analytics, IoT, notifications.

  • Focus: Scalability, Performance, Flexibility.

13
New cards

Best Use Cases for Event-Based Architecture

knowt flashcard image
14
New cards

Choosing the Right Architecture for Trade-offs

knowt flashcard image
15
New cards

Choosing the Right Architecture Based on Real-World Needs

knowt flashcard image
16
New cards

Which architecture is best for simple data processing?

Pipe-and-Filter.

17
New cards

Which architecture suits AI and knowledge-based systems?

Blackboard.

18
New cards

What style is ideal for enterprise apps?

Layered or SOA.

19
New cards

What’s best for scalable, resilient systems?

Microservices.

20
New cards

How do Event-Based Architecture and Microservices work together, and why is this combination effective?

  • How to Combine:
    Microservices are designed as small, independently deployable units. Instead of making direct API calls, they use event-based communication by publishing and subscribing to messages—resulting in a highly decoupled system.

  • Steps to Implement:

    • Use an event broker (e.g., Kafka, RabbitMQ) to handle message delivery.

    • Each microservice subscribes to specific events and reacts accordingly.

    • Services publish events like "Order Created" or "Payment Processed" that trigger actions in other services.

  • Example:

    • An Order Service publishes an "Order Placed" event.

    • Inventory Service listens and updates stock.

    • Shipping Service listens and begins shipment prep.

  • Why It’s Effective:

    • Scalability: Services can be scaled independently.

    • Resilience: A failure in one service doesn't affect others.

    • Flexibility: New services can join by simply subscribing to existing events.

21
New cards

How does combining Event-Based Architecture with SOA improve system design?

  • How to Combine:
    SOA normally uses synchronous communication (e.g., REST, SOAP). By integrating event-driven mechanisms, services publish or listen to events, reducing tight coupling.

  • Steps to Implement:

    • Services still use standard protocols (SOAP/REST).

    • Instead of making direct service calls, they publish events (e.g., "User Registered").

    • Other services listen for and respond to these events.

  • Example:

    • Customer Service publishes "New Customer Registered".

    • Marketing Service listens and sends a welcome email.

  • Why It’s Effective:

    • Flexibility: New services can be added by subscribing to events.

    • Performance: Reduces latency by avoiding blocking service calls.

22
New cards

How does Event-Based Architecture enhance a Layered Architecture system?

  • How to Combine:
    Instead of tightly synchronized interactions between layers (e.g., UI → Logic → DB), layers send and respond to events asynchronously.

  • Steps to Implement:

    • Each layer emits or subscribes to events for processing.

    • E.g., Presentation → Business Logic → Data Layer via event triggers.

  • Example:

    • UI sends "Deposit Made" event.

    • Logic Layer processes and validates.

    • Data Layer asynchronously updates DB.

  • Why It’s Effective:

    • Loose Coupling: Layers operate independently.

    • Scalability: Layers can scale based on event load.

23
New cards

What’s the advantage of implementing Microservices with a Layered Architecture?

  • How to Combine:
    Each microservice internally follows a layered structure (Presentation → Business Logic → Data Access), rather than using one global monolith.

  • Steps to Implement:

    • Split business functions into separate microservices.

    • Each has its own layered internal design.

  • Example:

    • User Service with Presentation, Logic, and DB layers.

    • Payment Service with its own set of internal layers.

  • Why It’s Effective:

    • Decoupling: Services evolve independently.

    • Maintainability: Each can be updated or scaled without affecting others.

24
New cards

How does combining Microservices with SOA improve software architecture?

  • How to Combine:
    SOA is typically monolithic and service-based. Microservices split those services into smaller, independently deployable units.

  • Steps to Implement:

    • Break SOA services (e.g., HR, Payments) into microservices.

    • Use REST APIs or service buses for communication.

  • Example:

    • ERP System: HR, Finance, Supply Chain split into separate microservices.

  • Why It’s Effective:

    • Flexibility: Smaller parts evolve independently.

    • Speed: Faster deployment and iteration of each function.

25
New cards

What happens when you combine Event-Based Architecture, Microservices, and SOA?

  • How to Combine:
    Microservices provide independent modules. SOA orchestrates high-level workflows. Event-based messaging binds them together asynchronously.

  • Steps to Implement:

    • Microservices publish and consume events (e.g., "Order Placed").

    • SOA layer coordinates the flow using event-based triggers.

  • Example:

    • Order Service publishes event.

    • Inventory Service updates stock.

    • Payment Service processes the payment, all via events.

  • Why It’s Effective:

    • Scalability: Each service scales on its own.

    • Performance: Async handling improves responsiveness.

    • Resilience: Failures don’t cascade across the system.

26
New cards

Why combine architectural styles in system design?

Combining styles provides scalability, flexibility, and maintainability by leveraging the strengths of each pattern:

  • Event-Driven + Microservices → Best for scalability and fault tolerance

  • Event-Driven + SOA → Enables loose coupling and enterprise flexibility

  • Microservices + SOA → Combines modular development with enterprise-wide communication

  • Microservices + Layered → Offers clear structure with scalable, independent services

27
New cards

How does Amazon combine hybrid architectures in its e-commerce platform?

Architectures: Microservices + Event-Driven + SOA

  • Microservices: Break down into services (auth, order, inventory)

  • Event-Driven: Publishes events like "Order Placed" to trigger other services

  • SOA: Legacy systems (e.g., catalog, payments) use REST/SOAP

Benefits:
Flexibility, Real-time responsiveness, Smooth legacy integration

28
New cards

How is hybrid architecture applied in online banking systems like Wells Fargo?

A:

Architectures: Microservices + SOA + Layered

  • Microservices: Used in new features like mobile apps

  • SOA: Powers core banking (balances, transfers)

  • Layered: Backend uses separate presentation, logic, and data layers

Benefits:
High modularity, Strong compliance, Clean maintainability

29
New cards

What hybrid architecture powers Netflix’s content delivery?

Architectures: Microservices + Event-Driven + SOA

  • Microservices: Handle auth, recs, billing

  • Event-Driven: Events like "Watch History Updated" trigger recommendations

  • SOA: Backend systems (e.g., profiles, billing) use SOA for reliability

Benefits:
Real-time personalization, Performance, System resilience

30
New cards

How are hybrid architectures used in EHR (Electronic Health Records)?

Architectures: SOA + Event-Driven + Layered

  • SOA: Manages stable services (patient records, billing)

  • Event-Driven: Triggers alerts (e.g., "New Test Result")

  • Layered: Internally structured into UI, logic, and data layers

Benefits:
Real-time updates, Loose coupling, Scalable health systems

31
New cards

How does Facebook use hybrid architecture to scale social media features?

Architectures: Microservices + Event-Driven + Layered

  • Microservices: For feed, auth, ads, messaging

  • Event-Driven: Triggers like "New Post" update feeds

  • Layered: Backend separates logic from presentation and storage

Benefits:
Feature independence, Real-time communication, Strong maintainability

32
New cards

How do platforms like Walmart or eBay apply hybrid architectures?

Architectures: SOA + Microservices + Event-Driven

  • SOA: For reliable core services (inventory, orders, payments)

  • Microservices: Handle search, promotions, recommendations

  • Event-Driven: "Item Purchased" or "Stock Updated" triggers downstream services

Benefits:
Scalability, Fast innovation, Real-time inventory and status updates

33
New cards

What are the main benefits of hybrid architectural styles?

  • 🔁 Scalability: Microservices + Event-Driven

  • 🔀 Flexibility: SOA + Microservices

  • 🔧 Maintainability: Layered + Modular components

  • Real-Time Processing: Event-Driven async updates

  • 🛠 Best for complex, large-scale systems that mix modern and legacy tech