Submit Search
Webservice cache strategy
172 likes
36,813 views
DaeMyung Kang
1 of 125
Download now
Downloaded 213 times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
More Related Content
What's hot
(20)
PDF
webservice scaling for newbie
DaeMyung Kang
PDF
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
PDF
Understanding of Apache kafka metrics for monitoring
SANG WON PARK
PDF
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
PDF
파이어베이스 네이버 밋업발표
NAVER D2
PDF
Redis edu 5
DaeMyung Kang
PDF
게임 서비스를 위한 AWS상의 고성능 SQL 데이터베이스 구성 (이정훈 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon Web Services Korea
PPTX
Hanghae99 FinalProject Moyeora!
Young Woo Lee
PDF
Cloud dw benchmark using tpd-ds( Snowflake vs Redshift vs EMR Hive )
SANG WON PARK
PDF
20140806 AWS Meister BlackBelt - Amazon Redshift (Korean)
Amazon Web Services Korea
PDF
Amazon Aurora Deep Dive (김기완) - AWS DB Day
Amazon Web Services Korea
PDF
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
Hyunmin Lee
PDF
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
PDF
비디가 제시하는 AWS Migration 주요 factor - BD 홍성준 이사:: AWS Cloud Track 1 Intro
Amazon Web Services Korea
PDF
How to build massive service for advance
DaeMyung Kang
PDF
[Gaming on AWS] AWS와 함께 한 쿠키런 서버 Re-architecting 사례 - 데브시스터즈
Amazon Web Services Korea
PDF
Apache kafka performance(latency)_benchmark_v0.3
SANG WON PARK
PDF
아마존 클라우드와 함께한 1개월, 쿠키런 사례중심 (KGC 2013)
Brian Hong
PDF
Cloudera Impala 1.0
Minwoo Kim
PPTX
0222 사내세미나_오정민 스프링인액션
DataUs
webservice scaling for newbie
DaeMyung Kang
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
Understanding of Apache kafka metrics for monitoring
SANG WON PARK
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
파이어베이스 네이버 밋업발표
NAVER D2
Redis edu 5
DaeMyung Kang
게임 서비스를 위한 AWS상의 고성능 SQL 데이터베이스 구성 (이정훈 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon Web Services Korea
Hanghae99 FinalProject Moyeora!
Young Woo Lee
Cloud dw benchmark using tpd-ds( Snowflake vs Redshift vs EMR Hive )
SANG WON PARK
20140806 AWS Meister BlackBelt - Amazon Redshift (Korean)
Amazon Web Services Korea
Amazon Aurora Deep Dive (김기완) - AWS DB Day
Amazon Web Services Korea
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
Hyunmin Lee
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
비디가 제시하는 AWS Migration 주요 factor - BD 홍성준 이사:: AWS Cloud Track 1 Intro
Amazon Web Services Korea
How to build massive service for advance
DaeMyung Kang
[Gaming on AWS] AWS와 함께 한 쿠키런 서버 Re-architecting 사례 - 데브시스터즈
Amazon Web Services Korea
Apache kafka performance(latency)_benchmark_v0.3
SANG WON PARK
아마존 클라우드와 함께한 1개월, 쿠키런 사례중심 (KGC 2013)
Brian Hong
Cloudera Impala 1.0
Minwoo Kim
0222 사내세미나_오정민 스프링인액션
DataUs
Viewers also liked
(19)
PDF
Redis begins
DaeMyung Kang
PDF
Redis edu 4
DaeMyung Kang
PDF
Redis edu 2
DaeMyung Kang
PDF
Redis edu 1
DaeMyung Kang
PDF
Redis edu 3
DaeMyung Kang
PDF
카카오스토리 웹팀의 코드리뷰 경험
Ohgyun Ahn
PDF
Scala dreaded underscore
RUDDER
PPTX
알고리즘2
Byeongsu Kang
PPTX
Aws summit 2017 사내전파교육
Byeongsu Kang
PPTX
알고리즘 문제해결전략 #1
Byeongsu Kang
PPTX
코딩소림사 Rx java
Byeongsu Kang
PPTX
Exception log practical_coding_guide, 예외와 로그 코딩 실용 가이드
도형 임
PPTX
멸종하는 공룡이 되지 않으려면
Byeongsu Kang
PPTX
예외처리가이드
도형 임
PDF
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
Taehoon Kim
PDF
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
Taehoon Kim
PDF
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
Taehoon Kim
PDF
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Taehoon Kim
PDF
책 읽어주는 딥러닝: 배우 유인나가 해리포터를 읽어준다면 DEVIEW 2017
Taehoon Kim
Redis begins
DaeMyung Kang
Redis edu 4
DaeMyung Kang
Redis edu 2
DaeMyung Kang
Redis edu 1
DaeMyung Kang
Redis edu 3
DaeMyung Kang
카카오스토리 웹팀의 코드리뷰 경험
Ohgyun Ahn
Scala dreaded underscore
RUDDER
알고리즘2
Byeongsu Kang
Aws summit 2017 사내전파교육
Byeongsu Kang
알고리즘 문제해결전략 #1
Byeongsu Kang
코딩소림사 Rx java
Byeongsu Kang
Exception log practical_coding_guide, 예외와 로그 코딩 실용 가이드
도형 임
멸종하는 공룡이 되지 않으려면
Byeongsu Kang
예외처리가이드
도형 임
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
Taehoon Kim
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
Taehoon Kim
딥러닝과 강화 학습으로 나보다 잘하는 쿠키런 AI 구현하기 DEVIEW 2016
Taehoon Kim
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Taehoon Kim
책 읽어주는 딥러닝: 배우 유인나가 해리포터를 읽어준다면 DEVIEW 2017
Taehoon Kim
Ad
Similar to Webservice cache strategy
(20)
PDF
레코벨의 추천 서비스 고군 분투기 - AWS Summit Seoul 2017
Amazon Web Services Korea
PDF
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
devCAT Studio, NEXON
PDF
2017 Ad-Tech on AWS 세미나ㅣ추천서비스 고군부투기 on AWS
Amazon Web Services Korea
PDF
AWS 천재가 된 홍대리 10가지 팁:: Megazone 박세진 ::AWS Summit Seoul 2016
Amazon Web Services Korea
PDF
AWS와 함께하는 금융권 hpc 도입 :: 이정인 :: AWS Finance Seminar
Amazon Web Services Korea
PDF
나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016
Amazon Web Services Korea
PDF
AWS와 함께하는 클라우드 컴퓨팅 - AWS 웨비나 시리즈 2015
Amazon Web Services Korea
PDF
AWS 첫 번째 프로젝트 시작하기 :: 노경훈 :: AWS Summit Seoul 2016
Amazon Web Services Korea
PDF
알아두면 쓸데있는 잡학사전- AWS Tips편::허준, 김병수::AWS Summit Seoul 2018
Amazon Web Services Korea
PDF
AWS CLOUD 2017 - Amazon Redshift 기반 DW 와 비지니스 인텔리전스 구현 방법 (김일호 솔루션즈 아키텍트)
Amazon Web Services Korea
PDF
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
hoondong kim
PDF
AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기
Amazon Web Services Korea
PDF
AWS 클라우드로 천만명 웹 서비스 확장하기 - 윤석찬 백승현 - AWS Summit 2016
Amazon Web Services Korea
PDF
AWS Finance Symposium_천만 고객을 위한 AWS 클라우드 아키텍쳐 확장하기
Amazon Web Services Korea
PPTX
Event Storming and Implementation Workshop
uEngine Solutions
PDF
[261] 실시간 추천엔진 머신한대에 구겨넣기
NAVER D2
PDF
AWS 클라우드 비용 최적화를 위한 TIP - 임성은 AWS 매니저
Amazon Web Services Korea
PDF
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
NAVER D2
PDF
[Retail & CPG Day 2019] Amazon.com의 무중단, 대용량 DB패턴과 국내사례 (Lotte e-commerce) - ...
Amazon Web Services Korea
PDF
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
Amazon Web Services Korea
레코벨의 추천 서비스 고군 분투기 - AWS Summit Seoul 2017
Amazon Web Services Korea
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
devCAT Studio, NEXON
2017 Ad-Tech on AWS 세미나ㅣ추천서비스 고군부투기 on AWS
Amazon Web Services Korea
AWS 천재가 된 홍대리 10가지 팁:: Megazone 박세진 ::AWS Summit Seoul 2016
Amazon Web Services Korea
AWS와 함께하는 금융권 hpc 도입 :: 이정인 :: AWS Finance Seminar
Amazon Web Services Korea
나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016
Amazon Web Services Korea
AWS와 함께하는 클라우드 컴퓨팅 - AWS 웨비나 시리즈 2015
Amazon Web Services Korea
AWS 첫 번째 프로젝트 시작하기 :: 노경훈 :: AWS Summit Seoul 2016
Amazon Web Services Korea
알아두면 쓸데있는 잡학사전- AWS Tips편::허준, 김병수::AWS Summit Seoul 2018
Amazon Web Services Korea
AWS CLOUD 2017 - Amazon Redshift 기반 DW 와 비지니스 인텔리전스 구현 방법 (김일호 솔루션즈 아키텍트)
Amazon Web Services Korea
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
hoondong kim
AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기
Amazon Web Services Korea
AWS 클라우드로 천만명 웹 서비스 확장하기 - 윤석찬 백승현 - AWS Summit 2016
Amazon Web Services Korea
AWS Finance Symposium_천만 고객을 위한 AWS 클라우드 아키텍쳐 확장하기
Amazon Web Services Korea
Event Storming and Implementation Workshop
uEngine Solutions
[261] 실시간 추천엔진 머신한대에 구겨넣기
NAVER D2
AWS 클라우드 비용 최적화를 위한 TIP - 임성은 AWS 매니저
Amazon Web Services Korea
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
NAVER D2
[Retail & CPG Day 2019] Amazon.com의 무중단, 대용량 DB패턴과 국내사례 (Lotte e-commerce) - ...
Amazon Web Services Korea
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
Amazon Web Services Korea
Ad
More from DaeMyung Kang
(20)
PPTX
Count min sketch
DaeMyung Kang
PDF
Redis
DaeMyung Kang
PDF
Ansible
DaeMyung Kang
PDF
Why GUID is needed
DaeMyung Kang
PDF
How to use redis well
DaeMyung Kang
PPTX
The easiest consistent hashing
DaeMyung Kang
PDF
How to name a cache key
DaeMyung Kang
PDF
Integration between Filebeat and logstash
DaeMyung Kang
PDF
How To Become Better Engineer
DaeMyung Kang
PPTX
Kafka timestamp offset_final
DaeMyung Kang
PPTX
Kafka timestamp offset
DaeMyung Kang
PPTX
Data pipeline and data lake
DaeMyung Kang
PDF
Redis acl
DaeMyung Kang
PDF
Coffee store
DaeMyung Kang
PDF
Number system
DaeMyung Kang
PDF
Bloomfilter
DaeMyung Kang
PDF
Redis From 2.8 to 4.x(unstable)
DaeMyung Kang
PDF
Redis From 2.8 to 4.x
DaeMyung Kang
PDF
Soma search
DaeMyung Kang
PDF
Redis 2017
DaeMyung Kang
Count min sketch
DaeMyung Kang
Redis
DaeMyung Kang
Ansible
DaeMyung Kang
Why GUID is needed
DaeMyung Kang
How to use redis well
DaeMyung Kang
The easiest consistent hashing
DaeMyung Kang
How to name a cache key
DaeMyung Kang
Integration between Filebeat and logstash
DaeMyung Kang
How To Become Better Engineer
DaeMyung Kang
Kafka timestamp offset_final
DaeMyung Kang
Kafka timestamp offset
DaeMyung Kang
Data pipeline and data lake
DaeMyung Kang
Redis acl
DaeMyung Kang
Coffee store
DaeMyung Kang
Number system
DaeMyung Kang
Bloomfilter
DaeMyung Kang
Redis From 2.8 to 4.x(unstable)
DaeMyung Kang
Redis From 2.8 to 4.x
DaeMyung Kang
Soma search
DaeMyung Kang
Redis 2017
DaeMyung Kang
Webservice cache strategy
1.
초보자를 위한 웹
서비스 캐시 전략
[email protected]
2.
Agenda •왜 캐시를
사용해야 하는가? •확장을 위한 캐시 방법
3.
서비스 초창기
4.
목표?
5.
목표? 백만, 천만?
6.
네이버 다니시나요? 그럼
1번, 아니면 2번…
7.
1번. 이걸 들을
필요가… 없습니다. T.T
8.
2번. 일단 출시가
먼저죠.
9.
Client Buisness Logic
Storage 서비스 초창기 구조: 1대
10.
서비스가 잘된다면?
11.
확장이 필요합니다.
12.
어디가 가장 문제가
될까요?
13.
Client Buisness Logic
Storage Client?
14.
Client Buisness Logic
Storage Buisness Logic?
15.
Client Business Logic
Storage Storage?
16.
선택 할 수
있는 방법?
17.
Scale Up VS
Scale Out
18.
Scale Up
19.
Scale Up 성능이
더 좋은 장비로…
20.
초당 1000 TPS
21.
초당 3000 TPS
3배 처리 가능한 서버를 투입
22.
Scale Up CPU
4 -> 24 Mem 4G -> 32G
23.
Scale Out
24.
Scale Out 장비를
더 늘리자.
25.
초당 1000 TPS
26.
초당 2000 TPS
27.
초당 3000 TPS
28.
일반적으로는 Scale Up
이 더 쉽고 Scale Out 이 비용이 적게 든다.
29.
진실은…
30.
뒤로 가면 다~~~
어렵워요!!!
31.
뭐든지, 달리는 열차의
바퀴를 갈아 끼우는 겁니다.
32.
다시 캐시 얘기로…
33.
캐시를 선택해야 하는
이유.
34.
1. 돈이 부족한데
성능을 더 높여야 할때…
35.
2. 돈은 있지만…
성능을 더 높여야 할때…
36.
Use Case: Login
37.
Use Case: Login
DB에서 읽기 Select * from Users where id=‘charsyam’;
38.
유저 수가 적으면…
39.
충분히 빠릅니다.
40.
그런데 유저 수가
엄청 많으면?
41.
DB도 인덱스 걸면
충분히 빠릅니다.
42.
단 읽기만 한다면…
43.
또, 디스크 읽는
수 가 적을때만
44.
Disk Page 접근
문제
45.
Use Case: Login
읽기에 캐시 적용
46.
Use Case: Login
캐시에서 읽기 Get charsyam
47.
적용 결과…
48.
Select Query
49.
CPU utility
50.
균등한 속도!!! 부하
감소!!!
51.
Use Case: Log
52.
Use Case: Log
Apply Cache For Write
53.
Use Case: Log
Insert DB per one log Insert into clicklogs values(a,b,c);
54.
Use Case: Log
모아서 쓰기…1024개 단위 Insert into clicklogs values(a1,b1,c1), (a2,b2,c2), (a3,b3,c3)
55.
모아 쓰기를 위한
버퍼로 캐시 사용
56.
적용 결과…
57.
10 만건 insert
쓰기 단위 1 1024 속도(초) 16~17 1.4~1.5
58.
캐시를 쓰면 좋다는
건 알겠는데…
59.
그럼 캐시 서버의
확장은?
60.
1대만 쓰기에는…
61.
캐시 역시 데이터…
62.
Client Business Logic
Storage 일단 어디에 캐시가?
63.
Client Business Logic
Storage Client – Logic?
64.
Client Business Logic
Storage Logic - Storage?
65.
당연히 보통은 후자가
올바릅니다.
66.
General Cache Layer
Cache DBMS Storage Layer Application Server READ WRITE WRITE UPDATE
67.
그럼 어떤 데이터를
캐시해야 할까요?
68.
당연히 자주 찾을
것 같은 데이터를 캐시해야 합니다.
69.
이런 데이터는 서비스마다
다릅니다.
70.
페이스북이라면 어떤걸 캐시하고
있을까요?
71.
Login을 위한 유저
정보
72.
첫 화면에 보여줄
피드 몇백개
73.
친구 관계등
74.
이슈는 Scale
75.
유저 로그인 관련
정보
76.
유저 로그인 관련
정보 많아도 대부분 메모리에 올라감.
77.
1k * 10,000,000
78.
1k * 10,000,000
= 10G
79.
그런데 1억명이면?
80.
한 서버당 100G?
81.
한 서버당 100G?
물론 가능함… 돈만 있으면…
82.
그럼 10억명이면?
83.
그럼 10억명이면? 1TB?
84.
캐시의 분배가 필요함
85.
캐시의 분배가 필요함
데이터
86.
결국은 분배 전략…
87.
그냥 한대?
88.
그냥 한대? LRU등으로
자주쓰는 녀석들만… 조금…
89.
여러대면?
90.
Range
91.
Range 1~백만: 1번
백만1~2백만: 2번
92.
Range Range가 너무
크면 서버별 사용 리소스가 크게 차이날 수 있다.
93.
Range 서버 추가
시에 Range 조절이 없으면 데이터 이동이 없다.
94.
Range User #1
User #10 User #1000000 User #1000001 User #1000100 User #2000000 User #2000001 User #2000200 User #3000000 Server User #1000005 2
95.
Modulo
96.
Modulo Id %
서버대수 = k
97.
Modulo 서버 대수에
따라서 데이터 이동이 많아짐.
98.
Modulo 가능하면 2배씩
증가하는 게 유리.
99.
Modulo Logical Shard
Physical Shard
100.
Modulo User #1
User #4 User #7 User #2 User #5 User #8 User #3 User #6 User #9 Server User #1 1
101.
Consistent Hash
102.
Consistent Hash 서버의
추가/제거 시에 1/n 정도의 데이터만 사라진다.
103.
Consistent Hash 다른
방식은 데이터의 서버위치가 고정적이지만, CH는 유동적
104.
A Add A,B,C
Server
105.
A B Add
A,B,C Server
106.
A B C
Add A,B,C Server
107.
A B C
1 Add Item 1
108.
A B C
1 2 Add Item 2
109.
A B C
1 2 3 4 5 Add Item 3,4,5
110.
A B C
2 3 4 5 Fail!! B Server
111.
A B C
1 2 3 4 5 Add Item 1 Again -> Allocated C Server
112.
A B C
1 2 3 4 5 1 Recover B Server -> Add Item 1
113.
Indexed
114.
Indexed 해당 데이터가
어디 존재하는지 Index 서버가 따로 존재
115.
Indexed 해당 데이터가
어디 존재하는지 Index 서버가 따로 존재
116.
Indexed Index 변경으로
데이터 이동이 자유롭다.
117.
Indexed Index 서버에
대한 관리가 추가로 필요.
118.
Indexed User #1
User #2000 User #1000000 User #2 User #2001 User #10000 User #3 User #6 User #5000 Server User #5000 3 Index Server User 5000 is in 3
119.
다양한 변종도 있을
수 있음.
120.
적합한 방식은 서비스
마다 다름.
121.
서버의 목록은 Zookeeper
등으로 관리하면 좋음
122.
정리하면…
123.
시작할 때는 뭐
하기 어려움.
124.
다만 조금만 고민해도
Technical Debt 을 줄일 수 있음.
125.
Thank you!
Download