Sometimes inspiration for the next blog topic comes from life itself, including contacts with people outside the IT industry. Such conversations are usually very valuable, especially for the different perspectives and points of view that "outsiders" bring to certain matters. It is also natural that people who do not know application development from the inside may struggle with some terms. Sometimes they have never learned them and try to describe their idea in a way that can be mistaken for a completely different technology. I have noticed that this often happens with scaling: some clients use the word to describe an interface's ability to be readable on a laptop and a smartphone alike. That is not what it means at all, and in IT the word stands for something entirely different. Today I will try to explain it.

What is responsiveness?

There are really two meanings here, but one of them is used far more often. It is the "flexibility" of the screen mentioned earlier.

To put it more precisely, we know very well that for quite some time now just as many people (or maybe more) have been browsing websites on their smartphones or tablets, which by nature have smaller screens. On laptops, too, the resolution is not so "certain". It may be Full HD (1920 x 1080 pixels), but a fairly large group has zoom turned on in Windows (which lowers the effective resolution), some simply reduce it, and others have additional, very wide monitors... In short, screens can really differ in size and proportions, and users today expect applications to look satisfying on every (or almost every) one of them.

We then say the application is responsive. This is the word we use when we mean that a page should look good on, among other devices, both a laptop and a smartphone. Yes, this means that interface elements scale, in a way, to the available area, but that is not how it is described in the IT world. Sometimes it also means that the page will look completely different on different screens: even the layout of the menu and the behavior of buttons change, some elements are hidden and others stretched to full width, because that looks better. Making a page responsive therefore does not mean only shrinking certain components or rearranging them, but is often a much more complex process and should be planned from the start, so that the right assumptions can be made. In return, however, we get a modern web application that meets today's requirements, often "taking care" of the mobile application question along the way. It is worth mentioning here that a responsive web design (RWD) is not the same as a progressive web app (PWA). The latter is a web application that behaves like a native one, which determines many mechanisms inside the page and the technology used.

I did say, however, that there is a second meaning of responsiveness, which is used a bit less often, although it also refers to the interface. None of us likes to wait long for an application to respond or a web page to refresh. Even worse is when, with a longer response time, the application gives the user no sign at all (graphical or text) that it has not frozen but is still carrying out an operation and you just need to wait a moment. That is why we see all those spinners showing that something is loading in a given place, progress bars, buttons that change style after a click and similar techniques that improve how the interface is perceived by the user. Methods that signal the page is working, together with a suitably short response time, also allow us to call a page "responsive". In this case, though, people more often say the software is simply fast or smooth, leaving the term "responsive" for the matter of screens of different sizes.

What is scaling?

With scaling we definitely move away from the interface and into more hardware-related matters. The term means the ability of an application (or really of entire systems and the infrastructure they run on) to keep working properly under growing load or data size. In fact, we can talk about scaling not only in the context of software. A company can scale too, to properly serve a growing pool of customers (and a suitable application, which we can prepare for you, can help with that). Let us get back to the software side, though.

There are two methods of scaling the server side. The first is vertical scaling, or scaling up (scale up), which means increasing the capabilities of the single machine that runs the software. It can be understood in different ways, from adding memory to installing another processor or simply replacing the computer with a more powerful one. The idea is to increase power so that the application runs faster or can store more files. This type of scaling requires less preparation when building the software and seems "natural", but it comes with several problems. First, increasing the power of a machine usually means stopping it for a while and physically moving the data to another computer. Second, every server has its limit, and sometimes it is no longer possible to raise the specs. Third, the cost of such a better machine can be really high and become unprofitable compared with the second type of scaling.

That second type is horizontal scaling, or scaling out (scale out), which means adding more servers on which the application can run. Here you should know that the software must be properly prepared for such infrastructure, and it is worth assuming this possibility from the start. Among the issues that matter here are statelessness, a service-based architecture, load balancing and database replication. Not everything has to be ready right away, but if there is even a shadow of a chance that the software may generate heavy traffic (even temporarily), it is worth adopting statelessness and web services from the beginning. Then copies of the application or of its parts (frontend/backend) sit on different servers, each with equal "rights" to serve the user and take load off the others. It also means they do not necessarily have to be equal and powerful machines (a load balancer can direct traffic with a certain probability), although the "wider" the infrastructure becomes, the more carefully it has to be thought through, because it must be accompanied by good administration and configuration of the machines. That is why it is a solution for larger businesses that can provide enough support.

It is precisely because of the idea of horizontal scaling that cloud services have become so popular. They allow "natural" scaling by providing the customer not with one server but with a farm of them. What is more, clouds can temporarily increase their capacity on their own when they detect particularly heavy traffic, and in this way adapt to current conditions, because our system is not always equally loaded. Unfortunately, the drawback of clouds is their cost, higher than for other "normal" server services. You may already have read about some of them on the blog.

Taking all this into account, it is worth analyzing what traffic our application may face in the future. If it is a small site for the local market, scaling may not interest us all that much. On the other hand, it is worth considering whether it pays off (where possible) to bet on a stateless architecture from the start, which will give us more room to maneuver later. It is not worth buying many servers for our application from the beginning, though (unless we are talking about the cloud). Scaling is a response to growing demand, so it lets you buy additional resources while your software is already "alive".

Summary

As you can see, concepts that might sound like they mean similar things in theory refer to completely different matters in IT. Responsiveness is closely tied to the interface and to being able to use it comfortably on different screens, while scaling concerns the ability of our infrastructure to keep working normally under heavier load. One has nothing to do with the other, but in an age of growing demand for web services and an ever-developing IT business, it is worth learning these terms and taking them into account when designing new software.

Best regards, and thank you. Jakub Rojek.