Trying to understand how does the AWS scaling work

Viewed 104

There is one thing of scaling that I yet do not understand. Assume a simple scenario ELB -> EC2 front-end -> EC2 back-end

enter image description here

When there is high traffic new front-end instances are created, but, how is the connection to the back-end established?

How does the back-end application keep track of which EC2 it is receiving from, so that it can respond to the right end-user?

Moreover, what happen if a connection was established from one of the automatically created instances, and then the traffic is low again and the instance is removed.. the connection to the end-user is lost?

FWIW, the connection between the servers is through WebSocket.

1 Answers
Related