System Design
15. Software Design PatternsAnimated
Proxy Pattern
A stand-in that controls access to another object.
The idea
A proxy can lazy-load, cache, check permissions or call a remote service.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Clients see only the proxy's address.
- step:
- 1/4
- at:
- Clients
1/8
The green dot is a request moving through the system.
Step by step
- 1Client calls the proxy
- 2Proxy checks or caches
- 3Forwards to the real object
- 4Returns the result
Where it is used
Remote, protection and caching proxies.
Watch out for
Extra latency and indirection.