Urgent.News

What's breaking now, across thousands of outlets.

Tech

Day 21 - Scaling - Horizontal vs Vertical Scaling - কোনটা কখন করবেন?

আপনার build করা application-টি এতই viral হয়ে গেছে যে, এর user base lakh cross করে গেছে। এবং concurrent user লাখের কাছাকাছি। এই অবস্থায় আপনার যে server আছে, তা user-দের load নিতে পারছে না। Peak time-এ user-দের wait করতে হচ্ছে। Data inconsistency-র একটা issue দেখা দিচ্ছে। মাঝে মাঝে server crash করছে। মাঝে মাঝে database-এ data insert হচ্ছে না। অবস্থা একদম বেগতিক হয়ে গেছে। এখন এর সমাধান হচ্ছে…

Day 21 - Scaling - Horizontal vs Vertical Scaling - কোনটা কখন করবেন?

A once-viral application now suffers as user count crosses a million, causing server overload and data inconsistency issues. Resource scaling has become necessary.

Vertical scaling involves increasing a single machine's CPU, memory, and storage. However, this approach has reached its limits as the largest server is also finite, and single points of failure can cause downtime.

Horizontal scaling, on the other hand, introduces multiple machines to distribute user traffic. Theoretically, this allows for unlimited scaling and higher availability. A load balancer directs traffic to these machines, ensuring optimal performance. But stateful applications, particularly those relying on session-based authentication, can cause issues. A separate Redis database with TTL expiration can mitigate this problem.

Database scaling is another critical consideration. With multiple servers handling user traffic, database load remains the same. Scaling databases can be challenging, with options like vertical scaling, read replicas, sharding, or caching. The best strategy depends on the specific situation and budget constraints. Overall, a thoughtful, stateless architecture and appropriate scaling methods will ensure smooth operation and high availability.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Microsoft Is Investing US$1.7bn in Indonesia: For What Purpose?

Tech giant Microsoft is investing US$1.7 billion, or approximately Rp30.4 trillion, to develop Indonesia's digital ecosystem.

  • Microsoft invests US$1.7bn in Indonesia for digital infrastructure and AI.
  • Collaboration aims to boost digital skills and workforce in Indonesia.
  • Partnership includes AI, cloud, cybersecurity, and talent development.

I almost didn't launch this project.

For months, I kept thinking, "There are already thousands of websites doing this. Why would anyone use mine?" That thought delayed me more than coding ever did.

More from Saturday 26 September →