Your SlideShare is downloading. ×
0
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Couch Db.0.9.0.Pub

1,370

Published on

CouchDB 0.9.0 Overview in Japanese

CouchDB 0.9.0 Overview in Japanese

1 Comment
2 Likes
Statistics
Notes
  • I liked the images used in this slide. Cheers!

    http://www.bathroomsinkconsoles.net/
    http://www.bathroomsinkconsoles.net/category/bathroom-sink-consoles/
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
1,370
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
1
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Apache CouchDB 0.9.0 リリース記念資料 id:yssk22 http://d.hatena.ne.jp/yssk22
  • 2. CouchDB復習
  • 3. 1. ドキュメント指向
  • 4. JSONのデータを ためる入れ物
  • 5. { quot;_idquot; : quot;文書1quot; quot;_revquot; : quot;リビジョンquot; quot;titlequot; : quot;CouchDBについてquot; quot;Contentquot; : quot;いろいろquot; }
  • 6. 2. Web+DB
  • 7. REST
  • 8. HTTP
  • 9. 3. 非リレーショナル
  • 10. MapReduce := SQLめんどう
  • 11. HTTP Request HTTP map HTTP Response reduce
  • 12. 4. Replication
  • 13. http://couch.io/CouchDB-Intro-EU.pdf のP.32からみるとおもしろい
  • 14. 0.9.0の話
  • 15. Changes (公式より) • Modular configuration. • Performance enhancements for document and view access. • More resilient replication process. • Replication streams binary attachments. • Administrator role and basic authentication. • Document validation functions in design documents. • Show and list functions for rendering documents and views as developer controlled content-types. • External process server module. • Attachment uploading from Futon. • Etags for views, lists, shows, document and attachment requests. • Miscellaneous improvements to build, system integration, and portability.
  • 16. 目玉?
  • 17. Show and list functions for rendering documents and views as developer controlled content-types.
  • 18. Blogアプリで考える。
  • 19. タイトル、タグ、 内容 文書のIDは日付で。
  • 20. アプリケーション サーバー丌要論
  • 21. 特に RESTful/RESTonlyな アプリケーションは CouchDBでOK
  • 22. RESTful Rails Controller#index Controller#show Controller#new Controller#craete Controller#update Controller#edit Controller#destroy
  • 23. RESTful Rails Controller#index Controller#show Controller#new 省略 Controller#craete Controller#update Controller#edit Controller#destroy
  • 24. JavaScriptで Renderingを書く
  • 25. Show
  • 26. RESTful Rails Controller#index Controller#show Controller#new Controller#craete Controller#update Controller#edit Controller#destroy
  • 27. { quot;_idquot;: quot;_design/testquot;, quot;_revquot;: quot;9-938762531quot;, quot;languagequot;: quot;javascriptquot;, quot;viewsquot;: { }, quot;showsquot;: { quot;displayquot;: quot;(function (doc, req) {if (doc) {return ¥quot;<h1>¥quot; + doc.title + ¥quot;</h1><div>¥quot;+ doc.content + ¥quot;</div>¥quot;;} else {if (req.docId) {return ¥quot;New World¥quot;;} else {return ¥quot;Empty World¥quot;;}}})quot; }
  • 28. GET DB デザインドキュメントのID /my_blog/_design/test/_show/ display/2009_04_20_1 shows のキー レンダリングするドキュメントのID
  • 29. <h1>今日は疲れた </h1><div><p>CouchDBの機能 調査をしていたけどドキュメントがな い</p></div>
  • 30. Restful Rails でいうと ころの、show をやって くれる
  • 31. IDにマッチする文書が 見つからなければ HTML Formを返すとか
  • 32. Controller#new, Controller#edit 相当はできる!
  • 33. list
  • 34. RESTful Rails Controller#index Controller#show Controller#new Controller#craete Controller#update Controller#edit Controller#destroy
  • 35. { quot;_idquot;: quot;_design/testquot;, quot;_revquot;: quot;9-938762531quot;, quot;languagequot;: quot;javascriptquot;, quot;viewsquot;: { }, quot;listsquot;: { quot;simplequot;: quot;(function (head, row, req, row_info) {if (row) {return {body: ¥quot;<h1>¥quot; + row.key + ¥quot;</h1>¥quot; + ¥quot;<h2>¥quot; + row.value.title + ¥quot;</h2>¥quot; + ¥quot;<div>¥quot; + row.value.content + ¥quot;</div>¥quot;}; } else if (head) {return {body: ¥quot;<h1>My Blog (¥quot; + head.total_rows + ¥quot;件のエントリ)</h1>¥quot;};} else {return {body: ¥quot;</ul>¥quot; + ¥quot;<p>前へ: ¥quot; + (row_info ? row_info.first_key : ¥quot;¥quot;) + ¥quot; 次 へ: ¥quot; + (row_info ? row_info.prev_key : ¥quot;¥quot;) + ¥quot;</p>¥quot;};}})quot; } }
  • 36. simple: function (head, row, req, row_info) { 本体 if (row) { return { body: quot;<h1>quot; + row.key + quot;</h1>quot; + quot;<h2>quot; + row.value.title + quot;</h2>quot; + quot;<div>quot; + row.value.content + quot;</div>quot; }; } else if (head) { ヘッダ return { body: quot;<h1>My Blog (quot; + head.total_rows + quot;件のエントリ)</h1>quot;}; フッタ } else { return { body: quot;<p>前へ: quot; + (row_info ? row_info.first_key : quot;quot; ) + quot; 次へ: quot; + (row_info ? row_info.prev_key : quot;quot;) + quot;</p>quot; }; } })
  • 37. GET /my_blog/_design/test/_list/ simple/posts_by_date lists のキー MapReduce View のキー
  • 38. RESTful Rails でいうとこ ろの、Controller#index をやってくれるもの
  • 39. MapReduce からレンダリ ングまでイッキに。
  • 40. コンテント ネゴシエーション もできる
  • 41. JavaScript Runtime の初期化時に、 以下の要領でType設定 registerType(quot;allquot;, quot;*/*quot;); registerType(quot;textquot;, quot;text/plainquot;, quot;txtquot;); registerType(quot;htmlquot;, quot;text/htmlquot;); registerType(quot;xhtmlquot;, quot;application/xhtml+xmlquot;, quot;xhtmlquot;); registerType(quot;xmlquot;, quot;application/xmlquot;, quot;text/xmlquot;, quot;application/x-xmlquot;); registerType(quot;jsonquot;, quot;application/jsonquot;, quot;text/x-jsonquot;); registerType(quot;jsquot;, quot;text/javascriptquot;, quot;application/javascriptquot;, quot;application/x- javascriptquot;); registerType(quot;cssquot;, quot;text/cssquot;); registerType(quot;icsquot;, quot;text/calendarquot;); registerType(quot;csvquot;, quot;text/csvquot;); registerType(quot;rssquot;, quot;application/rss+xmlquot;); registerType(quot;atomquot;, quot;application/atom+xmlquot;); registerType(quot;yamlquot;, quot;application/x-yamlquot;, quot;text/yamlquot;); registerType(quot;multipart_formquot;, quot;multipart/form-dataquot;);
  • 42. respondWith で返す! return respondWith(req, { html : function() { return { body:quot;<p>Ha ha, you said ¥quot;quot; + doc.word + quot;¥quot;.quot; }; }, xml : function() { return { body: quot;<xml ...>quot; }; }, fallback : quot;htmlquot; });
  • 43. 3XX とかもOK
  • 44. return {quot;codequot;: 303, quot;bodyquot;: quot;See Otherquot;, quot;headersquot;: {quot;Locationquot;: quot;/quot;}};
  • 45. 0.9.0 新機能! •Show and list functions for rendering documents and views as developer controlled content-types.
  • 46. 0.9.0 新機能(その他)! •一言で
  • 47. Basic 認証とデータバリ デーションができるように なって、いろいろ既存機 能向上した
  • 48. jQuery と CouchDB でアプリは完成できる!? あと、Apache mod*があると便利
  • 49. 余談: CouchDBで作ると おもしろそうなアプリ
  • 50. OpenSocial Container
  • 51. OpenSocial Container の要件
  • 52. JavaScript (gadgets) + REST (API) + KV Store (Persistence)
  • 53. これはCouch
  • 54. • 公式 ▫ http://couchdb.apache.org/ • ドキュメント(違 ▫ http://localhost:5984/_utils/couch_tests.html?script/ couch_tests.js • OpenSocial with CouchDB ▫ http://github.com/yssk22/webjourney/tree/opensoci al ▫ まだ何もつくっていない ▫ 開発者募集中  Apache Shindig と jQuery と (必要があればRails)でなんと かなるんじゃないかと。 • id:yssk22 が記述するすべてのコンテンツは個人の意見 であり、勤務先の組織とは一切無関係のものです。

×