System Design Flashcards
What is latency
Time taken to complete an operation
What is throughput, and give an example
The maximum capacity of a machine.
Ex. 512 Mbps internet connection is a measure of throughput (512 Mb/s)
What are principles of designing highly available systems
Design redundancy into the system.
Map out the components in the system and identify the parts that are likely to be a single point of failure.
What are protocols
System of rules and regulations that govern something. They serve as the official way something must be done
Difference between TCP and HTTP
TCP is in charge of setting up a reliable connection between two machines.
HTTP uses this connection to transfer data between the server and the client
Define data denormalization and how it contributes to performance
Refers to a DB optimization technique that decreases use of expensive JOIN queries.
This should be done for frequently derived values, when you don’t alter data sources frequently.
Optimal technique when caching objects
Storing an assembled class from the dataset in the DB that involves multiple queries. Can just evict object when any other parts of the data change
What are two ways to achieve asynch
Doing the same time consuming work in advance. Pre computation can improve performance.
Send complicated jobs to a queue process, allows users to continue, and then notify when process has finished
What are some things to keep in mind when trying to scale systems?
Probe further questions about the user. Where do they live? What are their needs? What size data will they be exchanging? What network limitations are there? When is peak usage?
What are web sockets
Unlike HTTP connections, sockets establish bi-directional channels of communication between client and server.
New requests are not required to reestablish a new connection. Server is pushing data.
The better option when you need “real-time” data
What is the basic unit of the WebSocket protocol
Frames: data is broken up into a series of chunks and each chunk is wrapped in some metadata to make a frame. It is a binary protocol, so bit manipulation is required to decode messages.
What is HTTP long polling
Server elects to hold a client’s connection open for as long as possible and deliver a response only after data becomes available. Server holds connection until information becomes available. Client is pulling data.
What does leader election refer to
When multiple servers in a cluster are created to add redundancy, you can designate one to be a leader to serve as the organizer of some task distributed among many computers.
And if leader fails, others from within the cluster would take its place
What is a consensus algorithm
Used to give all servers in a cluster an “agreed on” value that they can rely on in the logic
What is polling
Client pings server for new data in regular intervals. Only to be used if small gaps in data updates is suitable