안-정적인 모바일 서비스 만들기
DESCRIPTION
AWS 한국 사용자모임 세미나 SmartStudy CTO 박현우TRANSCRIPT
Safe and Dynamic mobile service via Amazon CloudFront
박현우, 스마트스터디 아마존 웹 서비스 한국 사용자 모임
Mar 8, 2014
Safe and Dynamic mobile service via Amazon CloudFront
박현우, 스마트스터디 아마존 웹 서비스 한국 사용자 모임
Mar 8, 2014
안정적인
안 정적인
Safe
and
Dynamic
So
Safe
함부로 써도 고장나지 않는 내 실수로 망가지지 않는 잊고 살아도 잘 동작하는
Safe
Durable Stable
Fire-and-forget
Dynamic
내용이 다양하고 자주자주 변경될 수 있는 원할 때 신속히 바꿀 수 있는
Dynamic
Various Non-static
Cache control
User Database
Content
Web Server Application
User MySQL
Content
Apache!httpd mod_php5
Static content
Static content
www.vop.co.kr/A00000402002.html
Static content
.html무늬만 html 인 경우도 있지만…
Static content
모두 같은 내용을 보게 되는데 왜 데이터베이스를 괴롭히나?
Static content
이왕 이렇게 된 거 정적인 json / html 로 가자
Web ServerUser Database
Static content
Application
Static content
Static content
Static content
$ ls | wc -l!1042
wowsuch json
very manyso maenual
At the beginning
AWS 속도 문제 가격에 대한 불확실함
… 일단 잘 모름
At the beginning
파일 관리는 git 배포는 rsync
AP / DNS 를 바꿔서 테스트
Testing
Production
Web Server
DNSISP
At the beginning
User
Web Server
DNSGateway
/ AP
Sync
At the beginning
http://www.slideshare.net/lqez/ss-20901287
Cons
git / rsync 불편함 롤백 거의 안 함
안정성을 위해 편리함을 거의 모두 포기 …
그런데 터질만큼 유저도 안 옴…
Pros
그런건 우리에게 있을 수 없어 …
Also
특히 유럽에서의 속도가 너무 느림 S3에 올리고 Cloudfront 로 서빙
http://www.slideshare.net/lqez/aws-smartstudy
http://www.slideshare.net/lqez/using-cloud-front-with-s3-at-smartstudy
Using S3 w/Cloudfront
속도는 개선되었지만 무엇보다 invalidation이 사람 환장하게 함
What’s wrong
코드를 테스트 하기 위한 환경과 데이터를 검증하기 위한 환경은 다르다
Back to the basic
Testing Production
Dynamic Static
Back to the basic
ELB + EC2 S3 + CF
Dynamic Static
Testing
Production
S3
RDS
Hybrid
User
ELB EC2
CF
Export
Clever
스마트스터디 API 서비스 통칭
ONE
스마트스터디 통합 앱 관리 시스템
CleverTesting
Production
S3
RDS
User
ELB EC2
CF
CleverTesting
Production
S3
RDS
User
ELB EC2
CF
CleverTesting
RDSELB EC2 RDSELB EC2RDSELB EC2
RDSELB EC2RDSELB EC2
RDSELB EC2RDSELB EC2
Testing
Clever!Notice
Clever!App
Clever!Log
Clever!Push
Clever / ONE
SMARTSTUDY!ONE
Trap card
BOTO• ACL • Meta data
Cache-control Content-type
Trap card
Django• ELB + uWSGI • Content-length
ConditionalGetMiddleware
http://uwsgi-docs.readthedocs.org/en/latest/HTTP.html#can-i-use-uwsgi-s-http-capabilities-in-production
Trap card
Cloudfront • Minimum TTL
Minimum TTL 1시간 미만은 의도대로 동작하지 않음
Safe and Dynamic mobile service via Amazon CloudFront
박현우, 스마트스터디 아마존 웹 서비스 한국 사용자 모임
Mar 8, 2014