Orientada a Servicios
SOA
Escrito por Darjus Kazakevic · revisado el
The 2000s way to join a company's systems, which microservices reacted against.
Service-Oriented Architecture (SOA) organises a company's systems as coarse, reusable services. Each one exposes a business function, such as customer data or billing, through a formal contract. At the centre sits an Enterprise Service Bus (ESB): middleware that routes messages, converts formats and runs multi-step flows between systems that do not speak the same language.
SOA was the 2000s answer to connecting many old and vendor systems, and it worked for that. But the central bus often became a bottleneck and a single point of failure, and central governance slowed every team. Microservices kept the service idea and dropped the smart bus.
En esencia — Share coarse business services across the company, joined by a central bus that routes, converts and orchestrates every message.
Cuándo recurrir a él
Recurre a él cuando
- A large company must connect many old, mixed-vendor systems
- Business functions must truly be reused across many applications
- Working across protocols and vendors is the central problem
Reconsidéralo cuando
- A single product or a new build; this is enterprise-scale machinery
- Small or mid-sized teams that central governance would slow down
- You want independent teams that deploy on their own (use microservices)
The building blocks
- Coarse, reusable services
- Services model whole business functions, such as Customer or Billing, and many applications share them. Reuse across the company is the main goal.
- Enterprise Service Bus (ESB)
- Central middleware that routes, converts and orchestrates messages between services. It is the defining and most criticised part of classic SOA.
- Formal contracts
- Services publish machine-readable contracts, classically WSDL over SOAP, so systems in different languages can call each other through an agreed interface.
- Central governance
- A central group sets standards, contracts and a canonical data model (one shared definition of each business entity) for all services. This gives consistency but slows delivery.
SOA in practice
- Keep business logic out of the bus
- Every rule you put in the ESB makes it a bigger bottleneck and a single point of failure. Let the bus route and convert; keep decisions in the services.
- Make the contract the only boundary
- Consumers depend on the published contract, never on a service's internals or database. The contract is what lets very different systems work together.
- Build a service for reuse, or do not build it
- The payoff is many consumers. A service with only one consumer carries all the weight of SOA and gets none of the benefit.
- Prefer events to central orchestration
- Central orchestration is easy to see but puts all the risk in one place. Where the flow allows, let services react to events instead.
Errores habituales
- Business rules piling up in the ESB until it is a monolith of its own
- One bus outage stopping every system in the company
- Approval processes so heavy that a small change takes months
- Calling a set of services with a smart bus “microservices”