System Design 1 Flashcards

(54 cards)

1
Q

It means increasing the resources of a specific node

A

Vertical Scaling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

It means increasing the number of nodes

A

Horizontal Scaling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

It allows a system to distribute the load evenly so that one server doesn’t crash and take down the whole system.

A

Load Balancer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

They can get very slow as the system grows bigger.

A

Joins in a relational database such as SQL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It means splitting the data across multiple machines while ensuring you have a way of figuring out which data is on which machine.

A

Sharding (Data partitioning)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Common ways of partitioning:

A
  • Vertical Partitioning
  • Key-Based (or Hash-Based) Partitioning
  • Directory-Based Partitioning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Partitioning by feature.

e.g. In a social network you have a table for profiles, one for messages

A

Vertical Partitioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

It uses some kind of data (e.g. an ID) for the partition.

A

Key-based Partitioning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A very simple way to do this is to allocate N servers and put the data on mod(key, n)

A

Key-based Partitioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In this scheme you maintain a lookup table for where the data can be found

A

Directory-Based Partitioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Two major drop backs in Directory-Based Partitioning:

A
  1. The lookup table can be a single point of failure.
  2. Constantly accessing this table impacts performance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

It is a simple key-value pairing and typically sits between your application layer and the data store.

A

Caching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How you cache

A

You might cache a query and its results directly. Or alternatively you can cache the specific object (a rendered version of the website or a list of the most recent blog posts)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Most important metrics around networking

A

Bandwidth, throughput, latency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How slow operations should be

A

Asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Is the maximum amount of data that can be transferred in a unit of time, it is expressed in bits per second.

A

Bandwidth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Is the actual amount of data that is transferred.

A

Throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

It is how long it takes data to go from one end to the other.

A

Latency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

It is typically used to process large amounts of data.

A

A MapReduce program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does a MapReduce program require.

A

It requires to write a Map step and Reduce step.

Map takes in some data and emits a <key, value> pair.
Reduce takes a key and a set of associated values and “reduces” them, emitting a new key and value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Considerations when designing a system.

A
  • Failures
  • Availability and Reliability
  • Read-Heavy vs Write-Heavy
  • Security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Is a function of the percentage of time the system is operating.

A

Availability.

23
Q

Is a function of the probability that the system is operational for a certain unit of time.

24
Q

You could consider queuing up the writes-

25
Yo might want to cache.
Read-Heavy
26
It's a network of servers located all around the world.
CDN (Content Delivery Network)
27
CDN specifications
1.They don't really run any application logic. 2. They work by taking files hosted on your server (origin server) and copy them onto CDN servers. 3. It's a technique of caching.
28
It's the set of rules that decide how we send data over the internet. Works with packets.
TCP/IP
29
It's a decentralized service that works to translate a domain (eg. www.leetcode.com) to it's IP address (192.0.2.132)
DNS (Domain Name System)
30
Is an application level protocol built on top of TCP that follows the client-server model.
HTTP
31
How does HTTP work?
A client initiate a request, which include two parts: request header and request body. Then the client will receive a response.
32
Information in the Request Header
Where the package is going, who it's from and other metadata.
33
Request Body:
It's the package content.
34
Is a standardization around HTTP APIs making them stateless and following consistent guidelines.
REST
35
What is GraphQL?
API pattern. Instead of making another request for every single resource in your server, you make a single request and choose which resources to fetch, you can fetch multiple resources with a single request.
36
What is gRPC?
Framework, considered an improvement of JSON. Is mainly used for server-to-server communication. Data is serialized into a binary format, although, JSON is more human readable.
37
App layer protocol that supports bidirectional communication:
WebSockets
38
Relational Databases. Provides efficient storage and fast power retrieval.
SQL
39
ACID.
* Atomicity * Consistency * Isolation * Durability
40
Every transaction is fully performed or not performed at all.
Atomicity.
41
Means that foreign keys and other constraints are enforced.
Consistency (Database).
42
Means that different concurrent transactions won't interfere with each other.
Isolation.
43
Even if a machine dies data will still be there.
Durability.
44
No-SQL databases examples.
Key-value stores, document stores and Graph DBs.
45
Refers to the process of creating and maintaining multiple copies of data or system components.
Replication
46
This states that it is not possible for a distributed computer system to simultaneously provide all three of guarantees.
CAP (Consistency, Availability and Partition) Theorem.
47
All nodes see the same data even at the same time with concurrent updates
Consistency.
48
A guarantee that every request receives a response about whether it was successful or failed.
Availability
49
The system continues to operate despite arbitrary message loss or failure of part of the system.
Partition Tolerance.
50
Is an XML based industry standard protocol for designing and developing web services.
SOAP (Simple Object Access Protocol)
51
Is a software design approach that organizes applications as a collection of services.
SOA (Service Oriented Architecture)
52
How does SOA work?
The services communicate with each other through well-defined interfaces, often using standard protocols like SOAP or REST.
53
Key Characteristics of SOA.
* Loose Coupling * Reusability * Modularity * Interoperability
54
Desine Loose Coupling
Services are independent and can be modified without affecting other services.