Service-oriented architecture
A retailer untangles nine hand-built links between its applications and systems: services named for business capabilities, shared contracts, a bus in the middle, and how microservices differ.
In 30 seconds
Service-oriented architecture (SOA) organises a company’s software as a set of services. Each service offers one business capability, such as checking credit or creating an order, to any application that needs it.
Every service publishes a formal contract saying what it accepts and returns. Classic SOA connects everything through an enterprise service bus, which routes messages and converts formats.
Microservices keep the idea of services but make them smaller, give each its own data, and replace the smart bus with simple connections.
Service-oriented architecture, step by step
This is SOA as large companies built it in the 2000s. The term is used loosely, a bus is not strictly required, and where SOA ends and microservices begin is debated.
- Step 1: Applications tangled together. A retailer has three applications (web shop, call centre, mobile app) and three back-office systems for customers, orders and billing. Each application is wired straight into each system in its own way: a nightly file here, a direct database query there. That makes nine hand-built links, and changing one system breaks several.
- Step 2: Services with capabilities. Service-oriented architecture starts by wrapping each system as a service. A service offers a business capability, something the company does, such as checking a customer’s credit or creating an order. Applications ask for the capability by name and no longer care which software, database or machine sits behind it.
- Step 3: Shared contracts. Every service publishes a formal contract: the operations it offers, the data each one needs and what it returns. The contract is written in a neutral format (in classic SOA, a WSDL file describing XML messages) and listed in a company-wide registry. Any application, in any programming language, can read it and call the service.
- Step 4: The enterprise service bus. Classic SOA puts one piece of shared software in the middle: the enterprise service bus, or ESB. Every application and every service plugs into the bus, and only into the bus. Three applications and three services need six connections instead of nine, and a newcomer needs just one.
- Step 5: What the bus does. The bus is more than a wire. It routes each message to the service that offers the capability. It transforms formats, so an app that speaks JSON can use a service that expects XML. And it bridges protocols, taking a request over HTTP and delivering it through a message queue. The logic of connecting things lives in the bus.
- Step 6: Composing services. Because each capability exists once, larger business processes can be assembled from them. Placing an order becomes a sequence: check credit, create the order, send the invoice. In classic SOA the bus, or a process engine attached to it, runs the sequence. This is called orchestration, and it is the reuse SOA was built for.
- Step 7: SOA and microservices. Microservices grew out of SOA and keep its core idea: services with contracts. The differences are of degree. SOA services tend to be few and large, often share a database, and rely on a smart central bus. Microservices are small, each owns its data, talk over plain HTTP or simple queues, and are deployed independently.
Try it yourself
Learn this first
Spotted a mistake on this page?