System design interview an insider guide Flashcards
What DNS?
Is the 3rd party web ip dictioniary. Returns IP in return for domain name during browser call.
What Problem DNS resolves?
Hard to use IP numbers by humans
What is IP?
It’s a internet number of device connected to internet. public ip are unique in the internet, private not. 192.168.0.3 - gdzie pierwsze trzy człony to część sieciowa a ostatnia to numer urządzenia w sieci.
What is http?
It’s internet protocol, so it’s shape of requests and response which you handles
How looks http request?
http_method path http_version
headers
blank line
optional body
*path is url without things taken from cotext, like ‘http://’, like domain(because usually its as ‘host’ header in request
How looks http response?
http_version status_code code_description
headers
blank line
returned body
What is option http method type?
Usually used before main rquest with GET/POST.. to check what http method can be used on resource. Knowledge is taken from response’s header Accept
is dns used during each call by browser?
nope, there is DNS cache in OPERATING SYSTEM
What problem NoSQL resolves?
Performance of queries is low and shape of data is unstructured.
What are examples of noSQL?
MongoDB, redis, elasticsearch, apache cassandra
What scaling is?
Scaling is the process of adding more power to your infrastracture.
What problem vertical scaling resolves?
Problems with lack of memory/CPU for application
How vertical scaling resolves problem?
Increasing CPU/memory on specific machine.
What problem horizontal scaling resolves?
- It’s impossible to add unlimited CPU/memory to machine
- what will happen when machine will fail
How horizontal scaling resolves problem?
Adding servers
What is failover?
That’s process of switching wrong dead server to live server.
What is redundancy of system?
It’s capacity of system to overcome broken elments (like keeping server turned on as a backup) or having kubernetes for quickly setup new server.
What is load balancer?
It’s unit in system which receives requests to server and distrubutes them through machines.
What problem load balancer resolves?
- cloggeed machine with handling requests
- failed machines
How servers under load balancere communicate each other?
They’re all on the same network.
What is data replication?
It’s master db server with slaves db servers.
What problem data replication it resolve?
Failed db server
What db operations support master server in db replication process?
Only write, unless there is no sleeves, so it handles writes and reads.
What db operations supports sleeve server in db replication process?
Only read.
Why there is more sleeves than masters?
In standard system, there are more read operations than write.
What are pros of data replication system?
- better performance (more db servers can handle more queries)
- better reliability (any failed db server can be replaced by another
What will happen when master db server is down?
One of sleeves became new master server
What is caching?
It’s memory db which serves responses quicker than sql server