Please enable JavaScript.
Coggle requires JavaScript to display documents.
Scaling (Principles to make Scalable (Store config file in the environment…
Scaling
-
Use AWS or Digital Ocean
-
2-9
-
NodeJS is event-driven and non-blocking and handles calls asynchronously and can take multiple requests
-
-
10-99
Requests may take longer here and things become slower - especially if NodeJS has to do a long calculation
- Need more hardware - Vertical Scaling
- Get more resources such as faster CPU, RAM and HDD
- More Cores now to fork and cluster NodeJS process and now load balance with Nginx to achieve little downtime
-
Nginx will cache static files and any request that needs the app will get forwarded by Nginx (reverse proxy)
100-999
Database taking longer to respond - Instead of having database on one server which has e.g 4 CPUs - instead can have 4 Servers with one CPU running 4 copies of database answering different calls
-
-
Cheaper than to continue Vertical Scaling and better than having all eggs in one basket so if server is down App crashes
-
Look at the files /etc/security/limits.d
and /etc/sysctl.conf
as these files limit maximum number of requests via the net.core.somaxconn
which default to 128 and you can to 1024 to meet users
1000+
Add a load balancer (ELB with Route 53 in AWS)
ELB will give performance analysis and can manage 1000 instances
-
-
-
- Grow horizontally rather than vertically
- Separate Web app from database and scale each one with more instances
100,000 +
-
-
Start Micro-services and scale them
- Use a load balancer to redirect the traffic to the new small service instead of the main app
-
-
-
-