Category Archives: architecture

Load balancing in node server

I have created a node server using express. I using this architecture as follows: -> I am serving node port as proxy on domain using apache. -> I am using pm2 for handling node process. I have created two cluster and ran individually on different cores. (http://pm2.keymetrics.io/docs/usage/cluster-mode/)

My question is

  1. Am i doing this correct way as production standard?
  2. Do i need load balancing on apache level? because clusters will come in picture after apache?

Am i correct?

AWS ELB + apache httpd + tomcat

We are currently using the "standard" architecture created by AWS OpsWorks. We have set up AWS ELB in front of multiple machines, which sends the requests to one machine using round-robin algorithm ( we have stateless application without any cookies ). Apache httpd + Apache tomcat is installed on the machine ( everything set up and configured by AWS OpsWorks ). So Apache httpd handles the connection and then sends it to Tomcat via AJP connection.

I would like to get rid of the apache httpd. Few reasons for that:

  • Easier architecture, easier configuration
  • Maybe slight gain in performance
  • Less monitoring ( need to monitor only Tomcat, but not Apache httpd )

I have checked the following thread: Why use Apache Web Server in front of Glassfish or Tomcat?

and haven't find any reasons why I shouldn't remove apache httpd from my architecture.

However, I know that some applications have nginx in front of the Tomcat for the following reasons:

  • Slow clients handling ( ie worker thread of tomcat is freed, but async nginx thread sends clients )
  • DDoS SYN ( using SYN cookies ) protection

Questions to consider: Does apache httpd protects from these DDoS techniques? Does AWS ELB protects from these DDoS techniques? Should I remove apache httpd ( given that I don't need anything from the list )? Should I replace it with nginx? Should I replace it with nginx ( taking into account that we have a DDoS protection with Incapsula )?

Any other advice/comment would be highly appreciated! Thank you in advance!

AWS ELB + apache httpd + tomcat

We are currently using the "standard" architecture created by AWS OpsWorks. We have set up AWS ELB in front of multiple machines, which sends the requests to one machine using round-robin algorithm ( we have stateless application without any cookies ). Apache httpd + Apache tomcat is installed on the machine ( everything set up and configured by AWS OpsWorks ). So Apache httpd handles the connection and then sends it to Tomcat via AJP connection.

I would like to get rid of the apache httpd. Few reasons for that:

  • Easier architecture, easier configuration
  • Maybe slight gain in performance
  • Less monitoring ( need to monitor only Tomcat, but not Apache httpd )

I have checked the following thread: Why use Apache Web Server in front of Glassfish or Tomcat?

and haven't find any reasons why I shouldn't remove apache httpd from my architecture.

However, I know that some applications have nginx in front of the Tomcat for the following reasons:

  • Slow clients handling ( ie worker thread of tomcat is freed, but async nginx thread sends clients )
  • DDoS SYN ( using SYN cookies ) protection

Questions to consider: Does apache httpd protects from these DDoS techniques? Does AWS ELB protects from these DDoS techniques? Should I remove apache httpd ( given that I don't need anything from the list )? Should I replace it with nginx? Should I replace it with nginx ( taking into account that we have a DDoS protection with Incapsula )?

Any other advice/comment would be highly appreciated! Thank you in advance!

AWS ELB + apache httpd + tomcat

We are currently using the "standard" architecture created by AWS OpsWorks. We have set up AWS ELB in front of multiple machines, which sends the requests to one machine using round-robin algorithm ( we have stateless application without any cookies ). Apache httpd + Apache tomcat is installed on the machine ( everything set up and configured by AWS OpsWorks ). So Apache httpd handles the connection and then sends it to Tomcat via AJP connection.

I would like to get rid of the apache httpd. Few reasons for that:

  • Easier architecture, easier configuration
  • Maybe slight gain in performance
  • Less monitoring ( need to monitor only Tomcat, but not Apache httpd )

I have checked the following thread: Why use Apache Web Server in front of Glassfish or Tomcat?

and haven't find any reasons why I shouldn't remove apache httpd from my architecture.

However, I know that some applications have nginx in front of the Tomcat for the following reasons:

  • Slow clients handling ( ie worker thread of tomcat is freed, but async nginx thread sends clients )
  • DDoS SYN ( using SYN cookies ) protection

Questions to consider: Does apache httpd protects from these DDoS techniques? Does AWS ELB protects from these DDoS techniques? Should I remove apache httpd ( given that I don't need anything from the list )? Should I replace it with nginx? Should I replace it with nginx ( taking into account that we have a DDoS protection with Incapsula )?

Any other advice/comment would be highly appreciated! Thank you in advance!

Complex system and Vagrant

On production, we have a web infrastructure as it follows:

  1. Load Balancer (haproxy)
  2. API Server (PHP + apache)
  3. Frontend Server (Javascript + nginx)
  4. MySql Server
  5. Redis Server

I'd love to start using Vagrant to make production environments exactly the same as the development ones, plus making it easy for a new developer to jumpstart doing his job.

The big question is: how should I build the box? Should I put everything in one box or should I build more boxes? And how many?

Undertsanding Tomcat Architecture

I'm using tomcat in our web application project, But want to know the actual design of tomcat i.e how it works internally. From the beginning as soon as it accepts a Request till it serves the Response.What are the various components in it and how they are interacting to get the job done. Also I'm referring to tomcat official guide, but its giving the idea how to configure tomcat etc.

Lets say If i want to built my own Web Server, what are the things i have to put in my mind.
A diagram explaining the architecture is more than a welcome.

architecture for heavy use of statistics java/spring/mysql in a web site [on hold]

My company want to add in their website some statistics charts for help our customers to made their investments. actually i'm using apache commons math but i know that use java for an heavy use of the statistics it's inappropriate.So i want to ask what is a good architecture for a site(spring/mysql for the back-end).i read about "R" but i don't know if is useful to my purpose.mainly we want to retrieve the data from the mysql database do some elaboration and retrieve the data in a json format.