getting started with cloudant dbaas(korean)

12
Getting Started with Cloudant DBaaS 정정정 ([email protected])

Upload: -jerry-jeong

Post on 27-Nov-2014

845 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Getting started with Cloudant DBaaS(Korean)

Getting Started with Cloudant DBaaS

정명훈 ([email protected])

Page 2: Getting started with Cloudant DBaaS(Korean)

Cloudant DBaaS

2

• DBaaS 란 ?

Database As A Service 의 약자로서 , DB 를 Cloud 형태로 하드웨어는 물론 설치부터 운영 , 모니터링까지 하나의 서비스로 제공하는 솔루션을 의미합니다 . DBaaS 를 사용하는 유저는 위와 같은 고민을 할 필요 없이 단지 DB API 를 이용해 Client 프로그램만 개발하면 됩니다 .

• Cloudant DBaaS

Cloudant 웹사이트 (http://www.cloudant.com) 에서 가입할 수 있으며 , 웹사이트를 통해 데이터를 조회하거나 DB 를 생성할 수도 있습니다 .

• Tutorialhttp://cloudantkug.wordpress.com/2013/07/02/tutorialno1-user-registration/

Page 3: Getting started with Cloudant DBaaS(Korean)

사용자 등록

3

• Cloudant 메인 사이트 (http://www.cloudant.com) 의 우측 상단에 “ Sign Up” 버튼을 통해서 가입 페이지에 접근할 수 있습니다 .

Page 4: Getting started with Cloudant DBaaS(Korean)

사용자 등록

4

• “Sign Up” 버튼을 클릭하면 계정 등록 페이지로 이동합니다 .

Page 5: Getting started with Cloudant DBaaS(Korean)

사용자 등록

5

• “Sign Up” 페이지에 등록폼을 완성하고 “ I agree, sign me up” 버튼을 클릭하면 등록은 완료 됩니다 .

• 계정 등록에 입력 정보• Username, Password

• First name, Last name

• Company

• Username

• Email

• Select a location for your data

• 계정 등록을 위해서는 위와 같은 정보를 입력해야 합니다 . “User name” 의 경우 알파벳 대소문자 , 숫자 , 대쉬(-) 만을 허용합니다 . “Select a location for your data” 의 경우 어떤 Multitenancy 클러스터에 내 데이터를 저장할 것인가를 선택하는 단계입니다 . 우리가 선택할 수 있는 클러스터는 다음과 같습니다 .

• 여기에서 선택한 클러스터는 나중에 변경 가능하며 , 데이터가 입력된 후에도 마이그레이션 개념으로 클러스터 변경을 지원합니다 .

Page 6: Getting started with Cloudant DBaaS(Korean)

Cloudant 웹사이트의 주요 페이지 ( 기능 )

6

• 계정 등록 단계가 완료되면 “ Welcome” 페이지로 이동합니다 . 상단에 메뉴를 통해서 “ Databases”, “Stats”, “Virtual Hosts”, “Account” 페이지로 이동 가능합니다 .

• Welcome 페이지에서 기본적인 메뉴얼과 사용법 가이드 링크를 확인할 수 있습니다 .

Page 7: Getting started with Cloudant DBaaS(Korean)

Databases 페이지

7

• DB( 일반 RDB 의 테이블에 해당 ) 조작과 관련된 대부분의 작업을 이 페이지에서 할 수 있습니다 . DB 를 만들고 , DB 목록을 조회할 수 있습니다 . 데이터베이스 별로 검색 권한 설정 , Document(Document DB 에서는 레코드를 Document 라고 함 ) 를 조작할 수 있습니다 . 또한 Cloudant 를 사용하는 다른 계정에 데이터베이스 별로 Read, Create, Write, Admin 권한을 설정할 수 있습니다 .

여기 새로운 DB 명을 넣고 생성할 수 있음

Page 8: Getting started with Cloudant DBaaS(Korean)

Virtual Hosts 페이지

8

• Cloudant 에 자신만의 domain 을 설정할 수 있습니다 .

Page 9: Getting started with Cloudant DBaaS(Korean)

Account 페이지

9

• Cloudant 의 클러스터 위치를 변경하거나 사용자 정보를 수정할 수 있습니다 . 과금을 위한 카드 등록 및 사용량 리포트를 확인 할 수 있습니다 .

Page 10: Getting started with Cloudant DBaaS(Korean)

과금 리포트

10

• 다음과 같은 과금 리포트를 실시간 제공합니다 .

Page 11: Getting started with Cloudant DBaaS(Korean)

REST API 를 이용한 DB 액세스

11

• HTTP 기반의 REST API 는 다양한 언어 라이브러리가 있어 쉽게 사용이 가능합니다 .

• 그 중에서도 Command Line 에서 쉽게 사용할 수 있는 curl 이라는 유틸리티가 상당히 편리합니다 . (http://curl.haxx.se/)

• curl 을 이용한 Cloudant DBaaS 액세스 방법은 다음과 같습니다 .

Cloudant 버전 확인 : curl http://userid.cloudant.com

새로운 DB 생성 : curl -X PUT http://userid:[email protected]/<db 명 >

전체 DB 조회 : curl http://userid:[email protected]/_all_dbs

특정 DB 의 전체 레코드 조회 : curl http://userid:[email protected]/<db 명 >/_all_docs

새로운 레코드 생성 : curl -X POST http://userid:[email protected]/<db 명 > -H "Content-type: application/json" -d "{\"abc\": 1}“

• 더 많은 내용은 다음을 참고하세요 .

• https://cloudant.com/wp-content/uploads/Cloudant-API-Reference.pdf

Page 12: Getting started with Cloudant DBaaS(Korean)

언어 별 라이브러리를 이용한 DB 액세스

12

• 오른쪽 표와 같은 다양한 언어 별 API 바인딩을 제공합니다 .

• Java 의 경우에는 Ektorp 가 가장 많이 사용됩니다 .

• 다운로드https://github.com/helun/Ektorp

• Tutorial

http://www.ektorp.org/tutorial.html

• Maven 을 사용하면 빌드하기 편리http://mvnrepository.com/artifact/org.ektorp/org.ektorp