728x90
2장 개략적인 규모 추정
2의 제곱수
최소 단위:1바이트=8비트=ASCII 문자 하나
2의 x 제곱 | 근사치 | 이름 |
---|---|---|
10 | 1,000 | 1KB |
20 | 1,000,000 | 1MB |
30 | 1,000,000,000 | 1GB |
40 | 1,000,000,000,000 | 1TB |
50 | 1,000,000,000,000,000 | 1PB |
모든 프로그래머가 알아야 하는 응답지연 값
- 메모리는 빠르지만 디스크는 느리다
- 디스크 탐색은 가능한 한 피하라
- 단순한 압축 알고리즘은 빠르다
- 데이터를 인터넷으로 전송하기 전에 가능하면 압축하라
- 데이터 센터는 보통 여러 지역에 분산 → 센터들 간에 데이터를 주고받는 데는 시간이 걸린다
가용성에 관계된 수치들
고가용성: 퍼센트 (100% = 한 번도 중단된 적이 없다)
SLA(Service Level Agreement): 서비스 사업자가 보편적으로 사용하는 용어, 서비스 사업자와 고객 사이에 맺어진 합의
가용률 | 하루당 장애시간 | 주당 장애시간 | 개월당 장애시간 | 연간 장애시간 |
---|---|---|---|---|
99% | 14.4분 | 1.68시간 | 7.31시간 | 3.65일 |
99.9 | 1.44분 | 10.08분 | 43.83분 | 8.77시간 |
99.99 | 8.64초 | 1.01분 | 4.38분 | 52.60분 |
99.999 | 864.00밀리초 | 6.05초 | 26.30초 | 5.26분 |
99.9999 | 86.40밀리초 | 604.80밀리초 | 2.63초 | 31.56초 |
QPS(Query Per Second): DAU * 일별 사용량 / 24시간 / 3600초
미디어 저장을 위한 저장소 요구량: DAU * 일별 사용량 * 미디어 용량
효과적 면접을 위한 4단계 접근법
1단계 문제 이해 및 설계 범위 확정
- 구체적으로 어떤 기능들을 만들어야 하나?
- 제품 사용자 수는 얼마나 되나?
- 회사의 규모는 얼마나 빨리 커지리라 예상하나? 석 달, 여섯 달, 일년 뒤의 회사 규모는?
- 회사의 기술 스택은? 설계를 단순화하기 위해 사용할 수 있는 기존 서비스는?
2단계 개략적인 설계안 제시 및 동의 구하기
- 설계안에 대한 최초 청사진을 제시하고 의견을 구하라
- 화이트보드/종이에 핵심 컴포넌트를 포함하는 다이어그램을 그려라 (클라이언트, API, 웹 서버, 데이터 저장소, 캐시, CDN, 메시지 큐)
- 최초 설계안이 시스템 규모에 관련된 제약사항들을 만족하는지를 계산해 보라. 계산 과정은 소리 내어 설명하라
3단계 상세 설계
다음 목표는 달성
- 시스템에서 전반적으로 달성해야 할 목표와 기능 범위 확인
- 전체 설계의 개략적 청사진 마련
- 해당 청사진에 대한 면접관의 의견 청취
- 상세 설계에서 집중해야 할 영역들 확인
4단계 마무리
- 면접관이 시스템 병목구간/개선 가능한 지점을 찾아내라 주문 → 비판적 사고 능력을 보일 수 있다
- 설계를 요약 → 면접관의 기억 환기
- 운영 이슈 → 메트릭 수집, 모니터링, 로그, 시스템 배포
- 미래에 닥칠 규모 확장 요구에 어떻게 대처
- 세부적 개선사항 제안
해야 할 것
- 질문을 통해 확인하라
- 문제의 요구사항을 이해하라
- 정답/최선의 답안은 없다, 요구사항을 정확하게 이해했는지 확인하라
- 면접관이 사고 흐름을 이해할 수 있도록 하라
- 여러 해법을 함께 제시하라
- 개략적 설계에 면접관이 동의하면, 각 컴포넌트의 세부사항을 설명해라, 가장 중요한 컴포넌트부터 진행하라
- 면접관의 아이디어를 이끌어 내라
- 포기하지 말라
하지 말아야 할 것
- 전형적인 면접 문제들에 대비하지 않는 것
- 요구사항/가정을 분명히 하지 않은 상태에서 설계를 제시하는 것
- 처음부터 특정 컴포넌트의 세부사항에 대해 깊이 설명
- 진행 중에 막혔다면 힌트를 청해야 한다
- 소통을 주저하지 말라
- 설계안을 내놓는 순간 면접은 끝나는 것이 아니다
시간 배분
- 1단계 - 문제 이해 및 설계 범위 확정: 3~10분
- 2단계 - 개략적 설계안 제시 및 동의 구하기: 10~15분
- 3단계 - 상세 설계: 10~25분
- 4단계 - 마무리: 3~5분
728x90
'System Design Interview' 카테고리의 다른 글
[대규모 시스템 설계 기초] 1장 사용자 수에 따른 규모 확장성 (0) | 2023.12.10 |
---|