Developers Summit 2015 【19-B-L】Cloudant (Japanese)

24
DevOpsの究極の形!? クラウドで始める ドキュメント・データベース活用のポイント。 日本アイ・ビー・エム株式会社 アナリティクス事業部 インフォメーション・アーキテクト 野間 愛一郎

Transcript of Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Page 1: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

DevOpsの究極の形!?クラウドで始めるドキュメント・データベース活用のポイント。

日本アイ・ビー・エム株式会社アナリティクス事業部インフォメーション・アーキテクト 野間 愛一郎

Page 2: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloud

Big Data

Mobile

Social

Page 3: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

BigData

マシンログ、センサーデータ地理情報、個人的な情報ソーシャル

CloudComputing

集中・共有から分散・共有へ

BigUser

多数のユーザー大量の同時アクセスユーザー動的な利用形態

Page 4: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudantをひとことで言うと

Page 5: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Key-Value Document

BigTable Graph

NoSQL Database Types

Page 6: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

ドキュメント指向型の特徴

・ドキュメントをユニークIDですぐに特定

・データ設計不要、スキーマレス

・ニュースサイトやブログ記事

・Webアプリケーションに最適

{

"zipcode": "1038510",

"address": {

"prefecture": "東京都",

"city": "中央区",

"town": "日本橋箱崎町",

"street_address": "19−21",

"site": "日本アイ・ビー・エム 株式会社 箱崎事業所"

},

"yomi": {

"site": "ニホンアイビ-エムハコザキジギヨウシヨ"

}

}

Page 7: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

適用エリアユーザー生成コンテンツ

ソーシャル、ソーシャル・ゲーム

地理情報

SNS

ブログ

M2Mのバックエンド

機械が出す様々な形式の連続データを格納・集計・分析

地理情報

バックオフィス系

ログデータ

ユーザークリック履歴・画面遷移履歴

通信記録

JSONClouda

nt

HTTP

JSON

HTTP

JSON

HTTP

JSON

HTTP

JSON

HTTPJSON

HTTP

Page 8: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudant Beginnings……

8

Page 9: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudant概要

• Operational Data Store

• NoSQL ドキュメント・データベース

• シンプルな HTTP Restful API

• 標準機能:

• レプリケーション、クライアントとの同期機能

• MapReduce

• 全文検索機能

•地理情報関数

• マルチテナントおよび個別のクラスターを提供

• 運用管理、開発用のダッシュボード

• Powered by Apache CouchDB、Dynamo Clustering、Lucene

Search などなど

9

Page 10: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

CloudantによるNoSQLベースのDBaaS

Indexed

JSON

Storage

複数のロケーションへの負荷分散

アプリケーション・レイヤー / ブラウザー / モバイル・アプリケーション

REST (HTTPS)

IBM SoftLayer、Rackspace、Microsoft Azure、AWS

Cloudant JSON API

JSON

CRUD

複数マスター間のレプリ

ケーション

デバイスの同期

Lucene

による検索

2Dおよび3Dの地理空間データ

MapReduceモニタリング

セキュリティー

IOの制御

Cloudantの開発者と運用担当者がユーザーのシステムを24x7で管理

Page 11: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

DBaaSのメリット

サービス内容を保証不確定要素を排除 リスクを最小化生産性を最大化

ハードウェア

ソフトウェア

管理タスク

システム設計

ソフトウェア

管理タスク

システム設計

システム設計

自社構築 ホスティング DBaaS

不確定要素、オーバーヘッド、リスク

Page 12: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

1

2

Cloudant クラスター可用性とスケーラビリティ

ノード追加によるスケールアウトデータはノートに対し自動的にシャーディングされる

すべてのデータを3重化マスター – マスター型で構成され、ノード障害時もRead/Write可能

データセンター間のレプリケーション

ロードバランシングを行い、

近くの地域のクラスターに接続される

Page 13: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

13

ローカル・ストレージ

ローカル・ストレージ

サーバーとローカル・デバイスにデータを保存

データの同期プロセスとローカル・ストレージの管理をサポートするためにネイティブのライブラリーを提供

Cloudantからデータのプッシュとプルを行うことによって、複数デバイス間のデータを同期

モバイルアプリケーションとの連携①柔軟なデータの保存とアクセスを実現

Page 14: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

14

ローカル・ストレージ

ネットワークに接続できない場合は、ローカル・ストレージからの読み取り処理と書き込み処理を提供

接続が復旧すると、サーバーにデータの同期が行われ、同じデータソースに接続するその他のデバイスのデータの同期を実施

修正履歴のレプリケーションによって、データの一貫性を維持

モバイルアプリケーションとの連携に②恒常的に可用性を実現

Page 15: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudantのポジション

NoSQL

SQL

on-premises Cloud

BigInsights

MongoDB

CouchDB

CouchBase

Cassandra

Riak

DB2

Netezza

Informix

PDOASQL Server

Oracle

MySQL

PostgreSQL

BLU on

Cloud

dashdb

Amazon Aurora

AWS SDB

AWS RDS

Other SQL

Amazon -

DynamoDB

ManagedDBaaS

On-premise

BigInsights

Page 16: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

無償でスタート出来ます。是非遊んでみてください

cloudant.com

bluemix.net

Page 17: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudantを利用するには

Step 1 Step 2 Step 3

https://<username>.cloudant.com

ヘ完了!

Page 18: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Bluemixからもどうぞ

Page 19: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

1

9

GET /<database>/<doc_id>

PUT /<database>/<doc_id>

PUT /<database>/<doc_id>/<attachment>

HTTP RESTful API

Page 20: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

基本API

© 2014 IBM Corporation

https://<username>.cloudant.com…

/_all_dbs Get all databases for a user

/<database> Create a database or post a

new document

/<database>/_all_docs Get all docs in a database

(a.k.a. “Primary Index”)

/<database>/_bulk_docs CUD documents in bulk

/<database>/<doc._id> CRUD document by ID

/<database>/<doc._id>/<attachment> CRUD document attachment

Page 21: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

cURL を利用した操作(1)

© 2014 IBM Corporation

GET –データベース(クラスター)情報

GET –所有するデータベースリスト

PUT – Create a New Database

Page 22: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

cURL を利用した操作(2)

© 2014 IBM Corporation

POST – Create / Update

GET – All Documents

DELETE – Delete a Document

Page 23: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Cloudantで利用できるAPI

© 2014 IBM Corporation

JSON

DocumentsPrimary Index

Secondary

IndicesSearch

Create

Read

Update

Delete

デフォルトで作成 キーインデックス

MapReduce

集計、group by

など 地理情報

テキスト検索機能

Page 24: Developers Summit 2015 【19-B-L】Cloudant (Japanese)

Build More,

Grow More,

Sleep More

ぜひ遊んでみてください!

https://cloudant.com/sign-up/