Service Architecture Design Patterns

These pattern are useful when you are creating an API that will be called by 3rd party services or another software system.

These services are called from public networks.

Service-Oriented Pattern (SOP)

  • Discrete business services.
  • Use network to communicate.
  • HTTP, XML, SOAP, binary.
ProsCons
Business domain alignmentClients must handle slow, offline network
High abstractionCoarse interfaces
Discoverable, resilientMany harm performance
Allow 3rd partiesSecurity issues
Cross-platform

Microservice Pattern

Like SOA but with fine grained services,

  • Services calling services
  • Can use fast private network
  • Deployed on multiple servers
ProsCons
ModularMust cope with slow, offline network
Reduced abstractionMore unanticipated cummunications
Discoverable, resilientHard to do transactions
Can use fast networkHard to test, debug, & deploy
Less coarse interfaces

Message-Bus Pattern

  • Services connected to shared data bus
  • Uses messages for communication
  • Supports discovery, failover
ProsCons
Easy to extendBus = single point of failure
Simple communicationCoarse communications
Very flexibleCan be slow
Easy to scaleHard to test, debug
Easy discovery, failover