System design Flashcards

1
Q

db: disaster recovery

A
  1. create a standby DB in different AZ, replicated from master DB
  2. using the same DNS to connect to DB
  3. if the master goes down, the replica is automatically up to replace
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

db: replica and backup

A
  1. aws RDS backup every 5m

2. can create 5 read replicas: within AZ, cross AZ or cross region

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

aurora: how to connect to read/write to DB?

A
  1. using reader endpoint, writer endpoint

2. aurora auto-routing to correct destination

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

detect data conflicts

A
  1. using versioning vector D([s1, v1], [s2, v2])
  2. given 2 vectors if all v values in the one vector >= the other one –> no conflict
    conflict example:
    D1([s1,2], [s2,1]) -> populate D1 from s1 2 save into s2
    D2([s1, 1], [s2,2]) -> populate D2 from s1 1 save twice to s2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

rds: available network speed between instances

A

5 Gbps to 25 Gbps depends on the instances (same for both up and down)
home internet: 350 Mbps (both up and down)

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

redis commands for list, set, sorted set

A
  1. sorted set: zadd, zincrby, zrangebyscore, zrangebyrank, zrangebylex, zrembyrank
  2. set: sadd, srem, scard
  3. list: lpush, lpop, rpush, rpop, lindex, linsert, llen
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

CNAME, A, AAAA record

A

A: map host to IP
AAAA: same as A but for IPv6
CNAME: host to another host

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

sticky cookies

A
  1. send cookies to client

2. server uses cookies to identify the server behind the LB

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

aws load balancers

A
  1. application load balancer: application layer e.g. HTTP

2. network load balancer: network layer e.g. TCP/IP

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

terms using in the load balancer

A
  1. target group i.e. group of instances

2. health check

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

aws route 53

A
  1. modes: latency, geographical, failover, simple
  2. TTL
  3. 53 is DNS port
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

forward compatibility

A

is planning ahead

e. g.
1. reserved keywords in programming languages,
2. build something that is easy for adding new feature

argument:
1. mvp: build enough to release only

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

Kafka consumer and offset

A
  1. consumer is assigned to process messages in 1 or many partitions
  2. 1 partition only be handled by 1 consumer
  3. after polling messages, consumer will commit to save offset in Kafka so that if re-balancing/restart the delivered messages won’t be delivered again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

AAA pattern

A

Arrange, Act, Assert

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