How do I set up a scalable architecture?

April 16, 2016 585 views
Node.js Load Balancing CentOS


I'd like to have tips about a big wep app upcoming deployment in the cloud. I'm trying to move this app from my on-premise servers to the Digital Ocean cloud.

My app is written in Node.js.
Occasionally like 2days/year I need to scale to deal with traffic increase.

My app uses clustering techniques to spawn more workers and take advantage of the multi-core architecture.

Now, my idea is to have a little server serving 365days per year this app, and spend as less as possible. And occasionally be able to automatically scale up (horizontally) to serve over 200 request per second and of course I'll pay for that single day intensive usage. My load balancer is written in node.js with the node-http-proxy module.
How do I monitor the Droplet CPU/Memory usage? How do I launch a new Droplet with my software already installed (clone?) ?

I Hope I was as clear as possible.

Let me know,
any tip is appreciated.

1 Answer

You can use a VPS service with larger resources "in a pocket" - smth like elastic VPS, and get burst CPU resources when your server requires this. You would not be charged a lot for this extra as it will be mostly not utilised. You can check sample plans here and select one that will most likely cover your 2-days-a-year burst:
If you wand to build a multilayer infrastructure for your website - you will need a loadbalancer, which can act a reverse-proxy that will measure request speed from your backends and split the load among two or more backend servers. This will give you another benefit of a fault-tolerance in case of one of backends downtime. You may check out this article to see case studies etc

Have another answer? Share your knowledge.