An architectural style is a constraint on how parts communicate — a vocabulary. REST, client–server, pipes and filters, and event-driven are styles. A pattern is a named structure you can draw (layered, hexagonal). Do not treat “we are a REST shop” as a layered architecture, or the reverse. Patterns: Architectural Patterns.
Client–server and n-tier
Clients request; servers own resources and policy. Scale and security concentrate on the server. n-tier is client–server with extra process hops (web, app, data). The style says who initiates and who owns state, not how many C# projects you have.
REST (the style, not “JSON over HTTP”)
Fielding’s REST is an architectural style for hypermedia systems: resource identifiers, uniform interface, stateless interactions, cacheable responses, optional code-on-demand. Most “REST APIs” are HTTP + JSON resource endpoints. That can still be a good HTTP API if you are honest:
- Nouns as resources, verbs as HTTP methods, errors as status codes.
- Stateless: the server does not need this client’s previous socket. Auth tokens are not a session in your process, but they are still state somewhere.
- Caching needs headers (
ETag,Cache-Control), not hope.
RPC-over-POST-everything is a different style (often fine). Calling it REST hides the trade-off.
Pipes and filters
Each filter transforms a stream; pipes compose them. Compilers, CI, and some ETL look like this. Independent filters are easy to test. Awkward when you need random access to the whole dataset or rich shared state.
Event-driven / pub-sub
Producers emit events; consumers subscribe. Time and topology decouple. You give up an easy call stack and gain eventual consistency. See message brokers.
SOA vs microservices
Both split the system into networked services. SOA (enterprise vintage) often shared an ESB and canonical types. Microservices push data ownership into the service and accept duplication. The style choice is really: who owns the data and the release.
Pitfalls
- “REST” that is one
POST /apiwith an action field. - Choosing a style because of a conference talk, then implementing a different one.
- Event-driven UI plus a single shared database — you kept the coupling and lost the transactions.