Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cassandraのトランザクションサポート化 & web2pyによるcms用プラグイン開発

4,078 views

Published on

"PyCon JP 2011"のライトニングトークでの資料です。
Cassandraベースでどのようにトランザクションを実現したか(の概略)と、
webフレームワークであるweb2py用のCMSプラグインのご紹介です。

最近はCassandraをマイクロサービス/サービスメッシュ基盤へ応用しています。
https://b-rabbit.jp/

Published in: Software
  • ..............ACCESS that WEBSITE Over for All Ebooks ................ ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Cassandraのトランザクションサポート化 & web2pyによるcms用プラグイン開発

  1. 1. Cassandraのトランザクションサポート化 & web2pyによるCMS用プラグイン開発 Transaction support on Cassandra & CMS plugins for web2py
  2. 2. ● おまえ、誰よ? Who are you? 岸本 康二 @ Koji KISHIMOTO 株式会社エスキュービズム Pythonで受託と研究開発 などを行っています Python歴は10年ちょっと
  3. 3. 社内にPython好きが多すぎた成果物 > we_love_python = True > if we_love_python: > print PythonBook()中級以上向け
  4. 4. ①Cassandraのトランザクションサポート化 ① Transaction support on Cassandra
  5. 5. ● Cassandra って? What is Cassandra? 分散KVS(Key-Value Store) distributed key-value store ApacheのTop Level Projectの1つ Facebook社がOSS化した物が基に
  6. 6. ● とってもスケーラブル! Scalable! ノードを追加するだけで 処理性能がリニアにUP↑ Simply, add nodes and youll get more power! 分散KVS RDB ↑パフォーマンスperformance ノード数 → # of nodes
  7. 7. ● Cassandra + トランザクション Cassandra + Transaction 分散KVSでトランザクション が出来たら最高! It is desirable for distributed KVS to have the transation function! ↓ もう高価な有償RDBは不要にな(ry A Farewell To RDBs
  8. 8. ● Cassandra + トランザクション Cassandra + Transaction でも、往々にして 「分散KVSでトランザクション?(笑)」 ・・・となるのがオチ transaction on distributed KVS? ha ha ha! ↑ CAP定理と通説が原因 CAP theorem and common belief
  9. 9. ● CAP定理 CAP theorem C: 一貫性 (Consistency) A: 可用性 (Availability) P: 分断耐性 (Partition tolerance)
  10. 10. ● CAP定理での誤解 Misunderstanding about CAP theorem× 3つの保証を提供できない It is impossible to provide all three○ 3つの保証を「同時に」提供できない It is impossible to simultaneously provide all three 「同時」ではなかったら? What will happen if the system does not simultaneously provide all three?
  11. 11. ● Cassandraの場合 In the case of Cassandra C A P 定理 two of "C", "A" and "P" Solution: write & read pair 書き込み時のみではなく、"結果整合性"と関係 "eventual consistency" 読み込み時にも処理を行う ( = "Read Repair") → 強一貫性も実現 realization of "Consistency"
  12. 12. ● トランザクション Transaction on Cassandra 書き込み時のみではなく、 読み込み時にも処理を行う ( = "Read Repair") というアイディアを トランザクションに応用したら?! The same idea is availabe for the transaction! Isnt it?
  13. 13. ● 「NanaHoshi」を開発 Weve developed "NanaHoshi" 実際に実装してみて振り返ると "BASE"型トランザクション のコンセプトと似てました NanaHoshi has "BASE" type transaction mechanism BA: Basically Available S : Soft-state ← Important! E : Eventual consistency
  14. 14. ● 結論 Conclusion 分散KVSでトランザクションできます We can use the transaction on distributed KVS. 業務システム構築に利用できます しかも スケーラブルに More info → http://ec-cube.ec-orange.jp/lp/nanahoshi/ http://ec-cube.ec-orange.jp/lp/nanahoshi/
  15. 15. ● NanaHoshiの構造 Structure of "NanaHoshi" Object mapper Transaction logic Abstract access layer Thrift IF Cassandra
  16. 16. ● NanaHoshiの構造 Structure of "NanaHoshi" ここが全部Python。 Cassandra,Thrift関係以外は 全て標準機能・モジュールで構成 Object mapper Transaction logic Abstract access layer Thrift IF Cassandra
  17. 17. ● 簡単サンプルコード Simple sample code ### Initialization connection = CassandraConnection() connection.open() connection.set_keyspace(TEST) ### Preparation lockable = ModelLockable(connection, key) lockable.load() ・・・(etc.) ### Transaction transaction = ModelTransaction(connection) try: transaction.start() if not lockable.join(transaction): raise Exception() lockable.load() lockable.data += 10 lockable.save() Web server: if not transaction.end(): Tornado raise Exception() except: transaction.forget()
  18. 18. ● NanaHoshiの構造 Structure of "NanaHoshi" 実は、 Cassandra以外 でも動かせる設計です。 Object mapper Transaction logic Abstract access layer Thrift IF ( → another access IF) Cassandra → another DB
  19. 19. 10月初旬に Cassandraイベント を行う予定です。DataStaxさんからも参加予定です。
  20. 20. ②web2pyによるCMS用プラグイン開発 ② CMS plugins for web2py
  21. 21. ● web2py って? What is web2py? Webアプリケーションフレームワーク Web application framework OSSで学習が非常に容易。 最近はDjangoに追い付け追い越せ の勢いです。
  22. 22. ● CMSへの利用 Application to CMS 株のSNSサイト 『みんなの株式』 (みんかぶ) 内でも動作中。 実案件でPython 使ってます。
  23. 23. ● CMSへの利用 Application to CMS
  24. 24. ● デモサイト公開! Demo site is available!dev.s-cubism.comソースコードも公開もちろん無料です

×