본문 바로가기

학교공부/클라우드

7장 CloudStorage

 

출처

https://medium.com/harrythegreat/%ED%81%B4%EB%9D%BC%EC%9A%B0%EB%93%9C%EC%83%81-%EC%98%A4%EB%B8%8C%EC%A0%9D%ED%8A%B8-%EC%8A%A4%ED%86%A0%EB%A6%AC%EC%A7%80-object-storage-%EB%9E%80-9d9c2da57649

 

 

 

 

 

 

 

ec2깔면 그냥 자동으로 주는거 rack에 있는거임

 

disk를 가상화한게 EBS instance란 분리되어있어서 life cycle이 다름 ec2가 꺼져도 독립적으로 사용 가능.

EBS에 다양한 종류있다.

하나의 가상환경에 여러개 EBS 붙이기 가능

 

EBS Snapshot 찍어서 S3에 저장하면 복구가능

 

snapshot을 바뀐것만 업데이트하면 좀더 오버헤드 줄일수 있다.

improhanced snapshot 

 

 

 

 

많은 데이터 옮길 때 

 

CDN

 

 

 

 

Key value storage(KVS)

운영체제는 단순함 그냥 블럭 읽고 쓰는거

클라우드 사용하는 웹서버도 똑같음

간단한 Key/value store인 s3 사용해서 서비스 만드는거임

 

 

Inverted Indices

역색인으로 빠르게 웹페이지 찾을 수 있다.

 

KVS concurrency

동시에 들어오는거 잘 처리해야된다.

 

 

요약

key value store put get delete 있다.

키마다 여러개 값 가능

동시성 문제 고민해봐야됨

 

대표적인 cloud KVS가 S3이다

 

목표

 

 

S3는 Few large-object를 위한 storage이다.

밑에거는 S3보다 strong consistency, no sql(s3도 no sql이긴함), 빈번한 수정과 업데이트 있는경우 유리하다.

 

 

 

 

S3

bucket이름 global unique

왜?

이런 object storage에서 key로 가져올라면 유니크해야됨 key table도 겁나 큼

 

 

 

 

S3: Consistency models

PUTS and DELETES에서 consistency 생각해봐야한다

 

 

Updates to a single key are atomic. For example, if you PUT to an existing key, a subsequent read might return the old data or the updated data, but it will never  return corrupted or partial data.

123을 456으로 update했을 때  get되는건 둘중 하나

 

Amazon S3 achieves high availability by replicating data across multiple servers within Amazon's data centers. If a PUT request is successful, your data is safely stored. However, information about the changes must replicate across Amazon S3, which can take some time, and so you might observe the following behaviors

replica하는데 시간걸려서 PUT했다고 바로 적용되는건 아니다

 

• A process writes a new object to Amazon S3 and immediately lists keys within its bucket. Until the change is fully propagated, the object might not appear in the list

위에거랑 비슷한데 업로드해도 바로 보일수도 안보일수도 있다. (eventual consistency)

업로드뿐만아니라 기존의 object 변경이나 지울때 모두 마찬가지

 

Amazon S3 does not currently support object locking. If two PUT requests are simultaneously made to the same key, the request with the latest time stamp wins. If this is an issue, you will need to build an object-locking mechanism into your application.

request 동시에 두개보내면 뭐가 적용될지 알수 없다. (123,456 수정 요청보내면 뭐가될지 모름)

 

구체적으로 어느정도 까지 consistency 보장될까?

 

위와 같은 상황에서 consistency 보장되면 R1 R2 모두 W2가 보여줘야되지만 Eventual에서는 W1,W2 no result 장담 못한다.

 

 

버전 관리 가능

 

 

 

 

요약

'학교공부 > 클라우드' 카테고리의 다른 글

CloudNoSQL  (0) 2021.05.27
python boto3 s3 upload & download (region별 시간 측정)  (0) 2021.05.22
AWS VPC, instance, 보안그룹, ec2, putty 실습  (0) 2021.05.18
7장(EBS)  (0) 2021.05.16
6장  (0) 2021.05.12