Skip to main content

Basics of System Design


This article is first one from the series of articles dedicated to system design interviews. Here i am going to present the base scenario to consider before starting to solve system design problems.

Questions to ask?

1) what is the number of requests a website will recieve in a day/month/second?
2) what is the amount of memory a website will deal in a day/month/second?
3) what is the number of servers that can accomodate these requests?

To answer this , first we need to remember the below numbers:-

  • 1 million = 10 lakh = 1000000 = 10^6
  • 1 billion = 1000 million = 10^9

  • 1 KB = 1024 B = 10^3
  • 1 MB= 10^6 = 1024 KB
  • 1 GB= 10^9 = 1024 MB
  • 1 TB = 10^12 = 1024 GB

  1. Memory we need to see in Bytes
  2. Requests we need to see in numbers

example :-

suppose a website recieves 100M requests every month then:-

requests per day = request per month /24 = 416700 requests
requests per second = requests per day / (24*3600) = 4.8 requests per second

memory:-

if we take 20:80 principal where 20 percent is write and 80 percent is read operation. From above example it will be like 100 M requests for write then 400 M is read request.

For each second we are writing 4.8 requests if we consider data to write is 500kb then total data writing of 2400 kb or 2.4 Mb data per second.

For each second we are also reading around 9.6 MB of data. So bandwidth is approximately 12 Mb second.

Storage:-

if we consider for 5 years and 2.4MB of data is written at every second then :-

2.4 MB per second = 207360 MB per day = 207 GB per day= 4.9 TB per month = 59 TB per year = 295 TB for 5 year.

We will go through in detail about 500 kb data that we are writing in next chapters.

So it will be around 295 TB of data. If we consider one machine :-
with win 32 w/NTFS we can store 2TB data ,so total 147 machine we need to store all this data.
With solaris 9/10 we need only 18 machines /( 18 TB in each machine)

we can divide these machines into cache data and db data based upon requirement.

User storage and cache storage is coming up in next tutorial.

https://tech.nazarmubeenworks.com/2019/08/calculating-size-of-user-and-cache.html



Comments

.

Popular posts from this blog

How to build a project in eclipse with MAVEN build tool?

How to build a project in eclipse with MAVEN build tool? Step 1:- Install maven and set the path in my computer. Once path is set for java and maven you will get a screen With version installed in your system. Step 2:- Write a command mvn archetype:generate to build a project of your choice.This will give you a option to select a project from list. Step 3:- As soon as this operation will complete maven give you choice to choose project.Search for maven-archetype-webapp this will build a web project with basic structure. Step4:- Follow the below procedure to give name , version ,package ,artifact and group id of your choice. Step 5:- You will get screen with build success.Congrats your project is build in directory. Step 6: Go in the directory to check for the folders automatically created by maven. You will get pom file and src folder and the package folder. Step:-7  Move to the directry having pom.xml and run mvn ecl

Delete node at a given position in Linked List

Delete node at a given position in Linked List //delete node by position in linked list public Node deleteKeyAtPosition ( Node head , int position ) { Node temp = head ; Node prevtemp = temp ; int c = 1 ; //if position is head if ( position == 1 ) { head = head . next ; return head ; } //position +1 because we have to go till that point while ( c != position + 1 ) { if ( c == position && position != 1 ) { prevtemp . next = temp . next ; temp . next = null ; temp = prevtemp ; } prevtemp = temp ; temp = temp . next ; c ++; } return head ; }