System Designs Fundamentals Flashcards
What is a client?
A machine or process that requests data or service from a service.
Note that a single machine can be either a client or a server
What is a Server?
A machine or process that provides data or service from for a client, usually by listening to incoming network calls
What is an IP address?
An address given to a machine connected to the public internet. Ipv4 addresses consists of four numbers separated by dots a.b.c.d where all four numbers are between 0-255.
- 0.0.1 - localhost
- 168.x.y - your private network
What is IP?
Internet protocol. This network protocol outlines how almost all machine-to-machine communications should happen in the world. Other protocols like TCP, UDP, and HTTP are built on top of IP
What is TCP?
Network protocol built on top of IP. Allows for ordered, reliable data delivery between machines over the public internet by creating a connection.
TCP is usually implemented at kernel level, which exposes sockets to applications that they can use to stream data through an open connection
What is HTTP?
The hypertext transfer Protocol is a very common network protocol implemented on top of TCP. Clients make HTTP requests and servers respond with a response.
They usually have the following esquema. Host, Port, method (GET,POST..), headers, body
What is latency?
The time that takes for a certain operation to complete in a system. Most often this measure is a time duration, like milliseconds or seconds.
What is throughput?
The numbers of operations that a system can handle properly per time unit. For ex. the throughput of a server can often be measured in requests per second (RPS or QPS)
What is availability?
The odds of a particular service being up and running at any point in time, usually measured in percentage. A server that has 99% availability will be operational 99% of the time (having two nines availability)
What is High availability?
Describe systems that have at least 5 nines or more of availability 99,999%
What is redundancy?
Process of replicating parts of a system in effort to make it more reliable
What is SLA/SLO?
SLA is short of service level agreement, SLA is a collection of guarantees given to a customer by a service provider. SLAs typically make guarantees on a system availability. SLAs are made up of one or more SLO.
SLO is service level objective
What are some types of cache Eviction Policy?
FIFO, LRU (least recently used), LFU (least frequently used)
What is Content Delivery Network?
a CDN is a third-party service that acts like a cache for your servers. Sometimes web apps can be slow for users in a particular region. CDN has servers all around the world meaning that the latency o a CDNs service will be always better than to your servers. Most populars CDN are Cloudflare and Google Cloud CDN
What is forward proxy?
A server that sits between a client and servers and acts on the behalf of the CLIENT, typically to mask the client’s identity (IP address).
What is a reverse Proxy?
A server that sits between the client and servers and acts on the behalf of the SERVER, typically for logging, load balancing or caching.
What is a load Balancer?
A reverse proxy that distributes traffic across servers
What is SHA?
“Secure Hashing Algorithms”, the SHA is a collection of cryptographic hash functions used in the industry. These days, SHA-3 is a popular choice to use in the system
What is an ACID transaction?
Atomicity: either fails or succeeds
Consistent: cannot bring the DB to an invalid state.
Isolation: The executions of multiples transactions concurrently will have the same effects as if they have been executed sequentially
Durability: any commited transaction is written to a non-volatile storage
What is Prometheus?
Popular open source time series database
What is Sharding?
Sometimes called data partitioning, sharding is the act of splitting the database in two or more pieces called shards and is typically done to increase the throughput of your database
What is a Hot spot?
When distributing workload, some servers might get more traffics than others. This can happen if your sharding key or hashing function are suboptimal.
What is Leader Election?
Process by which nodes in a cluster ( for instance, servers in a set of servers) elect a so called “leader” amongst them, responsible for the primary operations that these nodes provides. There are some known well algorithms for that like Paxos and Raft
What is pooling?
The act of fetching a resource or piece of that regularly at an interval to make sure the data is not too stale