Skip to content
The Chat Archive
o1-mini-2024-09-12· OpenAI WildChat-4.8M (AI2)

—> so drawing boundaries need to be based on the business capbabilies not in the…

  1. User

    —> so drawing boundaries need to be based on the business capbabilies not in the technical ones : —> Fowler , said microsrvice should be “organized around business capabilities “ not technical needs Drawing boundaries based on technical needs is an anti-pattern Per Lewis and Fowler, microservices should be “organized around business capa‐ bilities,” not technical needs. Similarly, Parnas, in an article from 1972, recom‐ mends decomposing systems based on modular encapsulation of design changes over time. Neither approach necessarily aligns strongly with the boundaries of serverless functions.

    Q- can give example to bad boundaries by technical expertise and how to solve but make based on business boundaries Q- use the example retail-sytem like airbnb ?

  2. Assistant

    Certainly! Let's delve into a concrete example to illustrate why drawing boundaries based on technical expertise is problematic and how aligning them with business capabilities leads to a more effective architecture. We'll use a retail system similar to Airbnb to contextualize the explanation.

    Bad Boundaries: Technical Expertise Approach

    Scenario: Imagine you're building a retail platform like Airbnb. Instead of organizing your microservices around business functionalities, you decide to split them based on technical layers or specific technical expertise. For instance:

    1. Database Service: Handles all interactions with the database, such as CRUD (Create, Read, Update, Delete) operations.
    2. Authentication Service: Manages user authentication and authorization.
    3. Notification Service: Deals with sending emails, SMS, and push notifications.
    4. Logging Service: Responsible for logging application events and errors.

    Problems with This Approach:

    1. Tight Coupling:

      • Different parts of the application rely heavily on these technical services. For example, the Reservation Service needs to interact with both the Database Service and the Notification Service, leading to tight coupling between critical business functions and technical services.
    2. Scalability Issues:

      • If there's a spike in notifications (e.g., sending reservation confirmations), the Notification Service becomes a bottleneck, potentially affecting unrelated business functionalities that rely on it.
    3. Limited Business Context:

      • Technical services lack the necessary business context. For instance, handling a reservation might require specific business rules that don't fit neatly into the generic Database Service or Logging Service.
    4. Inflexibility to Change:

      • Adapting to new business requirements becomes cumbersome. If the business wants to introduce a new loyalty program, integrating it would require changes across multiple technical services rather than a single business-aligned service.

    Good Boundaries: Business Capabilities Approach

    Reimagined Scenario: Instead of splitting services by technical layers, you organize them around core business functionalities. For the Airbnb-like platform, key business domains might include:

    1. User Management Service:

      • Handles user registration, profiles, authentication, and authorization.
    2. Reservation Service:

      • Manages property listings, bookings, availability, and reservation confirmations.
    3. Payment Service:

      • Processes payments, refunds, and handles financial transactions.
    4. Review and Rating Service:

      • Manages user reviews, ratings, and feedback for properties and hosts.
    5. Notification Service:

      • Sends out notifications related to reservations, payments, and reviews.

    Advantages of This Approach:

    1. High Cohesion Within Services:

      • Each service encapsulates all the necessary business logic related to its domain. For instance, the Reservation Service not only handles bookings but also applies business rules like cancellation policies and booking limits.
    2. Loose Coupling Between Services:

      • Business services interact through well-defined APIs or messaging, minimizing dependencies on technical layers. For example, the Reservation Service can communicate directly with the Payment Service without going through a separate database layer.
    3. Scalability Aligned with Business Needs:

      • If reservations surge during peak travel seasons, only the Reservation Service needs to scale, without impacting other services like User Management or Review and Rating.
    4. Enhanced Flexibility and Agility:

      • Introducing new business features, such as dynamic pricing or a loyalty program, can be implemented within the relevant service without widespread architectural changes.
    5. Clear Ownership and Responsibility:

      • Teams can own specific business services, fostering accountability and expertise in particular business domains. A team responsible for the Payment Service focuses on financial compliance, security, and transaction optimization.

    Transitioning from Technical to Business Boundaries

    Steps to Align Boundaries with Business Capabilities:

    1. Identify Core Business Domains:

      • Collaborate with business stakeholders to map out key functionalities and domains. For Airbnb, these might include user management, reservations, payments, reviews, etc.
    2. Define Clear Service Responsibilities:

      • Ensure each microservice has a well-defined scope aligned with a specific business capability. Avoid overlapping functionalities across services.
    3. Establish Effective Communication Mechanisms:

      • Use APIs, event-driven architectures, or messaging queues to facilitate interaction between business services without relying on shared technical components.
    4. Decouple Technical Concerns:

      • While technical services (like logging or notification) are still necessary, they should support business services rather than dictate the architecture. For example, the Notification Service serves multiple business services without being a core business domain itself.
    5. Iteratively Refine Boundaries:

      • As the business evolves, continuously assess and adjust service boundaries to ensure they remain aligned with current business needs and objectives.

    Conclusion

    By organizing microservices around business capabilities, you create an architecture that is more resilient, scalable, and adaptable to change. This approach fosters better alignment between technical implementations and business objectives, ensuring that the system can grow and evolve in tandem with the organization's needs. In contrast, defining boundaries based solely on technical expertise can lead to tightly coupled, inflexible systems that struggle to meet dynamic business requirements.