SlideShare a Scribd company logo
1 of 28
Download to read offline
LevelDB     by


   ohyecloudy
    homepage : http://ohyecloudy.com
    twitter : @ohyecloudy
   아꿈사 :   http://cafe.naver.com/architect1.cafe


                                     2011.08.06
아~ 이런 게 있구나
            본 발표 목적




    좀 더 쉽게 얘기하자면 ‘깊이가 없다’입니다.
따끈~      따끈~        따끈~
따끈~      따끈~        따끈~
2011.7.27 구글 오픈소스 블로그에 공식적으로 소개



따끈~      따끈~        따끈~
따끈~      따끈~        따끈~
따끈~      따끈~        따끈~
LevelDB는
  a fast and lightweight
  key/value DB library
                    입니다.
LevelDB는
  a fast and lightweight
  key/value DB library
                    입니다.
       NoSQL
Embedded DB
                  e.g. SQLite
LevelDB는
  a fast and lightweight
  key/value DB library
                      입니다.
LevelDB는
  a fast and lightweight
  NoSQL Embedded DB
  key/value DB library
                    입니다.
왜 만들었을까?
       뭐땀시
웹 애플리케이션용 DB 때문에
 웹 애플리케이션이 저장될 캐시를 결정.
 지금은 브라우저(크롬, FF, IE…)가 알아서 저장.
 오프라인 대비가 잘돼서 모바일에 좋다.
Web SQL Database는 탈락
       SQL은 웹 개발과 맞지 않다.
       ISO 표준이 존재하지만
       벤더마다 다양한 SQL문을 지원
IndexedDB 가 유력
    B-tree 기반 key/value 저장소
    key/value면 웹 애플리케이션이
    사용하기에 충분
LevelDB로
 IndexedDB를 구현하려고
맛만 살짝~

LevelDB 특징 보기
• Keys and values are arbitrary byte arrays.
• Data is stored sorted by key.
• The basic operations are Put(key,value),
  Get(key), Delete(key).
• Multiple changes can be made in one atomic
  batch.
• Users can create a transient snapshot to get
  a consistent view of data.
• Forward and backward iteration is supported
  over the data.
• Data is automatically compressed using the
  Snappy compression library.
• Keys and values are arbitrary byte arrays.
• Data is stored sorted by key.
• The basic operations are Put(key,value),
  Get(key), Delete(key).
• Multiple changes can be made in one atomic
  batch.
• Users can create a transient snapshot to get
  a consistent view of data.
• Forward and backward iteration is supported
  over the data.
• Data is automatically compressed using the
  Snappy compression library.
std::string value;
leveldb::Status s =
    db->Get(
        leveldb::ReadOptions(),
        key1,
        &value);

s = db->Put(
        leveldb::WriteOptions(),
        key2,
        value);

s = db->Delete(
        leveldb::WriteOptions(),
        key1);
• Keys and values are arbitrary byte arrays.
• Data is stored sorted by key.
• The basic operations are Put(key,value),
                  simple key/value store와 다른 특징.
  Get(key), Delete(key).
                  a persistent ordered map
• Multiple changes can be made in one atomic
                  custom comparison function 지원.
  batch.          range query가 싸겠다.
• Users can create a transient iteration이 가능 get
                  이런 특징 때문에 snapshot to
  a consistent view of data.
• Forward and backward iteration is supported
  over the data.
• Data is automatically compressed using the
  Snappy compression library.
// DB에 있는 모든 key/value 순회

leveldb::Iterator* it =
    db->NewIterator(leveldb::ReadOptions());

for (it->SeekToFirst();
     it->Valid(); it->Next())
{
    cout << it->key().ToString() << ": “ <<
        it->value().ToString() << endl;
}
• Keys and values are arbitrary byte arrays.
• Data is stored sorted by key.
• The basic operations are Put(key,value),
  Get(key), Delete(key).
• Multiple changes can be made in one atomic
  batch.
• Users can create a transient snapshot to get
  a consistent view of data.
• Forward and backward iteration is supported
  over the data.
• Data is automatically compressed using the
  Snappy compression library.
leveldb::ReadOptions options;
options.snapshot = db->GetSnapshot();

//…
// db를 업데이트한다.

leveldb::Iterator* iter = db->NewIterator(options);

// 업데이트를 하기 전 Shapshot DB를 읽는다.

delete iter;
db->ReleaseSnapshot(options.snapshot);
Fast를 붙일 만 해?
전체적으로 뛰어난 성능
다만 value 사이즈가 크면 성능 하락
 (value 사이즈가 100,000 byte일 때 성능)




구현상 key와 value를 적어도 두 번 복사하기 때문
정 리
• LevelDB는 NoSQL Embedded DB 이다.
• 웹 애플리케이션용 DB 때문에 만들었다.
  – IndexedDB
  – 다른 곳에도 더 사용하지 않을까?
• key로 정렬해서 저장한다.
• 전체적으로 뛰어난 성능
  – value 사이즈가 크면 성능 저하
References
LevelDB: A Fast Persistent Key-Value Store
http://nosql-database.org/
http://code.google.com/p/leveldb/
http://en.wikipedia.org/wiki/Embedded_database
http://kldp.org/node/123247
http://www.zdnet.co.kr/news/news_view.asp?artice_id=20110801100022
http://xguru.net/621
http://leveldb.googlecode.com/svn/trunk/doc/index.html
http://leveldb.googlecode.com/svn/trunk/doc/impl.html
http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html
Hacker News
LevelDB 간단한 소개
LevelDB 간단한 소개

More Related Content

What's hot

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Dvir Volk
 
The columnar roadmap: Apache Parquet and Apache Arrow
The columnar roadmap: Apache Parquet and Apache ArrowThe columnar roadmap: Apache Parquet and Apache Arrow
The columnar roadmap: Apache Parquet and Apache Arrow
DataWorks Summit
 

What's hot (20)

게임서버프로그래밍 #1 - IOCP
게임서버프로그래밍 #1 - IOCP게임서버프로그래밍 #1 - IOCP
게임서버프로그래밍 #1 - IOCP
 
게임서버프로그래밍 #2 - IOCP Adv
게임서버프로그래밍 #2 - IOCP Adv게임서버프로그래밍 #2 - IOCP Adv
게임서버프로그래밍 #2 - IOCP Adv
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
The columnar roadmap: Apache Parquet and Apache Arrow
The columnar roadmap: Apache Parquet and Apache ArrowThe columnar roadmap: Apache Parquet and Apache Arrow
The columnar roadmap: Apache Parquet and Apache Arrow
 
Modern API Security with JSON Web Tokens
Modern API Security with JSON Web TokensModern API Security with JSON Web Tokens
Modern API Security with JSON Web Tokens
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
중앙 서버 없는 게임 로직
중앙 서버 없는 게임 로직중앙 서버 없는 게임 로직
중앙 서버 없는 게임 로직
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
 
OMA LWM2M Tutorial by ARM to IETF ACE
OMA LWM2M Tutorial by ARM to IETF ACEOMA LWM2M Tutorial by ARM to IETF ACE
OMA LWM2M Tutorial by ARM to IETF ACE
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
 
API Security in a Microservice Architecture
API Security in a Microservice ArchitectureAPI Security in a Microservice Architecture
API Security in a Microservice Architecture
 
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRSReal World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
Software engineer가 되기 위한 여정
Software engineer가 되기 위한 여정Software engineer가 되기 위한 여정
Software engineer가 되기 위한 여정
 
NDC12_Lockless게임서버설계와구현
NDC12_Lockless게임서버설계와구현NDC12_Lockless게임서버설계와구현
NDC12_Lockless게임서버설계와구현
 
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Java EE vs Spring Framework
Java  EE vs Spring Framework Java  EE vs Spring Framework
Java EE vs Spring Framework
 

Viewers also liked

Google Protocol buffer
Google Protocol bufferGoogle Protocol buffer
Google Protocol buffer
knight1128
 
高性能并发网络服务器设计与实现
高性能并发网络服务器设计与实现高性能并发网络服务器设计与实现
高性能并发网络服务器设计与实现
ideawu
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments
종빈 오
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
종빈 오
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템
종빈 오
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기
종빈 오
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스
종빈 오
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜
종빈 오
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합
종빈 오
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개
종빈 오
 

Viewers also liked (20)

SnappyDB - NoSQL database for Android
SnappyDB - NoSQL database for AndroidSnappyDB - NoSQL database for Android
SnappyDB - NoSQL database for Android
 
NoSQL 간단한 소개
NoSQL 간단한 소개NoSQL 간단한 소개
NoSQL 간단한 소개
 
Google Protocol buffer
Google Protocol bufferGoogle Protocol buffer
Google Protocol buffer
 
cocos2d-xにおけるデータ管理
cocos2d-xにおけるデータ管理cocos2d-xにおけるデータ管理
cocos2d-xにおけるデータ管理
 
高性能并发网络服务器设计与实现
高性能并发网络服务器设计与实现高性能并发网络服务器设计与实现
高性能并发网络服务器设计与实现
 
SSDB(LevelDB server) vs Redis
SSDB(LevelDB server) vs RedisSSDB(LevelDB server) vs Redis
SSDB(LevelDB server) vs Redis
 
Hdf5 intro
Hdf5 introHdf5 intro
Hdf5 intro
 
Hdf5
Hdf5Hdf5
Hdf5
 
Leveldb background
Leveldb backgroundLeveldb background
Leveldb background
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개
 
7. Key-Value Databases: In Depth
7. Key-Value Databases: In Depth7. Key-Value Databases: In Depth
7. Key-Value Databases: In Depth
 
Redis on NVMe SSD - Zvika Guz, Samsung
 Redis on NVMe SSD - Zvika Guz, Samsung Redis on NVMe SSD - Zvika Guz, Samsung
Redis on NVMe SSD - Zvika Guz, Samsung
 

Similar to LevelDB 간단한 소개

Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
cranbe95
 
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
Seok-joon Yun
 
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
sung ki choi
 

Similar to LevelDB 간단한 소개 (20)

[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)
[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)
[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)
 
Node.js DBMS short summary
Node.js DBMS short summaryNode.js DBMS short summary
Node.js DBMS short summary
 
Firebase for web (웹개발을 위한 파이어베이스) 3 Real-Time Database
Firebase for web (웹개발을 위한 파이어베이스) 3 Real-Time DatabaseFirebase for web (웹개발을 위한 파이어베이스) 3 Real-Time Database
Firebase for web (웹개발을 위한 파이어베이스) 3 Real-Time Database
 
CouchDB - Introduction - Korean
CouchDB - Introduction - KoreanCouchDB - Introduction - Korean
CouchDB - Introduction - Korean
 
토이 프로젝트를 위한 속성 RDB(MySQL) 스터디 1
토이 프로젝트를 위한 속성 RDB(MySQL) 스터디 1토이 프로젝트를 위한 속성 RDB(MySQL) 스터디 1
토이 프로젝트를 위한 속성 RDB(MySQL) 스터디 1
 
Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
Ndc2011 성능 향상을_위한_데이터베이스_아키텍쳐_구축_및_개발_가이드
 
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
 
Bottled water 요약 설명 20151114
Bottled water 요약 설명 20151114Bottled water 요약 설명 20151114
Bottled water 요약 설명 20151114
 
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)
 
Portfolio
PortfolioPortfolio
Portfolio
 
Apache hive
Apache hiveApache hive
Apache hive
 
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQL
 
steeleye Replication
steeleye Replication steeleye Replication
steeleye Replication
 
Elastic Stack & Data pipeline
Elastic Stack & Data pipelineElastic Stack & Data pipeline
Elastic Stack & Data pipeline
 
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
 
DB Monitoring 개념 및 활용 (박명규)
DB Monitoring 개념 및 활용 (박명규)DB Monitoring 개념 및 활용 (박명규)
DB Monitoring 개념 및 활용 (박명규)
 
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
[아꿈사/111105] html5 9장 클라이언트측 데이터로 작업하기
 

More from 종빈 오

[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
종빈 오
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우
종빈 오
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline
종빈 오
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당
종빈 오
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary
종빈 오
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
종빈 오
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명
종빈 오
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
종빈 오
 
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
종빈 오
 
[TAOCP] 1.2.1 수학적 귀납법
[TAOCP] 1.2.1 수학적 귀납법[TAOCP] 1.2.1 수학적 귀납법
[TAOCP] 1.2.1 수학적 귀납법
종빈 오
 
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation	[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
종빈 오
 
2010 아꿈사 오전반 포스트모템
2010 아꿈사 오전반 포스트모템2010 아꿈사 오전반 포스트모템
2010 아꿈사 오전반 포스트모템
종빈 오
 
[shaderx6]8.2 3d engine tools with c++cli
[shaderx6]8.2 3d engine tools with c++cli[shaderx6]8.2 3d engine tools with c++cli
[shaderx6]8.2 3d engine tools with c++cli
종빈 오
 
ManagingHumans/chap1~6
ManagingHumans/chap1~6ManagingHumans/chap1~6
ManagingHumans/chap1~6
종빈 오
 
아꿈사 매니저 인사
아꿈사 매니저 인사아꿈사 매니저 인사
아꿈사 매니저 인사
종빈 오
 
[페차쿠차] 아꿈사 반장 하기
[페차쿠차] 아꿈사 반장 하기[페차쿠차] 아꿈사 반장 하기
[페차쿠차] 아꿈사 반장 하기
종빈 오
 
xUnitTestPattern/chapter7
xUnitTestPattern/chapter7xUnitTestPattern/chapter7
xUnitTestPattern/chapter7
종빈 오
 

More from 종빈 오 (20)

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기
 
적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0
 
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
 
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
[TAOCP] 1.3.1 MIX 설명, 짝수 연습문제 풀이
 
[TAOCP] 1.2.1 수학적 귀납법
[TAOCP] 1.2.1 수학적 귀납법[TAOCP] 1.2.1 수학적 귀납법
[TAOCP] 1.2.1 수학적 귀납법
 
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation	[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
 
2010 아꿈사 오전반 포스트모템
2010 아꿈사 오전반 포스트모템2010 아꿈사 오전반 포스트모템
2010 아꿈사 오전반 포스트모템
 
[shaderx6]8.2 3d engine tools with c++cli
[shaderx6]8.2 3d engine tools with c++cli[shaderx6]8.2 3d engine tools with c++cli
[shaderx6]8.2 3d engine tools with c++cli
 
ManagingHumans/chap1~6
ManagingHumans/chap1~6ManagingHumans/chap1~6
ManagingHumans/chap1~6
 
아꿈사 매니저 인사
아꿈사 매니저 인사아꿈사 매니저 인사
아꿈사 매니저 인사
 
[페차쿠차] 아꿈사 반장 하기
[페차쿠차] 아꿈사 반장 하기[페차쿠차] 아꿈사 반장 하기
[페차쿠차] 아꿈사 반장 하기
 
xUnitTestPattern/chapter7
xUnitTestPattern/chapter7xUnitTestPattern/chapter7
xUnitTestPattern/chapter7
 
적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기
 

LevelDB 간단한 소개

  • 1. LevelDB by ohyecloudy homepage : http://ohyecloudy.com twitter : @ohyecloudy 아꿈사 : http://cafe.naver.com/architect1.cafe 2011.08.06
  • 2. 아~ 이런 게 있구나 본 발표 목적 좀 더 쉽게 얘기하자면 ‘깊이가 없다’입니다.
  • 3. 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 2011.7.27 구글 오픈소스 블로그에 공식적으로 소개 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 따끈~ 따끈~
  • 4. LevelDB는 a fast and lightweight key/value DB library 입니다.
  • 5. LevelDB는 a fast and lightweight key/value DB library 입니다. NoSQL
  • 6. Embedded DB e.g. SQLite LevelDB는 a fast and lightweight key/value DB library 입니다.
  • 7. LevelDB는 a fast and lightweight NoSQL Embedded DB key/value DB library 입니다.
  • 9. 웹 애플리케이션용 DB 때문에 웹 애플리케이션이 저장될 캐시를 결정. 지금은 브라우저(크롬, FF, IE…)가 알아서 저장. 오프라인 대비가 잘돼서 모바일에 좋다.
  • 10. Web SQL Database는 탈락 SQL은 웹 개발과 맞지 않다. ISO 표준이 존재하지만 벤더마다 다양한 SQL문을 지원
  • 11. IndexedDB 가 유력 B-tree 기반 key/value 저장소 key/value면 웹 애플리케이션이 사용하기에 충분
  • 14. • Keys and values are arbitrary byte arrays. • Data is stored sorted by key. • The basic operations are Put(key,value), Get(key), Delete(key). • Multiple changes can be made in one atomic batch. • Users can create a transient snapshot to get a consistent view of data. • Forward and backward iteration is supported over the data. • Data is automatically compressed using the Snappy compression library.
  • 15. • Keys and values are arbitrary byte arrays. • Data is stored sorted by key. • The basic operations are Put(key,value), Get(key), Delete(key). • Multiple changes can be made in one atomic batch. • Users can create a transient snapshot to get a consistent view of data. • Forward and backward iteration is supported over the data. • Data is automatically compressed using the Snappy compression library.
  • 16. std::string value; leveldb::Status s = db->Get( leveldb::ReadOptions(), key1, &value); s = db->Put( leveldb::WriteOptions(), key2, value); s = db->Delete( leveldb::WriteOptions(), key1);
  • 17. • Keys and values are arbitrary byte arrays. • Data is stored sorted by key. • The basic operations are Put(key,value), simple key/value store와 다른 특징. Get(key), Delete(key). a persistent ordered map • Multiple changes can be made in one atomic custom comparison function 지원. batch. range query가 싸겠다. • Users can create a transient iteration이 가능 get 이런 특징 때문에 snapshot to a consistent view of data. • Forward and backward iteration is supported over the data. • Data is automatically compressed using the Snappy compression library.
  • 18. // DB에 있는 모든 key/value 순회 leveldb::Iterator* it = db->NewIterator(leveldb::ReadOptions()); for (it->SeekToFirst(); it->Valid(); it->Next()) { cout << it->key().ToString() << ": “ << it->value().ToString() << endl; }
  • 19. • Keys and values are arbitrary byte arrays. • Data is stored sorted by key. • The basic operations are Put(key,value), Get(key), Delete(key). • Multiple changes can be made in one atomic batch. • Users can create a transient snapshot to get a consistent view of data. • Forward and backward iteration is supported over the data. • Data is automatically compressed using the Snappy compression library.
  • 20. leveldb::ReadOptions options; options.snapshot = db->GetSnapshot(); //… // db를 업데이트한다. leveldb::Iterator* iter = db->NewIterator(options); // 업데이트를 하기 전 Shapshot DB를 읽는다. delete iter; db->ReleaseSnapshot(options.snapshot);
  • 23. 다만 value 사이즈가 크면 성능 하락 (value 사이즈가 100,000 byte일 때 성능) 구현상 key와 value를 적어도 두 번 복사하기 때문
  • 25. • LevelDB는 NoSQL Embedded DB 이다. • 웹 애플리케이션용 DB 때문에 만들었다. – IndexedDB – 다른 곳에도 더 사용하지 않을까? • key로 정렬해서 저장한다. • 전체적으로 뛰어난 성능 – value 사이즈가 크면 성능 저하
  • 26. References LevelDB: A Fast Persistent Key-Value Store http://nosql-database.org/ http://code.google.com/p/leveldb/ http://en.wikipedia.org/wiki/Embedded_database http://kldp.org/node/123247 http://www.zdnet.co.kr/news/news_view.asp?artice_id=20110801100022 http://xguru.net/621 http://leveldb.googlecode.com/svn/trunk/doc/index.html http://leveldb.googlecode.com/svn/trunk/doc/impl.html http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html Hacker News