AV
HomeAboutProjectBlog

© 2026 Ave syah Shina. All rights reserved.

  1. Home
  2. Blog
  3. 18 — Messaging and Architecture — Brokers, Monoliths, Microservices, and the Shapes Between

18 — Messaging and Architecture — Brokers, Monoliths, Microservices, and the Shapes Between

August 13, 20267 min read
Download as Markdown

Messaging and architecture looked like unrelated topics until I lined them up against the same question. The shared axis that surfaced: messaging decouples producers from consumers across time, and architectural patterns are all positions on the coupling-to-split spectrum — how much you break the system into independently-evolving parts. [1][3] Both are answers to the same question: where do the seams go, and how loose are they?

The frame that helped is that "decoupling" is the load-bearing word for both halves. A monolith is maximally coupled — everything in one process, every change potentially touches everything. Microservices are minimally coupled — many independent processes with explicit boundaries. A message broker is the tool that lets two parts of a system communicate without knowing about each other's timing or existence — the producer writes a message and walks away; the consumer reads it whenever it can. The whole cluster is decisions about how tightly the parts of a system hold hands.

Message brokers: asynchronous, decoupled communication

A message broker is middleware that routes messages between distributed systems, enabling asynchronous communication [1]. Instead of service A calling service B directly (and failing if B is down, slow, or overloaded), A writes a message to the broker; the broker holds it until B is ready; B reads and processes it. A and B never know about each other directly — the broker is the intermediary.

The properties this unlocks:

  • Asynchrony. A doesn't wait for B to finish. A publishes the message and moves on.
  • Decoupling. A doesn't know B exists, only the broker. New consumers can subscribe without A changing.
  • Buffering. If B is overwhelmed, the broker holds messages until B catches up (within limits).
  • Reliability. Persistent brokers survive restarts; messages aren't lost.

The two dominant brokers sit at different points on the throughput-versus-routing axis:

  • RabbitMQ is the traditional message broker implementing AMQP, with rich routing — queues, exchanges, bindings that route messages by pattern [2]. It's built for complex message routing (pub/sub, request/reply, point-to-point) at moderate throughput. Use RabbitMQ when the routing topology is the point (work queues, task distribution, request/reply).
  • Apache Kafka is a distributed event streaming platform built for very high throughput and durability [3]. Kafka's model is an append-only log of events organized into topics and partitions; consumers read at their own pace. Kafka is less about per-message routing and more about replayable streams of events at scale. Use Kafka for event-driven architectures, real-time data pipelines, and log aggregation across many services.

The choice between them is a workload match. RabbitMQ for traditional request-style messaging with complex routing; Kafka for high-volume event streams where durability, replay, and partition parallelism matter.

Architectural patterns: positions on the coupling spectrum

The architectural patterns the roadmap lists are all answers to "how do I split the system," differing in where the seams go and how loose they are.

Monolith: maximally coupled

A monolithic application is a single cohesive unit — all components (UI, business logic, data access) in one codebase, deployed as one service [4]. The strength is simplicity: one codebase, one deployment, local function calls instead of network hops, easy debugging. The weakness is that every change redeploys the whole system, and the codebase becomes hard to reason about as it grows.

The monolith is the default and the right starting point for most systems. The advice I keep hearing from experienced engineers: start monolithic, extract services only when a specific boundary hurts. Premature splitting creates distributed-systems complexity (network failure, distributed transactions) without the benefits.

SOA and microservices: split by business capability

SOA (Service-Oriented Architecture) and microservices are positions further along the split axis [5][6]. Both structure the application as multiple services, each focused on a business capability (orders, users, billing), communicating over a network (HTTP, gRPC, or messaging).

  • SOA tends to mean larger services with shared infrastructure (an enterprise service bus), common in large enterprises.
  • Microservices tends to mean smaller, independently deployable services, often organized around bounded contexts, with decentralized governance.

The benefits: independent scaling (the busy service scales without redeploying others), independent deployment (a change to one service doesn't redeploy the world), technology diversity (different services can use different stacks). The costs are enormous: distributed-system complexity (network failure, eventual consistency, distributed transactions), operational overhead (deploy, monitor, debug many services), and the management challenge of service-to-service communication.

The rule of thumb: the complexity moves, it doesn't disappear. A monolith has internal complexity but simple deployment; microservices have simple internals per service but enormous deployment/operational complexity. The decision is which complexity the team can manage.

Serverless: functions, no boxes

Serverless computing pushes the abstraction further — the developer writes functions, the cloud provider handles all scaling and operation, billing is per-invocation [7]. There's no "server" to manage (the provider runs the function on demand). AWS Lambda, Google Cloud Functions, Vercel Edge Functions are the platforms.

The benefit: zero operational overhead and true scale-to-zero (no idle costs). The cost: cold-start latency, vendor lock-in, and limits on what a function can do (stateless, short-lived). Serverless fits event-driven, bursty, short-lived workloads (an HTTP request handler, an image-resize trigger); it fits poorly for long-running or stateful work.

Service mesh and LXC: the plumbing layers

A service mesh manages service-to-service communication in a microservices deployment — load balancing, service discovery, mTLS, retries, observability — typically via a "sidecar" proxy deployed alongside each service [8]. The service mesh takes communication concerns out of the application code. It's the answer to "we have 50 microservices; how do we secure, observe, and route between them without every service reinventing it." Istio and Linkerd are the common implementations. Service mesh is genuinely useful at microservices scale and overkill below it.

LXC (Linux Containers) is the containment technology — running multiple isolated Linux systems on a single kernel, the precursor and foundation that Docker built on [9]. LXC matters as the plumbing layer; for application developers today, Docker and Kubernetes are the abstractions above it that matter.

Twelve-Factor: the deployment discipline

The Twelve-Factor App is a methodology — twelve principles for building cloud-friendly applications that scale and deploy cleanly [10]. The principles most worth remembering:

  • Config in the environment, not the code. Secrets, database URLs, feature flags come from environment variables, not hardcoded.
  • Stateless processes. Any state lives in a database or cache, not in the process memory. Any process is replaceable.
  • Disposable. Processes start fast and shut down gracefully. Essential for elastic scaling and deploys.
  • Logs are event streams. Write to stdout; the platform aggregates.

Twelve-factor is the discipline that makes both microservices and serverless workable. Stateless, configurable, disposable processes can be scaled, replaced, and deployed independently — exactly what those architectures require. Even in a monolith, following twelve-factor makes operations dramatically easier.

How I use this

Two principles capture the practical takeaway. Start monolithic, split when a boundary hurts. The portfolio is a monolith — one Next.js app — and that's the right choice for its size. Microservices would add complexity with zero benefit. The extraction happens when a specific boundary (a service with different scaling, different release cadence, different team) justifies the cost. Use messaging when asynchrony or decoupling is the point. A request/response that must be synchronous doesn't need a broker. But "send a welcome email when a user signs up," "process this upload in the background," "notify three downstream systems when an order completes" — these are messaging problems, and a broker (or a serverless queue) makes them clean.

The framing — messaging decouples across time, architecture patterns position on the coupling spectrum, twelve-factor is the discipline that makes either workable — is what keeps me from reaching for the wrong shape. Most systems should be monoliths with messaging at specific seams, not microservice meshes from day one. The complexity you don't add is complexity you don't have to operate.

References

[1] IBM, "What are Message Brokers?," 2024. [Online]. Available: https://www.ibm.com/topics/message-brokers

[2] "RabbitMQ Tutorials." [Online]. Available: https://www.rabbitmq.com/getstarted.html

[3] Apache Software Foundation, "Apache Kafka." [Online]. Available: https://kafka.apache.org/quickstart

[4] "Pattern: Monolithic Architecture," microservices.io. [Online]. Available: https://microservices.io/patterns/monolithic.html

[5] "Pattern: Microservice Architecture," microservices.io. [Online]. Available: https://microservices.io/patterns/microservices.html

[6] AWS, "What is SOA?." [Online]. Available: https://aws.amazon.com/what-is/service-oriented-architecture/

[7] IBM, "Serverless." [Online]. Available: https://www.ibm.com/cloud/learn/serverless

[8] Red Hat, "What is a Service Mesh?." [Online]. Available: https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh

[9] Linux Containers, "What is LXC?." [Online]. Available: https://linuxcontainers.org/lxc/introduction/

[10] "The Twelve-Factor App." [Online]. Available: https://12factor.net/

Knowledge check · Question 1 of 5

What does a message broker decouple that direct service-to-service calls cannot?

Comments

Leave a Comment

You must be signed in to comment

0 Comments

No comments yet. Be the first to comment!