Scalable Web Architecture


I would like to have your opinions and advice’s about the architecture that I want to deploy for a Magazine website with big load and Hourly updates.

Programme Choices

1) Load Balancer:

I choose Nginx over HAProxy after reading many Topic about this one the web and I come out with the conclusion that Nginx is better on http servers. In addition, Nginx have Memcache module.

2) Cache server:

I choose Memcache because it’s mature, stable, not resource hungry And do the job Caching the database also there is a module between Nginx and Memcache.

3) AppMaser & AppSlave:

I went for Apache and PHP. Why apache, well it manager’s rewriting better then Nginx with .htaccess and have Dynamic module loading like PageSpeed that work better with apache then Nginx and since Nginx will be in the front anyway handling the user requests Apache will be fine.

4) Cluster

I went with GlusterFS since it s the only one I know and i read many good argument about, it s doing his replica on the second Cluster it have heath check and failover so i am happy with it.

5) Database

I choose MySQL. It was much choice around like MariaDB or Percona. Once I tried MariaDB I just personally did not have good experience with it and about Percona I never used it so just went to MySQL since it’s also a robust solution.

How it Work

  • When a user connect to the website. The Load Balancer take the request and check the cache first if the result is not cached then the Load Balancer send the request to the AppMaster or AppSlave server that connect to the Cluster where files are stored and connect to the database then send the result back to the user and to the cache server to cache it.

  • Well first question that come to simple people’s mind it is why al that extra step’s?

  • The load Balancer Dispatch the load between the two server’s AppMaster and AppSlave and if one of them goes down the Load Balancer won’t send request to it and will Keep working with only 1 server until the second is up.

  • The Cache server will decrease the request sent to the database what will decrease the server’s load so when a user will send a request he will not need to connect to the database server if the result on the Cache Server.

  • The Cluster One will Store all the data sent by the webmaster or the user then replicate it on the second cluster in case the first is down the second will be working for both AppMaster and AppSlave until that one will back online and then all the data will be synchronized back.

  • The MySQL Database is replicated between the Master and Slave, write is only in the Master and Slave is on read only. If the Master database is down the website will keep working but only in read mode until we fix the Master one. The charge are also Balanced between them, AppMaster is connected to MysqlMaster and AppSlave is connected to MysqlSlave

Web Architecture Diagram

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.