Scaling the SPA

I want to conclude with a few ideas about scaling the application. Scaling an application is a bit of a black art, but you do want to be prepared should you build out an application and it gets very popular very fast.

One of the really nice things about using PaaS tools is that they simplify scaling significantly.

Scaling the database

There are a number of options and considerations for scaling the database. You can see this just by looking at the different packages offered by MongoLab. MongoDB itself supports sharding and replication, as it was built for scaling.

Concerns about scaling include the size of the database - how much storage, and performance - usually a factor of RAM or using dedicated clusters.

MongoLab and other providers offer numerous combinations of high-storage and high-performance plans along with several steps, allowing you to incrementally increase your scaling without missing a beat, or installing or configuring a new hardware.

It's important to understand its usage, which only comes over time with an application, and how that's going to affect the storage. If your application is growing and making many hits on your database, you'll want to think about its performance. As your database fills up, you'll want to manage its storage.

Scaling the server

Heroku makes it extremely easy to scale your app to exactly the right size that you need; it's one of the things they built their business around. On Heroku, apps are run inside dynos. Think of a dyno as a lightweight container that runs your app.

Heroku has a number of different dynos running at different performance levels, and you can add and remove them, even at different levels of performance, from the command line or from your dashboard.

Heroku also offers a number of add-ons, for a fee of course, for doing things such as performance monitoring.

Not to be a sales pitch for Heroku, other PaaS providers offer similar options. Amazon Web Services is a popular choice for Node.js. There are others, such as Modulus and Digital Ocean. If you're deploying a real-world commercial app, it pays to shop around to find the right solution for you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.137.38