mysql

LB_WEB_DB

 After a single server environment, the next step is to decouple the database and add horizontal scalability potential through a load balancer. In this example:

  • NGINX is used as a SSL off-loader for the system (can only be done if you trust the local LAN), and as the fallback backend (display a ‘maintenance page’)
    – HAPROXY as the load balancer. This is an old design: HAPROXY (v1.5+) is now able to do SSL offloading with SNI support. 

    PRO:
    – LB servers can scale horizontally (DNS with frequent dynamic zone republish)
    – APP servers can scale horizontally (through HAPROXY)

CON:
– 3 servers are required for this setup
– Database queries will hit the network, they need to be optimized.

  • Note:
    – the ‘management stack’ has been collapsed, as it is the same for all servers. I will show a more detailed ‘management stack’ in a future post, including log aggregation & storage (logstash), log display (kibana), configuration management system (svn), configuration system (puppet), system orchestration (mCollective), etc.
    – Those are ‘basic’ pattern. the following posts will expand in different directions (MySQL clustering, MongoDB, Elastic Search, SOLR Cloud, etc.)