SlideShare une entreprise Scribd logo
1  sur  29
2012年夏!!
Shusaku FUKUMINE
自己紹介
•   Twitter:@shumach217

•   仕事:組み込み, Linux device driver, Hard ware

•   趣味:iOS, AWS等

•   Web or DBははっきり言って素人ですwww。
4月にビッグニュースが!!

  
4月にビッグニュースが!!

 Instagramが$10万で買収

  
何故か触発されて、作ってみました。




  
何故か触発されて、作ってみました。

 iPhone側の作り方は想像できた!!



  
何故か触発されて、作ってみました。

 iPhone側の作り方は想像できた!!

 クラウド側はblog等を参考に!!

  
制作期間:4月-6月の仕事後に!!

  
制作期間:4月-6月の仕事後に!!

     iPhoneとクラウドを連携!!
制作期間:4月-6月の仕事後に!!

     iPhoneとクラウドを連携!!

     ビールを片手に♪♪
本日は、クラウド側について

 話をしたいと思います。
system resource
•   EC2, DynamoDB, S3を連携したシステム構築

•   AWSのみで構築!!

    •   本家Instagramを参考に!!

    •   楽!!!!!!!

    •   Mac Book Air一つで作成可能!!
Instagram構成(blog)
•   Load Blancing

    •    ELB + nginx

•   App

    •    Django on EC2(High-CPU Extra-Large)

•   S3

•   Data Storage

        •   PostgreSQL + redis
cockpadのCDP
想定するCDP
実装したCDP
構成要素
•   App

    •    Ruby on Rails on EC2(micro)

•   S3

•   Data Storage

    •    DynamoDB

    •    redisは近日中にトライ予定
Ruby on Railsの構成
•   Paperclip

    •   DBとS3の連携

•   Dynamoid

    •   ORM

    •   ActiveRecordは使用不可

•   PaperclipをDynamoidで使用可能に
paperclip
•   画像はS3へ格納。

•   S3はURLでファイルにアクセス。

•   DBにURLを格納して画像と関連付け。

{“imageURL”, “http://hogehoge.com/hogeImage.png”}
Dynamoid
•   DynamoDBを使用するためのORM

•   idは昇順では無い!!

    •   分散DBのため

•   NoSQL
class PostImage
  include Dynamoid::Document
  include Dynamoid::Paperclip

 field :name
 field :caption, :serialized
 field :like, :serialized

 has_dynamoid_attached_file :image,
  :path => ":attachment/:id/:style.:extension",
  :storage => :s3,
  :styles => {
     :medium => "300x300>",
     :thumb => "40x40>"
  },
  :s3_credentials => "#{Rails.root}/config/s3.yml"

 attr_accessible :image

end
def create

 @post_image = PostImage.new(:name => params[:post_image][:name])
 @post_image.image = params[:post_image][:image]
 @post_image.save

 @post = Post.new(:name => params[:post_image][:name], :dest_id =>    @post_image.id.to_s,
              :caption => params[:post_image][:caption])
 @post.save

 captions = Array.new
 caption = {"name" => @post.name, "src_id" => @post.id.to_s, "caption" => @post.caption}
 captions.push(caption)

 @post_image.update_attribute(:caption, captions)

 response = Array.new
 content = {"name" => @post_image.name, "posted_id" => @post_image.id.to_s, "status" => "success"}
 response_hash = {"feed" => content}
 response.push(response_hash)

 respond_to do |format|
    format.json { render :json => response }
 end
end
def create

 @post_image = PostImage.new(:name => params[:post_image][:name])
 @post_image.image = params[:post_image][:image]
 @post_image.save

 @post = Post.new(:name => params[:post_image][:name], :dest_id =>    @post_image.id.to_s,
              :caption => params[:post_image][:caption])
 @post.save

 captions = Array.new
 caption = {"name" => @post.name, "src_id" => @post.id.to_s, "caption" => @post.caption}
 captions.push(caption)

 @post_image.update_attribute(:caption, captions)

 response = Array.new            連想配列の配列をそのまま格納
 content = {"name" => @post_image.name, "posted_id" => @post_image.id.to_s, "status" => "success"}
 response_hash = {"feed" => content}
 response.push(response_hash)

 respond_to do |format|
    format.json { render :json => response }
 end
end
class PostImage
  include Dynamoid::Document
  include Dynamoid::Paperclip
                                                    運用するならバージョン
 field :version
 field :context, :serialized
                                                    とそのテンプレートの方
 has_dynamoid_attached_file :image,
  :path => ":attachment/:id/:style.:extension",
  :storage => :s3,
                                                       が楽??
  :styles => {
     :medium => "300x300>",
     :thumb => "40x40>"
  },
  :s3_credentials => "#{Rails.root}/config/s3.yml"

 attr_accessible :image

end
source code
•   cloud

    •   https://github.com/shumach217/
        shumachapp_rails_ojag20120811

•   iOS

    •   https://github.com/shumach217/
        shumachapp_ojag20120811

•   http://www.slideshare.net/shumach217/
    ojag20120811
まとめ
•   Instagramを想定して、実装してみた。

•   AWSのリソースを活用して、データの出し入
    れは出来ました。

•   iOSと連携しているので、興味がある方は声を
    かけて頂ければデモ可能です!
告知
•   エンジニア忘年会の告知

•   12/1を予定!!

•   那覇近辺

    •   おすすめの場所があればリクエスト

    •   スクリーンが設置可能な場所w(必須)。
御静聴、ありがとうございました。

Contenu connexe

Similaire à 沖縄Web+db勉強会 20121026

⑳CSSでアニメーション!その1
⑳CSSでアニメーション!その1⑳CSSでアニメーション!その1
⑳CSSでアニメーション!その1Nishida Kansuke
 
⑱jQueryをおぼえよう!その4
⑱jQueryをおぼえよう!その4⑱jQueryをおぼえよう!その4
⑱jQueryをおぼえよう!その4Nishida Kansuke
 
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクトYuki Okamoto
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)Toru Kawamura
 
⑯jQueryをおぼえよう!その2
⑯jQueryをおぼえよう!その2⑯jQueryをおぼえよう!その2
⑯jQueryをおぼえよう!その2Nishida Kansuke
 
第9回 OpenStack 勉強会(Glance)
第9回 OpenStack 勉強会(Glance)第9回 OpenStack 勉強会(Glance)
第9回 OpenStack 勉強会(Glance)Hiroki Ishikawa
 
CMSMix Sapporo vol.3 (Drupal の回)
CMSMix Sapporo vol.3 (Drupal の回)CMSMix Sapporo vol.3 (Drupal の回)
CMSMix Sapporo vol.3 (Drupal の回)Kenji Shirane
 
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!a know
 
MODXで“超”キレッキレのブログ作る秘訣公開します
MODXで“超”キレッキレのブログ作る秘訣公開しますMODXで“超”キレッキレのブログ作る秘訣公開します
MODXで“超”キレッキレのブログ作る秘訣公開しますKei Mikage
 
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep DiveAmazon Web Services Japan
 
Rails初心者レッスン lesson3 3edition
Rails初心者レッスン lesson3 3editionRails初心者レッスン lesson3 3edition
Rails初心者レッスン lesson3 3editionSatomi Tsujita
 
サーバレスアプリケーション構築入門
サーバレスアプリケーション構築入門サーバレスアプリケーション構築入門
サーバレスアプリケーション構築入門YoshihiroHorizono1
 
JAWSDAYS2016 Technical Deep DIVE
JAWSDAYS2016 Technical Deep DIVE JAWSDAYS2016 Technical Deep DIVE
JAWSDAYS2016 Technical Deep DIVE 陽平 山口
 
Azure でサーバーレス、 Infrastructure as Code どうしてますか?
Azure でサーバーレス、 Infrastructure as Code どうしてますか?Azure でサーバーレス、 Infrastructure as Code どうしてますか?
Azure でサーバーレス、 Infrastructure as Code どうしてますか?Kazumi IWANAGA
 
WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?Shinichi Nishikawa
 

Similaire à 沖縄Web+db勉強会 20121026 (20)

AWS小ネタ集
AWS小ネタ集AWS小ネタ集
AWS小ネタ集
 
⑳CSSでアニメーション!その1
⑳CSSでアニメーション!その1⑳CSSでアニメーション!その1
⑳CSSでアニメーション!その1
 
⑱jQueryをおぼえよう!その4
⑱jQueryをおぼえよう!その4⑱jQueryをおぼえよう!その4
⑱jQueryをおぼえよう!その4
 
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト
【アシアル塾】PHPオブジェクト指向再入門・第一回クラスとオブジェクト
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails (増補日本語版)
 
⑯jQueryをおぼえよう!その2
⑯jQueryをおぼえよう!その2⑯jQueryをおぼえよう!その2
⑯jQueryをおぼえよう!その2
 
Tech fun rails_workshop
Tech fun rails_workshopTech fun rails_workshop
Tech fun rails_workshop
 
oEmbed と Text::Hatena
oEmbed と Text::HatenaoEmbed と Text::Hatena
oEmbed と Text::Hatena
 
第9回 OpenStack 勉強会(Glance)
第9回 OpenStack 勉強会(Glance)第9回 OpenStack 勉強会(Glance)
第9回 OpenStack 勉強会(Glance)
 
APIMeetup 20170329_ichimura
APIMeetup 20170329_ichimuraAPIMeetup 20170329_ichimura
APIMeetup 20170329_ichimura
 
Ojag20120811
Ojag20120811Ojag20120811
Ojag20120811
 
CMSMix Sapporo vol.3 (Drupal の回)
CMSMix Sapporo vol.3 (Drupal の回)CMSMix Sapporo vol.3 (Drupal の回)
CMSMix Sapporo vol.3 (Drupal の回)
 
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!
「お手軽な機械学習サービス」で、ルーティンワークに立ち向かおう!
 
MODXで“超”キレッキレのブログ作る秘訣公開します
MODXで“超”キレッキレのブログ作る秘訣公開しますMODXで“超”キレッキレのブログ作る秘訣公開します
MODXで“超”キレッキレのブログ作る秘訣公開します
 
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive
第15回 Solr勉強会 #SolrJP Amazon CloudSearch Deep Dive
 
Rails初心者レッスン lesson3 3edition
Rails初心者レッスン lesson3 3editionRails初心者レッスン lesson3 3edition
Rails初心者レッスン lesson3 3edition
 
サーバレスアプリケーション構築入門
サーバレスアプリケーション構築入門サーバレスアプリケーション構築入門
サーバレスアプリケーション構築入門
 
JAWSDAYS2016 Technical Deep DIVE
JAWSDAYS2016 Technical Deep DIVE JAWSDAYS2016 Technical Deep DIVE
JAWSDAYS2016 Technical Deep DIVE
 
Azure でサーバーレス、 Infrastructure as Code どうしてますか?
Azure でサーバーレス、 Infrastructure as Code どうしてますか?Azure でサーバーレス、 Infrastructure as Code どうしてますか?
Azure でサーバーレス、 Infrastructure as Code どうしてますか?
 
WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?
 

沖縄Web+db勉強会 20121026

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n