InterviewSolution
| 1. |
In a microservices architecture, what are smart endpoints and dumb pipes? |
|
Answer» Martin Fowler introduced the concept of "smart endpoints & dumb pipes" while describing microservices architecture. To give context, one of the main characteristic of a based system is to build small utilities and connect them using pipes. For example, a very popular way of finding all java processes in LINUX system is Command pipeline in Unix shell ps elf | grep java Here two commands are separated by a pipe, the pipe’s job is to forward the output of the FIRST command as an input to the second command, NOTHING more. like a dumb pipe which has no business logic except the routing of data from one utility to another. In his article Martin Fowler compares Enterprise Service Bus (ESB) to ZeroMQ/RabbitMQ, ESB is a pipe but has a lot of logic INSIDE it while ZeroMQ has no logic except the persistence/routing of messages. ESB is a fat layer that does a lot of things like - security checks, routing, business flow & validations, data transformations, etc. So ESB is a kind of smart pipe that does a lot of things before passing data to next endpoint (service). Smart endpoints & dumb pipes advocate an exactly opposite idea where the communication channel should be stripped of any business-specific logic and should only distribute messages between components. The components (endpoints/services) should do all the data validations, business processing, security checks, etc on those incoming messages. Microservices team should follow the principles and protocols that WORLDWIDE web & Unix is built on. |
|