From Monolithic to Scalable Architecture: Reverse Proxy, Service Separation, Load Balancing, and Continuous Deployment

This article shares practical experience on evolving a single‑server Java monolith into a scalable architecture by introducing Nginx reverse proxy, separating services and static resources, adopting load‑balancing strategies, implementing distributed sessions, enabling read/write separation, and applying CI/CD tools such as Docker, Jenkins, Git, and Maven.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
From Monolithic to Scalable Architecture: Reverse Proxy, Service Separation, Load Balancing, and Continuous Deployment

Preface

The author, a senior Java enthusiast, reflects on years of development experience and the gradual accumulation of architectural insights, acknowledging that the journey from a monolithic system to a robust distributed architecture is incremental.

Initial Setup

Initially, the application and its database were deployed together on a single Tomcat server, which quickly became insufficient as user traffic grew.

Service Separation

To handle increasing load, the author recommends deploying the application and database on separate machines, optionally isolating the file server as well.

Reverse Proxy

Placing Nginx (or Apache) in front of Tomcat provides request forwarding, static content handling, load‑balancing, high availability, caching, SSL/HTTP2 support, and security features such as rate limiting and firewalling.

Static/Dynamic Separation

Static assets (HTML, CSS, JS) are served by Nginx, while dynamic requests are forwarded to Tomcat, improving performance and enabling HTTP/2.

Service Splitting

With micro‑service frameworks like Dubbo or Spring Cloud, the monolith can be broken into independent services, each managed by its own lifecycle.

Continuous Integration & Deployment

Tools such as Docker, Jenkins, Git, and Maven facilitate automated builds, testing, and deployment across the newly split services.

Service Cluster

Linux clusters are categorized into high‑availability, load‑balancing, and scientific‑computing clusters; the most common in production is the load‑balancing cluster.

Load‑Balancing Strategies

Various algorithms (round‑robin, weighted round‑robin, source‑hash, least‑connections, weighted‑least‑connections, etc.) are discussed, each with its own trade‑offs.

Distributed Session Management

Approaches include database‑backed sessions, container‑level replication, cache‑based sharing (Redis, Memcached), and cookie‑based sharing, with detailed pros and cons for each method.

Read/Write Separation

MySQL master‑slave setups, middleware such as MyCat or Alibaba DRDS, and cloud services like RDS/Redis are suggested for separating reads from writes.

Full‑Text Search

When search requirements arise, integrating Solr or Elasticsearch is recommended instead of overloading relational databases.

Cache Optimization

Introducing caches (Ehcache, OsCache, Memcached, Redis) reduces database pressure; Redis is highlighted for its widespread adoption in distributed environments.

Message Queues

Asynchronous notifications, traffic shaping, log processing (ELK stack with Kafka/Redis), and point‑to‑point or publish‑subscribe communication are covered.

Log Services

ELK combined with a message queue provides an affordable logging solution for small‑to‑medium teams.

Security Optimization

Recommendations include using VPNs, firewalls, internal network access with authentication, limiting exposed ports, and enabling HTTPS with HTTP/2.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backendci/cdload balancingNginx
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.