Comprehensive Guide to Backend Architecture: Microservices, Service Mesh, Observability, and Messaging
This article provides an extensive overview of backend architectural concepts, covering microservices fundamentals, gateway design, service registration, configuration management, observability pillars, tracing standards, logging practices, metric collection, service mesh implementations, and a detailed comparison of modern message queue technologies.
Overview
The "Architect's Map" outlines a three‑part series focusing on backend architecture, emphasizing technology stacks, design principles, and scenario‑based decisions to guide optimal system design within constraints such as team experience, cost, resources, schedule, and business stage.
Microservices
Microservices are a modular architectural style that decomposes applications into small, independently deployable services communicating via language‑agnostic APIs. The article discusses theoretical foundations (Conway’s Law), domain‑driven design steps, and the importance of aligning service boundaries with business domains.
Gateway
Access gateway provides traffic entry, security, and global policies.
Business gateway (or BFF) handles routing, authentication, rate limiting, circuit breaking, service aggregation, and plugin extensions, with examples such as Kong, APISIX, Spring Cloud Gateway, and gRPC‑Gateway.
Service Registration & Discovery
Server‑side mode uses load balancers and DNS.
Client‑side mode relies on registration centers (etcd, ZooKeeper, Consul) for health checks and direct client load balancing.
Configuration Center
Beyond key‑value storage for registration, configuration centers (Nacos, Apollo) provide UI, permission management, and integration with Kubernetes ConfigMap/Secret for zero‑dependency deployments.
Observability
Observability consists of tracing, logging, and metrics. Tracing tools (Jaeger, Zipkin, SkyWalking) follow the OpenTracing standard, while OpenTelemetry unifies tracing, logging, and metrics collection.
Tracing Example
[Span A] ←←←(the root span)
|
+------+------+
| |
[Span B] [Span C] ←←←(Span C 是 Span A 的孩子节点, ChildOf)
| |
[Span D] +---+-------+
| |
[Span E] [Span F] >>> [Span G] >>> [Span H]
↑
↑
↑
↑
(Span G在Span F后被调用,FollowsFrom)Logging
Business logs follow RFC 5424 levels (Emergency to Debug). Centralized collection can use Filebeat, Fluentd, or Logstash, with storage in Elasticsearch and visualization via Kibana.
Metrics
Metrics are captured with Prometheus (counters, gauges, histograms, summaries) or Zabbix for traditional environments, enabling resource and business monitoring.
Service Mesh
Service mesh abstracts inter‑service communication, providing discovery, traffic control, security, and observability. Popular implementations include Istio (Envoy sidecar) and Linkerd, with considerations for high availability and sidecar deployment strategies.
Message Queues
The article compares Redis, RabbitMQ, Kafka, RocketMQ, and Pulsar across HA, throughput, feature richness, duplicate consumption, and ordering guarantees, highlighting each system’s trade‑offs and suitable use cases.
Conclusion
Choosing the right backend components requires balancing performance, reliability, and operational complexity, with a focus on modular design, observability, and appropriate messaging solutions.
IT Architects Alliance
Discussion and exchange on system, internet, large‑scale distributed, high‑availability, and high‑performance architectures, as well as big data, machine learning, AI, and architecture adjustments with internet technologies. Includes real‑world large‑scale architecture case studies. Open to architects who have ideas and enjoy sharing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.