DEV Community

Discussion on: Explain Distributed Systems Like I'm Five

Collapse
 
jamesmh profile image
James Hickey

Most products have various features. Take Amazon:

  • Search
  • Browse
  • Order
  • Payment
  • Shipping
  • etc.

Most apps have those features in one codebase, and therefore as part of one deployable (web) app.

Distributed systems build each feature as independently deployable apps.

If Payment needs info from Order, then Payment will get that data via Order's internal API (perhaps over HTTP).

If Payment needs to inform Shipping that the payment was successful: Payment will simply emit an event PaymentSuccessful that Shipping is listening for (asynchronously). Shipping will now decide to ship the order.

Other features can also listen for those events, so on PaymentSuccessful the Order feature may choose to "close" the order for further editing, etc.

In the end, distributed systems are when each feature communicates over-the-wire instead of within the same process/run-time (e.g. in code).