Questions & explanations
1. Compare the SOA principle of service autonomy with service statelessness.
Service autonomy means that a service has control over its own resources (like databases) and does not depend on other services for its operation. It can be deployed and managed independently. Service statelessness means that a service does not retain state between requests; each request contains all the information needed to process it. Autonomy supports statelessness because if a service manages its own state, it can be designed to be stateless externally. Both principles improve scalability and reliability. For integration, autonomous services can be scaled independently, and stateless services are easier to load balance. However, some services may need to maintain state (e.g., a shopping cart), but they can still be autonomous.
2. Compare the scalability of polling vs event-driven consumers in a high-throughput system.
Event-driven consumers generally scale better in high-throughput systems because they are triggered only when work is available, avoiding wasted resources. They can handle many concurrent consumers efficiently using thread pools or asynchronous I/O. Polling consumers, especially with fixed intervals, can cause 'thundering herd' problems if many consumers poll the same source simultaneously, leading to contention. However, polling can be scaled by partitioning the message source (e.g., multiple queues) and assigning each consumer to a partition. Event-driven systems require careful design of the notification mechanism to avoid bottlenecks, but overall they are preferred for high throughput.
3. How does the principle of loose coupling apply to SOA integration?
Loose coupling in SOA means that services are designed to minimize dependencies on each other. They communicate only through their contracts, and changes to one service's implementation do not require changes to its consumers, as long as the contract remains the same. This is achieved by using standardized protocols (like HTTP, SOAP) and data formats (like XML, JSON), and by avoiding shared databases or direct method calls. Loose coupling makes integration more flexible because services can be replaced, upgraded, or scaled independently. For example, a payment service can be swapped from one provider to another without affecting the order service, as long as the contract is maintained.
4. What is the principle of service contract in SOA?
The principle of service contract in Service-Oriented Architecture (SOA) states that services must have a formal, standardized contract that describes their capabilities, inputs, outputs, and behavior. This contract is typically defined using a standard interface description language like WSDL for SOAP services or OpenAPI for RESTful services. The contract serves as an agreement between the service provider and consumer, ensuring that both parties understand how to interact. It promotes loose coupling because consumers depend only on the contract, not on the service's implementation. A well-defined contract also enables services to be discovered and reused across the enterprise.
5. How does climate change risk analysis differ from traditional weather risk analysis?
Traditional weather risk analysis focuses on short-term events like storms or heatwaves using historical data. Climate change risk analysis looks at long-term trends over decades, considering how climate change alters the frequency and intensity of those events. For instance, traditional analysis might calculate the 100-year flood level from past records. Climate change risk analysis adjusts that level upward based on projected sea level rise and increased rainfall. The time horizon is much longer, and the uncertainties are larger because we cannot predict future emissions exactly. This makes climate risk analysis more about planning for a range of possible futures.
6. What is the principle of service abstraction and why is it important for integration?
Service abstraction means that a service hides its internal implementation details from consumers. Consumers only see the service contract and the functionality it provides, not the underlying technology, databases, or business logic. This is important for integration because it allows consumers to be decoupled from the service's internals. For example, a service that calculates shipping costs might internally use a complex rules engine, but consumers only send package details and receive a cost. If the rules engine changes, the service contract remains the same, so consumers are unaffected. Abstraction also improves security by exposing only necessary information.
7. Compare GraphQL and REST in terms of versioning and evolution for integration.
REST APIs often require versioning (e.g., /v1/users, /v2/users) when breaking changes are made, which can lead to multiple versions being maintained. GraphQL avoids versioning by allowing the schema to evolve without breaking existing clients. New fields and types can be added, and old fields can be deprecated (marked with @deprecated) but remain available. Clients only request the fields they need, so they are unaffected by additions. However, removing a field is a breaking change and must be handled carefully. For integration, GraphQL's approach reduces the burden of maintaining multiple API versions, but it requires discipline in deprecation and communication.
8. Compare ethical requirements for an AI hiring system vs. a traditional hiring process.
An AI hiring system must avoid bias against gender, race, or age. For example, if the training data has mostly male candidates, the model might favor men. Ethical requirements include: 'The model must have similar acceptance rates across demographic groups.' This is called fairness. Traditional hiring also has bias, but it's from human judgment. AI can amplify bias if not checked. Requirements must include bias testing and mitigation, like reweighting data. Also, AI systems should be transparent about how they rank candidates. Unlike traditional processes, AI decisions can be audited systematically, but they also raise privacy concerns about using personal data.
9. How does resilience engineering differ from traditional risk management?
Traditional risk management focuses on identifying and reducing specific risks, often through procedures and barriers. Resilience engineering, on the other hand, accepts that some risks are unknown or unavoidable and builds capacity to adapt. For example, a traditional approach might install a fire suppression system. A resilient approach would also train staff to manually fight fires and have evacuation routes that work even if the suppression system fails. Resilience engineering emphasizes flexibility and learning, while traditional risk management aims for control and compliance. Both are important, but resilience is better for complex, changing environments.
10. Compare requirements for a CPS like a smart thermostat vs. a pure software app like a calculator.
A smart thermostat has physical components (temperature sensor, heater control) and must respond in real time. Its requirements include: measure temperature every second, turn on heater if below set point, and ensure safety (no overheating). A calculator app has no physical parts and no real-time needs; it just processes user input. The thermostat requirements must handle sensor noise and hardware failures, while the calculator only needs correct math. The thermostat also needs low power consumption, while the calculator can use more energy. Testing the thermostat requires physical environment simulation, whereas the calculator can be tested purely in software.
11. Compare data management requirements for IoT vs. a traditional database application.
IoT systems generate massive amounts of time-series data from many sensors. A traditional database app handles smaller, structured transactions. For IoT, requirements often include data ingestion at high speed, like thousands of readings per second. Data must be stored efficiently, sometimes using time-series databases. Also, IoT data may need to be processed in real-time for alerts, like a fire alarm. Traditional apps usually process data on demand. IoT data management must handle data loss tolerance: if a sensor fails, some data might be lost. Requirements also specify data retention policies, like keeping raw data for 30 days and aggregated data for a year.
12. Give an example of applying the principle of service reusability in an integration scenario.
A company has multiple applications that need to validate customer addresses. Instead of each application implementing its own address validation logic, they create a single Address Validation Service with a standard contract. This service is reused by the order entry system, the shipping system, and the customer relationship management (CRM) system. Each system sends an address and receives a validated address or error. This reduces duplication, ensures consistent validation rules, and simplifies maintenance. The service is designed to be stateless and can be called synchronously or asynchronously, making it reusable across different integration flows.