• 検索結果がありません。

QConTokyo2013_DocDatabase_agile_atWare

N/A
N/A
Protected

Academic year: 2021

シェア "QConTokyo2013_DocDatabase_agile_atWare"

Copied!
39
0
0

読み込み中.... (全文を見る)

全文

(1)

ドキュメント型NoSQLによる

Agileなモデリング開発

北野 弘治, 河村 康爾

(2)

北野 Nick 弘治

スピーカ紹介

福井県生まれ

Agile, TDD, NoSQL, Server side Java, Android, AWS, LeanStartup

,

,

(3)

河村 Sebastian 康爾

• Couchbase JP 発起人

https://groups.google.com/forum/?fromgroups#!forum/couchbase-jp

• Couchbase, Inc. 認定

– Couchbase Server トレーナー

– Team 8091 メンバ

• Cloudera認定 Hadoop 管理者・開発者

• OSSを利用したシステム開発

スピーカ紹介

(4)

株式会社 アットウェア

(5)

ドキュメント型NoSQLによる

Agileなモデリング開発

• ドキュメント型NoSQL?

• プロジェクト: couchbase-todo

– iteration 0, 1, 2, 3

– アーキテクチャ解説

– データモデリングプラクティス

• まとめ

Agenda

(6)

NoSQLへ移⾏する動機?

ドキュメント型

NoSQL?

柔軟性

の欠如

/堅い

スキー

(7)

F1マシンをRDBMSに格納

http://www.slideshare.net/Couchbase/opening-session-14492845

(8)

F1マシンをドキュメントデータベースに格納

http://www.slideshare.net/Couchbase/opening-session-14492845

(9)

NoSQLカタログ

(10)

Couchbase Server?

優れたスケーラビリティ

一貫したハイパフォーマンス

24x365 常に利⽤可能

柔軟なデータモデル

(11)

ドキュメント型NoSQLによる

Agileなモデリング開発

(12)

-This slide is based on the template downloaded from “The Agile Warrior”.

http://agilewarrior.wordpress.com/2011/02/06/blank-agile-inception-deck-template/

The Agile Inception Deck

couchbase-todo

(13)

This slide is based on the template downloaded from “The Agile Warrior”.

http://agilewarrior.wordpress.com/2011/02/06/blank-agile-inception-deck-template/

couchbase-todo

sponsors: atWare, Inc.

(14)

This slide is based on the template downloaded from “The Agile Warrior”.

http://agilewarrior.wordpress.com/2011/02/06/blank-agile-inception-deck-template/

Why are we here?

QCon Tokyoで発表 #1

ドキュメントデータベースの普及 #2

社内情報共有のソリューション #3

業務で使える社内情報共有基盤

(15)

This slide is based on the template downloaded from “The Agile Warrior”.

http://agilewarrior.wordpress.com/2011/02/06/blank-agile-inception-deck-template/

The elevator pitch

簡易なタスク管理、情報共有基盤

容易な情報記⼊、モダンなUI

要求の変化に柔軟に対応可能、高い拡張性

適度に高度なドキュメントデータベースの

サンプルアプリケーション

iteration 0

(16)

アーキテクチャ

クライアント: HTML, CSS, Javascript

サーバサイド: Javascript

データベース: JSONドキュメントストア 全⽂検索エンジン

(17)

githubで公開

https://github.com/ijokarumawak/couchbase-todo

(18)

iteration - 1

プロダクトオーナ

チームメンバ

セバスチャン、とりあえず

Markdownでメモ

を残せ

るようにしたいんだ。

OK, ニック!

(19)
(20)

doc.type == ‘project’

iteration 1

{

"type": "project",

"name": "プロジェクト1",

"desc": "プロジェクトの説明",

“body”: “詳細な説明は

**Markdown**で⼊⼒できる。" }

DocumentID: P1

各ドキュメントは”type”で型を定義

(21)

doc.type == ‘task’

iteration 1

DocumentID: 0

{

"type": "task",

"subject": "タスクの登録機能",

"desc": "新規のタスクを登録",

"startDate": "2013/04/05",

"endDate": "2013/04/05",

“body”: “タスク内容の⼊⼒は**Markdown**で⾏えること。

¥r¥n¥r¥nタスクドキュメントのIDは

アトミックな整数カウンタ

利用して発番している。" }

(22)

Demo!

(23)

iteration - 2

プロダクトオーナ

チームメンバ

セバスチャン、タスクが山

ほどあるんだ。

プロジェク

トごとに状況を把握

したい。

OK, ニック!

タスクの進捗

を分かりやす

く表示してくれないか。

(24)
(25)

doc.type == ‘task’

iteration 2

{

"type": "task",

"project": "P1",

"subject": "タスク/プロジェクトの関連",

"status": "closed",

"desc": "トランザクションを意識しない関連の追加",

"startDate": "2013/04/08",

"endDate": "2013/04/08",

"body": "ドキュメントデータベースでは…"

}

タスクが所属するプロジェクトのID

ステータス管理

(26)

プロジェクト ⇒ タスク

function (doc, meta) {

if("task" === doc.type) {

emit(

doc.project

, {

subject: doc.subject,

status:

doc.status ? doc.status : 'open'

});

}

}

iteration 2

未設定時のデフォルト

SQLのWHERE句に相当

(27)

プロジェクトのサマリ表示

• reduce()関数により

– プロジェクト、ステータスごとのカウントを集計

– かつ、プロジェクトの概要を同時に取得

(28)

Demo!

(29)

iteration - 3

プロダクトオーナ

チームメンバ

セバスチャン、Markdown

の⼊⼒だけど、

プレビュー

機能

があるといいな。

OK, ニック!

他のメンバとも共有できる

ように

ユーザ管理機能

もつ

けて欲しい。

コメント

で活

発な議論をしたい。

あと、簡単に情報を

検索

たいんだ。セバスチャン、

できるか?

(30)
(31)

doc.type == ‘user’

{"type": "user",

"password": "password",

"createdAt": 1366558849178,

"id": "kawamura"}

iteration 3

あくまで説明用

本来はHash + SALT!

(32)

doc.type == ‘comment’

{

"body": "コメントを追加。",

"task": 3

,

"by": "kawamura",

"type": "comment",

"createdAt": 1366559954099

}

iteration 3

プロジェクト:タスク

の関連と同様

(33)

doc.type == ‘taskRev’

DOCID: 5

{

"type": "task",

"savedBy": "kawamura",

"project": "DOC",

"subject": "タスク変更履歴の記録",

"status": "closed",

"body": "タスク変更履歴では…。",

"rev": 1,

"createdAt": 1366559737859,

"updatedAt": 1366564407422,

"revs": [

{

"rev": 0,

"status": "open",

"savedBy": "kawamura",

"timestamp": 1366559737859

} ]}

DOCID: 5-0

{

"type": "taskRev",

"savedBy": "kawamura",

"project": "DOC",

"subject": "タスク変更履歴の記録",

"status": "open",

"body": "タスク変更履歴ではコメント

とは異なり、変更履歴のIDをタスク本

体に内包している。タスクを変更した

際にコピーを⽣成することで変更履歴

を管理している。",

"rev": 0,

"createdAt": 1366559737859

}

iteration 3

(34)

全⽂検索

iteration 3

(35)

Demo!

(36)

おさらい

ユーザ

type: user

passwordなど

コメント

type: comment

task: タスクID

プロジェクト

type: project

nameなど

タスク履歴

type: taskRev

project: プロジェクトID

status: open〜close

rev: リビジョンID

タスク

type: task

project: プロジェクトID

status: open〜close

revs: [0, 1, … n]

(37)

まとめ

• ドキュメントデータベース活用によって

– 事前にスキーマを定義することなく、変化する要件

柔軟に対応

することができる

– データベースだけではダメで、アプリケーション側、

UI部分も柔軟に拡張できる必要がある

• 各ドキュメントをリッチにしていきたくなる

– ⇒

意欲的に開発

できる!

– ⇒ お客さん喜ぶ

– ⇒

$$$!

(38)
(39)

ご清聴ありがとうございました

続きはブース、懇親会で!!

参照

関連したドキュメント

Gauss’ functional equation (used in the study of the arithmetic-geometric mean) is generalized by replacing the arithmetic mean and the geometric mean by two arbi- trary means..

[15] , Growth properties and sequences of zeros of analytic functions in spaces of Dirichlet type, to appear in Journal of the Australian Mathematical Society..

As a consequence its probability distribution is expressed in terms of derivatives of Mittag- Leffler functions, while the density of the k-th event waiting time is a

As follows from the proof, the relations (4.17) hold for the diagonal reduction algebra for an arbitrary reductive Lie algebra: the images of the generators, corresponding to the

In the current paper we provide an atomic decomposition in the product setting and, as a consequence of our main result, we show that

Meijer, On orthogonal polynomials with respect to an inner product involving derivatives: zeros and recurrence relations, Indag.. P6rez Riera

In particular, in 1, Pachpatte proved some new inequalities similar to Hilbert’s inequality 11, page 226 involving series of nonnegative terms.. The main purpose of this paper is

In this section, the degenerate Apostol–type Hermite polynomials are introduced and certain result for these polynomials are derived..