Understanding scalability through hypothetical example

The above is a snapshot from the digital ocean.

If there is an operational app online, which has initially no profit model and is absolutely free.
On every visitors request if the app is serving say 2KB of data from the database, and on a given day there are 10000000= 10 Million such requests that means on the same day

10000000 = 10000 MB of data = 10GB of data will be delivered, (I hope that my understanding of scalability is not completely skewed)

In processing such data, which in a hypothetical condition is spread over 24 hours then what minimum RAM will be required?

The amount of data served from the database is only one component that uses RAM. There is also the database itself that needs RAM to operate, the web server needs RAM, PHP needs RAM, etc.

All in all I would say that with only 2KB per visitor you’re pretty much bound by how many users your web server and PHP pools are able to handle at any given point.

If we assume those 10 million requests will be spread equally over the day (hint: they won’t be) then you’re looking at 10,000,000 / 24 / 60 / 60 = 115 req/sec. That is quite a lot, especially when you take into account that since the visitors won’t be distributed equally over the day then the peak will be much higher than that.

Given what you’ve said so far I would personally be tempted to get a fleet of smaller VMs and distribute the load over these VMs, rather than getting one big fat VM, since the biggest concern will be getting the concurrency you’re after, which is a lot easier to do with multiple VMs than trying to tweak one VM to do it.

Where is the number 10,000,000 coming from? How realistic is?

At that scale I would seriously consider doing some proper load testing to see what your specific needs for your specific app are, rather than doing some back of the napkin calculations and then hoping they’ll hold (hint: they won’t).

1 Like

Hi there, I am simplifying. I live in an apartment, which has around 900 flats. The apartment uses an paid app by the name sconenct, the app company claims to have 600 apartments in India as their paid customers. if we assume that every apartment has 1000 flats, which may not be the case as some apartments have 15000 flats also, but for understanding lets assume and thats make the conclusion

600 X 1000 = 0.6 million flat owners. The app is used for creating support tickets, circulars(I received 3-4 circulars daily where the app company is using SendGrid as their email delivery partner)

If 0.6 Million users receives 3 circulars daily that means 1.8 millions circulars are send daily. +
Support tickets are created, realistically not every flat owners will create support ticket, but for scalability gauging if they do then 0.6 million tickets are created daily, assigned to electrician, plumbers etc.

That means 2.4 million activity daily by the app. This uses hardware and thus scalability is also in consideration. This type of app requires what minimum hardware(Storage, RAM etc) for smooth functioning?

That is 1 issue per flat owner per day. That seems highly unlikely.

That is really hard to say, because it depends on way more factors than just those raw numbers. Best way is to first do an over-estimation, deploy that, see how much you were over-estimating, then bring it down to what was actually needed. There is no way anyone can get this calculation correctly.

2 Likes

Nor will it be accurate.
Per day calculations are all well and good, but as any power company will tell you, humans arent a statistically average population over a day.

Let’s say your system has “2.4 million activity daily”. Per hour, that would mean 100,000 points of activity, right?

How many of those people are active at 3 AM?

Averages don’t work. Either you aim for the peak, or you agree on some point at which you’re going to start receiving service issues because you’re above peak usage (Say, around 5 PM when everyone gets home from work, etc.)

3 Likes

Hi there, The purpose of the post was to gauge and get ready how much server requirement there could be if anyone your business scale in future, which again is not my need of the moment, but that should be in a mental preposition somewhere.

Yes, that thought came to my mind. The biggest period of activity will be between early morning till the maximum of 11 PM.