What really is scaling?

前端 未结 6 736
南笙
南笙 2021-01-30 18:35

I\'ve heard that people say that they\'ve made a scalable web application..

  1. What really is scaling?

  2. What can be done by developers to make their

相关标签:
6条回答
  • 2021-01-30 19:16

    Books have been written on this topic. An excellent one which targets internet applications but describes principles and practices that can be applied in any development effort is Scalable Internet Architectures

    0 讨论(0)
  • 2021-01-30 19:17

    Scalable means that your app is prepared for (and capable of handling) future growth. It can handle higher traffic, more activity, etc. Making your site more scalable can entail various things. You may work on storing more in cache, rather than querying the database(s) unnecessarily. It may entail writing better queries, to keep connections to a minimum, and resources freed up.

    Resources:

    1. Seattle Conference on Scalability (Video)
    2. Improving .NET Application Performance and Scalability (Video)
    3. Writing Scalable Applications with PHP
    4. Scalability, on Wikipedia
    0 讨论(0)
  • 2021-01-30 19:19

    What really is scaling?

    Scaling is the increasing in capacity and/or usage of your application.

    What do developers do to make their application scalable?

    Either allow their applications to scale vertically or horizontally.

    Horizontal scaling is about doing things in parallel.

    Vertical scaling is about doing things faster. This typically means more powerful hardware.

    Often when people talk about horizontal scalability the ideal is to have (near-)linear scalability. This means that if one $5k production box can handle 2,000 concurrent users then adding 4 more should handle 10,000 concurrent users. The closer it is to that figure the better.

    The ideal for highly scalable apps is to have near-limitless near-linear horizontal scalability such that you can just plug in another box and your capacity increases by an expected amount with little or no diminishing returns.

    Ideally redundancy is part of the equation too but that's typically a separate issue.

    The poster child for this kind of scalability is, of course, Google.

    What are the factors that are looked after by developers during scaling?

    • How much scale should be planned for? There's no point spending time and money on a problem you'll never have;
    • Is it possible and/or economical to scale vertically? This is the preferred option as it is typically much, much cheaper (in the short term);
    • Is it worth the (often significant) cost to enable your application to scale horizontally? Distributed/multithreaded apps are significantly more difficult and expensive to write.

    Any tips and tricks about scaling web applications...

    Yes:

    1. Don't worry about problems you'll never have;
    2. Don't worry much about problems you're unlikely to have. Chances are things will have changed long before you have them;
    3. Don't be afraid to throw away code and start again. Having automated tests makes this far easier; and
    4. Think in terms of developer time being expensive.

    (4) is a key point. You might have a poorly written app that will require $20,000 of hardware to essentially fix. Nowadays $20,000 buys a lot of power (64+GB of RAM, 4 quad core CPUs, etc), probably more than 99% of people will ever need. Is it cheaper just to do that or spend 6 months rewriting and debugging a new app to make it faster?

    It's easily the first option.

    So I'll add another item to my list: be pragmatic.

    0 讨论(0)
  • 2021-01-30 19:29

    What really is scaling?


    Scaling means accommodating increases in usage and data volume, and ideally the implementation should be maintainable.

    What developers do to make their application scalable?


    Use a database, but cache as much as possible while accommodating user experience (possibly in the session).

    Any tips and tricks about scaling web applications...


    There are lots, but it depends on the implementation. What programming language(s), what database, etc. The question needs to be refined.

    0 讨论(0)
  • 2021-01-30 19:30

    May I suggest a "User-Centric" definition;

    Scalable applications provide a consistent level of experience to each user irrespective of the number of users.

    For web applications this means 24/7 anywhere in the world. However, given the diversity of the available bandwidth around the world and developer's lack of control over its performance and availability, we may re-define it as follows:

    Scalable web applications provide a consistent response time, measured at the server TCP port in use, irrespective of the number of requests.

    To achieve this the developer must avoid or remove all performance bottle-necks. Currently the most challenging issue is the scalability of distributed RDBMS systems.

    0 讨论(0)
  • 2021-01-30 19:31

    My 2c definition of "scalable" is a system whose throughput grows linearly (or at least predictably) with resources. Add a machine and get 2x throughput. Add another machine and get 3x throughput. Or, move from a 2p machine to a 4p machine, and get 2x throughput.

    It rarely works linearly, but a well-designed system can approach linear scalability. Add $1 of HW and get 1 unit worth of additional performance.

    This is important in web apps because the potential user base is ~1b people.


    Contention for resources within the app, when it is subjected to many concurrent requests, is what causes scalability to suffer. The end result of such a system is that no matter how much hardware you use, you cannot get it to deliver more throughput. It "tops out". The HW-cost versus performance curve goes asymptotic.

    For example, if there's a single app-wide in-memory structure that needs to be updated for each web transaction or interaction, that structure will become a bottleneck, and will limit scalability of the app. Adding more CPUs or more memory or (maybe) more machines won't help increase throughput - you will still have requests lining up to lock that structure.

    Often in a transactional app, the bottleneck is the database, or a particular table in the database.

    0 讨论(0)
提交回复
热议问题