System Design Flashcards

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
Q

What can you do when a database can no longer scale vertically?

A

Data partitioning

26
Q

What is data partitioning?

A

Breaking a database into smaller manageable partitions

27
Q

What are different database partitioning methods?

A
  • Horizontal Partitioning (Sharding)
  • Vertical Partitioning
  • Directory-based Partitioning
28
Q

What is horizontal partitioning (sharding)?

A

Divides rows of a table into separate databases

29
Q

What is vertical partitioning?

A

Separating features or columns into separate databases

30
Q

What is directory-based partitioning?

A

Uses a look-up service to abstract a partitioning scheme

31
Q

What are some partitioning techniques?

A
  • Using hash functions
  • List partitioning
  • Round robin
32
Q

What is the hash function partitioning technique?

A

Applying a hash function to the key to determine which partition to put the data in

33
Q

What is the list partitioning technique?

A

Assign each partition a list of values and storing data based on which list it’s assigned to

34
Q

What is the round robin partition?

A

Distribute data evenly through partitions in a circular order

35
Q

What is composite partitioning?

A

Partition that combines two or more partition methods

36
Q

What are the benefits and drawbacks of partitioning?

A

Solves scaling issues, but introduces the challenge of joining of data across multiple partitions