iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

7.3 Service-Oriented Architecture

Service-Oriented Architecture (SOA) treats business functions as reusable network-accessible services. Modern SOA is more often realised as microservices or API-led integration than as classical SOAP / ESB.

7.3 Service-Oriented Architecture (SOA)

Three SOA generations

SOAP / ESB WSDL contracts XML Centralised broker Legacy enterprise REST + API gateway OpenAPI JSON Lighter Cloud-friendly Microservices + mesh Independently deployable Service mesh (Istio) Polyglot Modern default Figure 7.3 - SOA evolution: ESB-centric to gateway-centric to mesh-centric.

Web services - four styles

StyleFormatBest for
SOAPXML envelopesLegacy enterprises; strong contracts
RESTHTTP verbs + JSONDe-facto default
GraphQLSingle endpointClient-shaped queries
gRPCprotobuf + HTTP/2Service-to-service high throughput

Bank service decomposition example

ServiceOperations
Accountcreate, read, freeze
Paymentinitiate, refund, status
Statementgenerate, retrieve
NotificationSMS, email, push
Identityauthenticate, authorise, audit

Integration patterns

PatternWhen
Request / replySynchronous
Pub / subAsynchronous broadcast
SagaDistributed transactions via compensation
OutboxReliable event publication from a DB write
CQRSSeparate read and write models

Anti-patterns

  • Distributed monolith (services that must deploy together).
  • ESB at the centre of every flow (single point of failure).
  • No versioning; breaking change ripples to consumers.
  • Synchronous chains 5 hops deep; one outage takes down all.
Mentor’s tip: SOA = services + contracts + discoverability + loose coupling. Modern realisation is REST + API gateway or microservices + mesh. The contract catalogue outlives every UI; protect it.

Discussion

Loading…