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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Naoto Enokawa
October 18, 2014
Programming
340
0
Share
AWS SDK for RubyでDynamoDBを操作してみた
JAWS-UG沖縄 CMS祭り 前夜祭LT資料です。
Naoto Enokawa
October 18, 2014
More Decks by Naoto Enokawa
See All by Naoto Enokawa
CircleCI Orbs にコントリビュートした話 / Story contributed to CircleCI Orbs
enokawa
0
700
AWS re:Invent 2017行ってきました報告 / JAWS-UG Okinawa 20180106
enokawa
1
330
Roadworkerではじめる大量DNS移行 / Codenize Meetup
enokawa
0
3.5k
AWS構築のハマりポイントを詳しく解説 / Cloud on the BEACH 2016
enokawa
3
1.5k
JAWS DAYS 2016 ランチセッション
enokawa
0
630
AWS初心者がCodenize.toolsでInfrastructure as Codeした話/jawsug-beginner2-lt
enokawa
0
850
cloudpackインターン成果報告
enokawa
0
2k
ownCloud on AWS in Hackers Champloo 前夜祭 #hcmpl
enokawa
0
630
#jawsug 沖縄 勉強会「AWS触ってみたけどその後どうしてる?」
enokawa
0
110
Other Decks in Programming
See All in Programming
AI Agent と正しく分析するための環境作り
yoshyum
2
550
AgentCore Optimizationを始めよう!
licux
3
260
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
130
書き換えて学ぶTemporal #fukts
pirosikick
2
380
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
400
AIを導入する前にやるべきこと
negima
2
370
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
450
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
1k
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
470
要はバランスからの卒業 #yumemi_grow
kajitack
0
170
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
160
Featured
See All Featured
Design in an AI World
tapps
1
210
The World Runs on Bad Software
bkeepers
PRO
72
12k
Discover your Explorer Soul
emna__ayadi
2
1.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
300
Everyday Curiosity
cassininazir
0
210
Being A Developer After 40
akosma
91
590k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Test your architecture with Archunit
thirion
1
2.2k
My Coaching Mixtape
mlcsv
0
130
GraphQLとの向き合い方2022年版
quramy
50
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
830
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