Example: A simple login process
This example shows the flow when a user logs into a web application:
- User -> Web Server:
Login(username, password) - The user initiates the login by sending their username and password to the web server.
- Web Server -> Database:
SELECT * FROM users WHERE username = ? - The server queries the database to find the user's record.
- Database -> Web Server:
User record - The database returns the user's record to the server.
- Web Server -> User:
Login Success - The server verifies the password, and if correct, sends a success message back to the user.