Scaling Express horizontally
Our current application architecture has coupled together an API; a consuming web client and a worker which populates a Redis cache. This approach works for many applications and will allow it to scale horizontally with the help of a load balancer.
But let's say for example, we would like our API to support clients other than web, say for example, we introduced a mobile client that used our API; ideally we would like to scale our API in isolation and remove anything related to the web client.
Scaling our worker horizontally would simply mean replicating the same work over and over again, which would be pointless. Later, we will discuss how to scale the worker.
In the rest of this chapter we will outline how to split apart our application in order to scale horizontally. We will use the source code from the chapter-6
version of the vision application. We will, of course, document anything of interest which is required to achieve our goal. We will create four new projects...