System Design Flashcards

(36 cards)

1
Q

What is impractical about having one server and a database for designing a system?

A

It’s not scale able, as the user base grows

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

What is the solution to having one server and a database?

A

Distributed system

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

What is a distributed System?

A

A network of standalone computers that work together as one

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

What are the key characteristics of a distributed system?

A
  • Scalability
  • Reliability
  • Availability
  • Efficiency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is scalability in terms of system designg?

A

The systems ability to handle growing demand

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

What is horizontal scaling in system design?

A

Scale by increasing the amount of servers

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

What is vertical scaling?

A

Scale by adding more/upgrading resources

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

What is a reliable system?

A

The system remains to operate even when components fail

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

What is availability in terms of system design?

A

The percentage of time a system is available

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

What is efficiency in terms of system design?

A

Latency - The delay in getting the first response
Throughput - Operations per time unit

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

What is the typical trade-off when designing distributed systems?

A

Scalability vs consistency

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

What is a load balancer?

A

Balances the load of traffic to each working server on a system

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

What are some of the load balancer algorithms?

A

Least connection - Sends requests to the server with the least connections
Round Robin - Iterates through a list of servers
IP Hash - Uses clients IP to identify which server

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

Can load balancers fail?

A

Yes, they can become a single point of failure, therefore it is advised to have standby load balancers in case one fails.

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

What is caching in system design?

A

Stores recent retrieved data as it anticipates it will be needed again

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

What are some issues that arise with caching?

A

Data consistency, we must ensure that the cache data is accurate

17
Q

How does SQL/relational databases store data?

A

Stores data in tables with predefined schema

18
Q

What are NoSQL Databases?

A

More flexible data-structure than SQL

19
Q

What are the four main types of NoSQL databases?

A
  • Key-Value Stores
  • Document Database
  • Wide-column Stores
  • Graph Databases
20
Q

What do we compare when SQL vs NoSQL?

A
  • Structure: SQL has a rigid schema, NoSQL is more flexible
  • Querying: SQL uses more structured querying, NoSQL is more focused on collection of documents
  • Scalability: SQL vertical scaling, NoSQL horizontal scaling
  • Reliability: SQL is ACID compliant, NoSQL is not
21
Q

When would we use SQL (systems)?

A
  • ACID Compliance is needed
  • Financial Applications
  • Structured Consistent data
22
Q

When would we use NoSQL (systems)?

A
  • Large volumes of unstructured data
  • Flexibility in data structures
  • In need of rapid development that requires change
23
Q

How do we upgrade database quering speed?

A
  • Indexing - a structure that points to the actual location of the data
24
Q

What is indexing tradeoffs?

A

Improve read performance at the cost of write performance

25
What can you do when a database can no longer scale vertically?
Data partitioning
26
What is data partitioning?
Breaking a database into smaller manageable partitions
27
What are different database partitioning methods?
- Horizontal Partitioning (Sharding) - Vertical Partitioning - Directory-based Partitioning
28
What is horizontal partitioning (sharding)?
Divides rows of a table into separate databases
29
What is vertical partitioning?
Separating features or columns into separate databases
30
What is directory-based partitioning?
Uses a look-up service to abstract a partitioning scheme
31
What are some partitioning techniques?
- Using hash functions - List partitioning - Round robin
32
What is the hash function partitioning technique?
Applying a hash function to the key to determine which partition to put the data in
33
What is the list partitioning technique?
Assign each partition a list of values and storing data based on which list it's assigned to
34
What is the round robin partition?
Distribute data evenly through partitions in a circular order
35
What is composite partitioning?
Partition that combines two or more partition methods
36
What are the benefits and drawbacks of partitioning?
Solves scaling issues, but introduces the challenge of joining of data across multiple partitions