Glossary · Automation software engineering and architecture
Request-response pattern
Also known as: Request-reply, Client-server interaction
German: Request-Response-Muster
In communication and software architecture, the request-response pattern is an interaction in which a client sends a request to a server and waits for, or later receives, a response that belongs to that request.
- Software engineering
In one sentence
In the request-response pattern, a client sends a request to a server and receives a response that belongs to it.
Example
The HMI requests the current batch status from the controller, and the controller replies with the step number and elapsed time.
How it applies
- Engineering: Request-response suits commands and queries that need a result. Clients must handle lost or late responses with Timeouts, and servers should be able to recognize repeated requests.
- Performance: Polling data by repeated requests creates load and latency. For continuous data, subscriptions or Publish-subscribe pattern are often better.
- Documentation: Interface documentation should list each request, its parameters, response codes, typical response times and timeout recommendations, plus error responses.
Request-response vs. publish-subscribe
Request-response is initiated by the client and pairs each request with a response. Publish-subscribe pattern is initiated by the data source and distributes updates to all subscribers without requests.