Architecture Tactics ‐ Availability - SENG-350-2024-fall/Team4 GitHub Wiki
Tactics
Exception handling
If a database query fails, the frontend must handle the situation appropriately and notify the user of what went wrong.
Testing Criteria:
- If the backend database cannot be accessed within a given time frame, the frontend must issue an error signalling the backend connection has timed out.
- If a query made to the backend is invalid, the backend must issue an error, and the frontend must display an error message saying that the query is invalid.
Redundant Spare
If the primary database is unreachable, swap to a secondary backup database untill the primary is repaired.
Testing Criteria:
- If the primary database does not respond to a query, forward the request to the backup database instead.
- If the backup database is also unreachable, show an error
Authenticate Actors
The system must verify the identity of users and other entities before allowing access to resources or services. This ensures that only authorized actors can interact with secure data or perform specific actions.
Testing Criteria:
- When a user attempts to access restricted resources or features, the system should require them to log in or provide a valid authentication token.
- If the authentication fails (e.g., due to incorrect credentials or expired tokens), the frontend must display a clear error message indicating that the user must log in or re-authenticate.
- If the backend detects a suspicious or unauthorized access attempt, it must log the attempt and notify the frontend of a security alert.
- If a user session expires while they are actively using the application, the system should prompt them to re-authenticate and handle any unsaved data gracefully.
Ping/Echo
To ensure the system is functional at all times, the backend should ping the frontend on a regular basis to signal that the connection still exists.
Testing Criteria:
- The frontend should display an error when idling if there is no ping received after 2 minutes since the previous ping.
Load Balancing
Load balancing distributes incoming requests across multiple servers or system instances to prevent any one resource from being overwhelmed, enhancing system availability and responsiveness. In Mister Ed, load balancing can ensure that requests from multiple users (patients, nurses, doctors) are handled efficiently, especially during peak usage times.
Testing Criteria:
- Simulate multiple concurrent requests to verify that the load is distributed across available servers.
- If one server becomes unresponsive, ensure that requests are seamlessly rerouted to operational servers without user disruption.
- Monitor response times during high traffic periods to ensure they remain within acceptable limits.
- Ensure that, if a server fails, the system can reroute and maintain consistent performance for users interacting with the application.