Software Architecture Styles - Part 1
Question 1: List the eight fallacies of distributed computing.
Answer: The eight fallacies of distributed computing are a set of commonly held misconceptions or assumptions about the behavior and characteristics of distributed systems. They were originally formulated by Peter Deutsch in the context of networked computing. Here are the eight fallacies:
1. The Network Is Reliable: Assuming that the network is always available, stable, and free from failures. In reality, networks can experience outages, congestion, and latency issues, leading to potential communication failures and disruptions.
2. Latency Is Zero: Assuming that network communication has no delay. In practice, network latency is inherent, and it can vary based on factors such as distance, congestion, and processing time, which can impact system performance and response times.
3. Bandwidth Is Infinite: Assuming that the network has unlimited capacity for data transmission. In reality, network bandwidth is limited, and it needs to be shared among multiple systems and users, potentially leading to bottlenecks and congestion.
4. The Network Is Secure: Assuming that the network is secure from unauthorized access, attacks, or data breaches. In reality, networks are susceptible to various security threats, such as eavesdropping, data interception, and unauthorized access, requiring appropriate security measures to protect sensitive information.
5. Topology Doesn't Change: Assuming that the network topology remains static and unchanging. In reality, network configurations, connections, and topologies can change dynamically due to factors like system failures, load balancing, scaling, and network reconfigurations.
6. There Is One Administrator: Assuming that a single entity or administrator has complete control and knowledge of the entire network. In practice, distributed systems often involve multiple administrative domains, organizations, or parties, each with their own autonomy, policies, and management.
7. Transport Cost Is Zero: Assuming that network communication has no associated costs or overhead. In reality, network communication can incur costs such as bandwidth usage, data transfer fees, and infrastructure expenses, which should be considered in system design and optimization.
8. The Network Is Homogeneous: Assuming that the network infrastructure and protocols are uniform and consistent across all components. In practice, distributed systems often operate in heterogeneous environments with different hardware, operating systems, protocols, and network conditions, requiring compatibility and interoperability considerations.
Understanding these fallacies helps architects and developers design distributed systems that are resilient, fault-tolerant, and can handle the inherent challenges and uncertainties of networked computing. It emphasizes the need for robust error handling, fault tolerance mechanisms, security measures, and consideration of network-related factors in system design and implementation.
Question 2: Name three challenges that distributed architectures have that monolithic architectures don’t.
Answer: Distributed architectures introduce several challenges that are not typically present in monolithic architectures. Here are three key challenges specific to distributed architectures:
Network Communication and Latency: In a distributed architecture, components or services are spread across different networked nodes. This introduces the challenge of network communication and latency. Components may need to communicate over the network, which can introduce delays, network failures, and performance variations. Managing and optimizing network communication becomes crucial to ensure efficient and reliable interactions between distributed components.
Coordination and Consistency: Distributed architectures often involve multiple components that need to work together to accomplish tasks. Ensuring coordination and maintaining consistency across distributed components can be challenging. Coordinating actions, managing shared data, and maintaining distributed consistency without introducing conflicts or synchronization issues require careful design and implementation of distributed algorithms, protocols, and mechanisms.
Fault Tolerance and Resilience: Distributed architectures are more susceptible to failures and faults due to the increased number of components and the reliance on network communication. Ensuring fault tolerance and resilience in the face of component failures, network outages, or partial system failures becomes critical. Implementing mechanisms such as redundancy, replication, fault detection, error handling, and recovery strategies is necessary to maintain system availability and reliability.
These challenges require architects and developers to carefully consider the distributed nature of the architecture, design for fault tolerance and resilience, implement appropriate communication patterns, address issues related to data consistency and coordination, and employ techniques for managing latency and network failures. Successful navigation of these challenges is crucial to building robust, scalable, and reliable distributed systems.
Question 3: What is stamp coupling?
Answer: In a distributed architecture if a service makes a call to another service and receives data more than required then it is an issue for network bandwidth. Suppose Service A needs to make an interservice call to Service B to get just the name of an Employee, but Service B provides more details about the Employee that are not required by Service A. In such case, if the frequency for this call is high then it will be an issue and that is referred to as "stamp coupling".
Question 4: What are some ways of addressing stamp coupling?
Answer: Common ways to resolve stamp coupling:
1. Field selector in the contract to reduce the response size.
2. GraphQL
3. Additional Rest endpoint for a specific purpose.
In summary, the solution will work if it reduces the size of data passing between services.
Comments
Post a Comment