Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS SDK for RubyでDynamoDBを操作してみた
Search
Naoto Enokawa
October 18, 2014
Programming
0
330
AWS SDK for RubyでDynamoDBを操作してみた
JAWS-UG沖縄 CMS祭り 前夜祭LT資料です。
Naoto Enokawa
October 18, 2014
Tweet
Share
More Decks by Naoto Enokawa
See All by Naoto Enokawa
CircleCI Orbs にコントリビュートした話 / Story contributed to CircleCI Orbs
enokawa
0
500
AWS re:Invent 2017行ってきました報告 / JAWS-UG Okinawa 20180106
enokawa
1
320
Roadworkerではじめる大量DNS移行 / Codenize Meetup
enokawa
0
3.2k
AWS構築のハマりポイントを詳しく解説 / Cloud on the BEACH 2016
enokawa
3
1.4k
JAWS DAYS 2016 ランチセッション
enokawa
0
550
AWS初心者がCodenize.toolsでInfrastructure as Codeした話/jawsug-beginner2-lt
enokawa
0
830
cloudpackインターン成果報告
enokawa
0
2k
ownCloud on AWS in Hackers Champloo 前夜祭 #hcmpl
enokawa
0
610
#jawsug 沖縄 勉強会「AWS触ってみたけどその後どうしてる?」
enokawa
0
94
Other Decks in Programming
See All in Programming
Full stack testing :: basic to basic
up1
1
930
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
Discord Bot with AI -for English learners-
xin9le
1
120
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
Zoneless Testing
rainerhahnekamp
0
120
命名をリントする
chiroruxx
1
380
return文におけるstd::moveについて
onihusube
1
610
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
선언형 UI에서의 상태관리
l2hyunwoo
0
130
Featured
See All Featured
Building Your Own Lightsaber
phodgson
103
6.1k
A Tale of Four Properties
chriscoyier
157
23k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing for humans not robots
tammielis
250
25k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
A designer walks into a library…
pauljervisheath
204
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Speed Design
sergeychernyshev
25
670
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Building Applications with DynamoDB
mza
91
6.1k
Transcript
AWS SDK for Ruby V2Ͱ DynamoDBΛૢ࡞ͯ͠Έͨ Naoto Enokawa
ࣗݾհ ӫ ేʢ͑ͷ͔Θ ͳ͓ͱʣ ԭೄࠃࡍେֶ4࣍ ಛٕɿDJʢEDMͱ͔ʣ झຯɿҰ؟ϨϑʢEOS kiss X5ʣ
DynamoDBʹϦΞϧλΠϜͰ πΠʔτΛ֨ೲ͢Δ ͬͨ͜ͱ
ͳΜͰʁʁ
None
MacBookͷഎ໘Λ ࣗຫ͋͠͏WebαʔϏε
ʮMacFriendsʯͰݕࡧʂ http://macfriends.net/
None
ઌੜʮσʔλϕʔε͑ʯ
DBͳʹ͓͏… RDSͬͨΒෛ͚ͨײ͕͢͡Δww
RDS͏ΑΓDynamoDB ͬͨํ͕҆͘ࡁΈͦ͏ʂʂ
༻ͨ͠AWSαʔϏε DynamoDBɿશϚωʔδυNoSQLɺ KeyValueܕɺAPIܦ༝Ͱར༻͢ΔɺSSDͰ͍ AWS SDK for RubyɿRubyͰAWSͷϦιʔεΛ ૢ࡞͢Δ͜ͱ͕Ͱ͖ΔɺଞʹɺJavaɺ JavaScriptɺPhytonɺPHPɺ.NETɺNode.jsɺ iOSɺAndroid
Πϝʔδਤ DynamoDB ΅͘ͷMac RubyͰͿͪࠐΉʂʂ
σϞ
create_table.rb resp = dynamo_db.create_table( table_name: 'tweets', key_schema: [ { attribute_name:
'tweet_id', key_type: 'HASH', }, ], attribute_definitions: [ { attribute_name: 'tweet_id', attribute_type: 'N', }, ], provisioned_throughput: { read_capacity_units: 1, write_capacity_units: 1, }, )
put_item.rb client = TweetStream::Client.new ! client.track("#macfriends") do |status| if !status.text.index("RT")
puts "@" + status.user.screen_name + " : " + status.text resp = dynamo_db.put_item( table_name: 'tweets', item: { 'tweet_id' => status.id, 'user_id' => status.user.id, 'screen_name' => status.user.screen_name, 'tweet_text' => status.text, } ) end end
None
ࠓޙͷ՝ • ݟ͑ΔԽ • ϒϥβ্ͰDBͷใΛදࣔͤ͞Δ • herokuʹσϓϩΠ
None
/enokawa/tweetstream_dynamodb
AWS SDK for Ruby V2Ͱ DynamoDBΛૢ࡞ͯ͠Έͨ Naoto Enokawa