Hulahoop : Cloud Database Service
분산기술Lab.
황지수
3/44
Session Preview
간단한 소개
개발 배경
구조와 특징
서비스로의 진화
적용 사례
간단한 소개 Hulahoop가 어떤 것인지 맛보기
5/44
한 마디로 말해보기
Hulahoop는
이다 Cloud Database Service
6/44
Cloud Database Service Taxanomy
• Cloud Database Service 분류
Virtual Machine Deployment
Database as a Service
SQL
Oracle
MySQL
PostgreSQL
Amazon RDS
Microsoft Azure
Heroku
NoSQL
CouchDB (EC2)
Hadoop(EC2)
Cassandra(EC2)
Amazon DynamoDB
Amazon SimpleDB
Google AppEngine Datastore
7/44
Deployment Model
Virtual Machine Deployment
Database as a Service
설치 & 운영 사용 요금 지불
8/44
Data Model
SQL NoSQL
SELECT [name]
FROM [H3_ATTENDEES]
WHERE [current_session] =
‘Hulahoop’
Set( key, value )
Get( key )
Delete( key )
표준 복잡한 모델
비표준 간단한 모델
9/44
Hulahoop를 분류해보면,
Virtual Machine Deployment
Database as a Service
SQL MySQL Heroku
NoSQL Cassandra(EC2) DynamoDB, Hulahoop
개발 배경 Hulahoop : The Beginning
11/44
결론 먼저,
1. Cloud Database Service가 되기 위해서 만들어진 것이 아닙니다.
2. 분산파일시스템을 위해서 태어났습니다.
12/44
분산파일시스템 구조
분산파일시스템 구조
Master Node
Data Node #2
Data Node#1
Data Node #3
Data Node #4
1,3,4
2,3,4
13/44
이런 구조의 단점은,
구조적 한계
• SPOF
• Scalability
Master Node
Data Node #2
Data Node#1
Data Node #3
Data Node #4
1,3,4
2,3,4
14/44
PrismFS v1.0
PrismFS v1.0
• Multi Master
• Cassandra
Data Node #2
Data Node#1
Data Node #3
Data Node #4
확장성 + 가용성
Master Node
Storage Storage
Cassandra
15/44
Cassandra를 선택한 것은,
v0.6
고가용성 ★
수평적 확장성 ★
적용사례 ★★★
데이터 모델 ★★★
고가용성 ★★★
수평적 확장성 ★★★
적용사례 ★
데이터 모델 ★
16/44
Cassandra 적용 이슈 1. NoSQL 데이터 모델
Data Model
• De-normalization Table( c1, … , cn ) ( key, value )
• Data Marshalling
File Meta Slice Meta
Slice Meta
. . .
Marshalled Data
Key
17/44
Cassandra 적용 이슈 2. Update pattern
Update Pattern
UPDATE [Meta] SET [version] = [version] + 1 WHERE [key]=‘key’
BLOB = get( key )
meta = UnMarsh( BLOB )
meta.version += 1
BLOB_v2 = Marsh( meta )
Set( key, BLOB_v2 )
Get & set
18/44
Slice Meta
Slice Meta”
. . . Slice Meta’
Slice Meta
. . .
Cassandra 적용 이슈3 . Concurrent update
Concurrent Update
• Locking ( Local / Global )
Slice Meta
Slice Meta
. . .
Node A get & set
Node B get & set
19/44
Cassandra 적용 이슈4 . Timestamp ordering
Timestamp Ordering
100 110 120 Node A
20 40 50 Node B
100 50
120+α
>
<
100+α 110+α 120+α Logical Clock
20/44
PrismFS v1.0에서 얻은 경험은,
데이터모델의 차이를 극복하려면,
• 구현 복잡도 증가.
• 메타데이타 저장소의 성능 활용 못함.
PrismFS에서 필요한 데이터모델
21/44
새로운 메타 데이터 저장소
PrismFS v2.0을 위한 새로운 메타 저장소
• 고가용성
• 수평적 확장성
• 분산파일시스템에 적합한 데이터 모델
• 부분적인 ACID
Hulahoop
구조와 특징
23/44
Architecture Overview
Architecture Overview
• 데이터 모델
• Slot
• Slot Ownership
• Fail-over
• Scale-out
24/44
Data Model
데이터 모델
기본은 간단한 데이터 모델
• ( Key, Value ) = ( Domain, Data )
다양한 Data 처리 방법으로 기능 확장
• SQL
• Python Script
Domain Data
25/44
Data Type : SQL
Data Type : SQL
Hulahoop
Col1 … ColN
Row1_col1 … Row1_colN
… … …
RowN_col1 … RowN_colN
SELECT * FROM MY_TABLE;
26/44
Data Type : Python Script
Data Type : Python Script
• Entry point.
• Server context.
Hulahoop def run( conn ): c = conn.cursor() c.execute( ‘…..’ ) return c.fetchone()
result
27/44
Slot
Slot
• 데이터 처리와 저장 모듈
Operation Log
Database Engine
Script Processor
Snapshot
Data
Background
28/44
Hulahoop와 Slot
Hulahoop = 다수의 Slot
Slot
Slot Slot
Slot
Slot Slot
Slot
29/44
Slot Ring
Slot Ring
• 가상의 원형 공간에 배치
• 고정된 Ring의 크기 = Slot의 개수
Slot
Slot Slot
Slot
Slot Slot
Slot
Hash
Domain
30/44
Server Ring
Server Ring
• Slot Ring과 같은 크기.
• 동일한 규칙으로 ownership 영역을 갖음.
31/44
Slot Ownership
Slot Ownership
Slot
Slot Slot
Slot
Slot Slot
Slot
32/44
Slot Routing
Slot Routing
Hash
Domain
33/44
Replication
Replication
• Operation Log를 3배수로 복제.
34/44
Failover
Fail-over
• 이웃한 서버에 대해서 작동.
Slot
Slot
Slot
Slot
Slot
Slot
35/44
Failover
Fail-over
• 이웃한 서버에 대해서 작동.
Slot
Slot
Slot
Slot Slot
Slot
Activate
36/44
Scale-out
Scale-out
• 새로운 Ownership에 따라서 Slot 재배치.
Slot Slot
Slot
Slot Slot
Slot
37/44
Scale-out
Scale-out
• 새로운 Ownership에 따라서 Slot 재배치.
Slot
Slot
Slot
Slot
Slot
Slot
Slot Slot
Copy Data &
Acquire Ownership
38/44
Features
Hulahoop 구조의 특징
• Decentralized system.
• Horizontal Scalable.
• Support SQL, Python Script.
서비스로의 진화
40/44
Amazon DynamoDB API
Amazon DynamoDB API
• AWS APIs 사실상의 표준
• PrismFS = AWS S3
• 다수의 3rd party tools, libraries, applications
• 풍부한 documentation
41/44
Service Architecture
Service Architecture
RPC Server REST Server
Hulahoop
42/44
Hulahoop, database service
Hulahoop, Database Service
사용자가 얻는 혜택
• NO, DBMS 설치&운영
• AWS DynamoDB의 장점
적용사례 어떤 곳에서 쓰이고 있는지
44/44
현재 : 적용사례
1. PrismFS 2.0 ( Distributed File System ) - AWS S3 API. - baas.io Storage Service. - Hulahoop Native API. - File metadata storage.
2. IRIS ( Cloud Search Engine ) - Hulahoop REST API. - Document storage.
기술연구소 / 분산기술Lab.
황지수
jsioux {at} kthcorp . com
Top Related