From Monolithic to Microservices: A Comprehensive Guide to Migration, Monitoring, and Management
This article walks through the evolution of an online supermarket from a simple monolithic website to a fully decomposed micro‑service architecture, highlighting the motivations, design decisions, common pitfalls, and the essential components such as service discovery, monitoring, tracing, circuit breaking, testing, and service mesh.
The piece begins by describing the original requirements of a small online supermarket built as a single website and an admin backend, explaining why a monolithic approach quickly became problematic as the business grew.
It then outlines the pain points of the monolith—code duplication, tangled database access, unclear service boundaries, performance bottlenecks, and deployment difficulties—illustrating them with concrete examples.
To address these issues, the author introduces a step‑by‑step micro‑service transformation: extracting common capabilities into independent services (User, Product, Promotion, Order, Analytics), gradually splitting the shared database, adding a message queue, and eventually achieving full isolation with heterogeneous storage solutions.
Key operational concerns are covered next. Monitoring is built with component‑specific metrics, Prometheus for collection, and Grafana for visualization. Distributed tracing is explained using traceId, spanId, parentId, and timestamps, with an example from Istio and Zipkin integration.
Log analysis is tackled by adopting the ELK stack (Elasticsearch, Logstash, Kibana) and deploying agents to ship logs, enabling fast searching of massive log files.
The article discusses gateway responsibilities for permission checks and routing, service registration and discovery (e.g., Consul, Eureka, Etcd, or a custom Redis‑based solution), and dynamic scaling of service instances.
Resilience patterns such as circuit breaking, service degradation, and rate limiting are described, including visual references from "Microservice Design".
Testing strategies are presented in three layers—end‑to‑end, service‑level, and unit tests—highlighting the need for mock servers and the trade‑offs between effort and confidence.
Finally, the author compares a custom microservice framework with a Service Mesh approach, explaining sidecar proxies, data plane vs. control plane, and the pros and cons of each.
The article concludes that microservices are not the final destination; future directions include serverless/FaaS and a possible return to monoliths, while encouraging readers to continue learning and share knowledge.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
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.
