Book Image

Advanced Express Web Application Development

By : Andrew Keig
Book Image

Advanced Express Web Application Development

By: Andrew Keig

Overview of this book

Building an Express application that is reliable, robust, maintainable, testable, and can scale beyond a single server requires a bit of extra thought and effort. Express applications that need to survive in a production environment will need to reach out to the Node ecosystem and beyond, for support.You will start by laying the foundations of your software development journey, as you drive-out features under test. You will move on quickly to expand on your existing knowledge, learning how to create a web API and a consuming client. You will then introduce a real-time element in your application.Following on from this, you will begin a process of incrementally improving your application as you tackle security, introduce SSL support, and how to handle security vulnerabilities. Next, the book will take you through the process of scaling and then decoupling your application. Finally, you will take a look at various ways you can improve your application's performance and reliability.
Table of Contents (14 chapters)
Advanced Express Web Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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...