Product Analysis, Microservice Architecture Design, Real-Time Messaging Evolution, Idempotency, and Service Governance
This article outlines product analysis and positioning, microservice architecture principles, the evolution of real‑time message push technologies, strategies for ensuring request idempotency, and comprehensive service governance practices, providing practical guidelines for building robust backend systems.
Author: Architect Lao Lang Link: https://www.jianshu.com/p/19723ab12289
01 Product Analysis and Positioning
02 Microservice Architecture Design
Business‑centric
High cohesion, low coupling
High autonomy
Elastic design
Logging and monitoring
Automation
03 Real‑Time Message Push Technology Evolution
Access‑layer load balancing based on HTTP layer‑7, evolving from HAProxy to Nginx
HAProxy supports TCP and HTTP, offers eight load‑balancing strategies, URL health checks, heartbeat detection, works at layers 4 and 7, but has poor WebSocket support causing message backlog
Nginx supports HTTP, operates at layer‑7, supports WebSocket, port health checks, and powerful regex matching rules
Nginx traffic splitting:
server 172.16.125.76:8066 weight=10;
server 172.16.125.76:8077 down;
server 172.16.0.18:8066 max_fails=3 fail_timeout=30s;
server 172.16.0.18:8077 backup;HAProxy traffic splitting:
server web01 192.168.137.203:80 check inter 2000 fall 3 weight 1004 Request Interface Idempotency
Fine‑grained validation with zero intrusion at framework and business layers: filters and interceptors are unsuitable; use annotations with AOP
Duplicate request filtering: AOP around advice checks key existence before proceeding and releases the key after; existing key blocks the request
Concurrent requests: multi‑threaded key queries and creation are unsafe; leverage Redis single‑threaded atomic operations and introduce distributed locks
Atomic key release: only the thread that created the key may release it; handle exceptions in finally block; use Redis transactions with WATCH to monitor the key
Extreme cases: business processing time exceeds key TTL; master‑slave or cluster failover where the slave is not upgraded, causing data loss; introduce Redisson Java solution, periodic key renewal, and distributed in‑memory grid storage
05 Service Governance
Challenges introduced by service‑orientation:
Increasing number of services leads to complex configuration management
Service dependency relationships become intricate
Load balancing among services
Service scaling
Service monitoring
Service degradation
Service authentication
Service rollout and rollback
Service documentation
Comprehensive service governance includes registration & discovery, distributed configuration distribution & hot‑loading, service invocation & load balancing, fault tolerance & degradation, rate limiting, gateway & authentication, intra‑/inter‑network isolation, scheduling, health checks, tracing, business‑level availability checks, continuous delivery, and autonomous operation
-- End --
If you have read this, you probably like this public account; feel free to star (pin) the "Architect Guide" to receive updates promptly.
Reply with "Architect" in the backend of this public account to receive 2 TB of learning materials!
Recommended reading:
Backend Architect Technical Encyclopedia (69 points)
How Should an Architect Design an Authorization System?
How Can I Become an Architect?
Architect Builds an Order System from Scratch
Architect's Guide
Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.
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.