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
Heroku を利用した Quipper の開発事例紹介
Search
Kensuke Nagae
November 29, 2013
Programming
11
3.2k
Heroku を利用した Quipper の開発事例紹介
Tech Compass Vol.6 “Love Heroku?” の発表資料です
http://techcompass.jp/study/06/
Kensuke Nagae
November 29, 2013
Tweet
Share
More Decks by Kensuke Nagae
See All by Kensuke Nagae
スタディサプリ開発チームのこれまでとこれから / StudySapuri Product Meetup #1
kyanny
0
2.3k
Tokyo Web Dev hiring discussion session
kyanny
0
13k
sbpayment.rbのご紹介
kyanny
0
2k
#AsiaDevNight
kyanny
0
100
Grape による API 実装 in action
kyanny
7
6.9k
<%= link_to "bundle", "update" %> - Make "bundle update" more fun to review
kyanny
2
4.9k
Web Developer Seminar
kyanny
0
1.7k
Continuous gem dependency updating with Jenkins and Pull Request
kyanny
9
3.1k
Introducing nonopaste-cli #rubyconftw2012
kyanny
1
1.5k
Other Decks in Programming
See All in Programming
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Exploring: Partial and Independent Composables
blackbracken
0
100
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
testcontainers のススメ
sgash708
1
120
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
0
130
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
情報漏洩させないための設計
kubotak
2
290
MCP with Cloudflare Workers
yusukebe
2
220
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
470
ドメインイベント増えすぎ問題
h0r15h0
2
350
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Building Your Own Lightsaber
phodgson
103
6.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How GitHub (no longer) Works
holman
311
140k
Designing Experiences People Love
moore
138
23k
Into the Great Unknown - MozCon
thekraken
33
1.5k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Gamification - CAS2011
davidbonilla
80
5.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Designing for Performance
lara
604
68k
Transcript
)FSPLVΛར༻ͨ͠ 2VJQQFSͷ։ൃࣄྫհ 5FDI$PNQBTTl-PWF)FSPLV z /PWFNCFS ,FOTVLF/BHBF!LZBOOZ
w2VJQQFSͷհ w2VJQQFSϓϥοτϑΥʔϜͰͷ )FSPLVͷ׆༻ࣄྫհ w)FSPLVͷ͍Ͳ͜ΖΛݟۃΊΔ w·ͱΊ ຊͷΞδΣϯμ
!LZBOOZ͕͓ૹΓ͠·͢ wӬ݈հ /BHBF,FOTVLF w݄d2VJQQFS w8FC%FWFMPQFS 3VCZ IUUQLZBOOZNF
2VJQQFSɺϞόΠϧྖҬͷ ֶशϓϥοτϑΥʔϜΛఏڙ͍ͯ͠Δ ڭҭܥελʔτΞοϓاۀͰ͢ IUUQXXXRVJQQFSDPNKBQBODBSFFST
ຊࣾϩϯυϯͰ͕͢౦ژΦϑΟε͋Γ·͢ χϡʔϤʔΫʹελοϑ͕ৗற͍ͯ͠·͢ ৬छʹΑͬͯϩϯυϯɾΞδΞॾࠃͷग़ு
IUUQHBLVNPTUVEZDPN தߴੜֶ͚शαʔϏεʮ(",6.0ʯ
IUUQXXXRVJQQFSTDIPPMDPN ΞδΞֶ͚शαʔϏεʮ2VJQQFS4DIPPMʯ
$SFBUJPO$FOUFS ίϯςϯπΛ࡞Δ 2-JOL ֶशঢ়گΛ Ϟχλʔ͢Δ 2-FBSO (",6.0 ֶश͢Δ 2VJQQFSϓϥοτϑΥʔϜࡾͭͷػೳΛ࣠ʹ ֤छαʔϏεΛల։͍ͯ͠·͢
ಉ͡ΞϓϦέʔγϣϯΛ ผʑͷϒϥϯυͰల։͢Δ͜ͱ͋Γ·͢
ΞϓϦέʔγϣϯͷಈ࡞֬ೝͷͨΊʹ ςετ༻ͷڥඞཁͰ͢Ͷ 5FTUJOH 5FTUJOH
ɾɾɾ͞ΒʹσϓϩΠલͷ࠷ऴνΣοΫ༻ʹ εςʔδϯάڥ༻ҙ͠ͳ͍ͱ 5FTUJOH 5FTUJOH 4UBHJOH 4UBHJOH
Ӧۀͷਓ ʮ͋ɺ͓٬͞ΜʹݟͤΔσϞແ͍ͷʁʯ 5FTUJOH 5FTUJOH 4UBHJOH 4UBHJOH %FNP %FNP
5FTUJOH 5FTUJOH 4UBHJOH 4UBHJOH %FNP %FNP αʔόʔ͕͍ͭ͋ͬͯ͘Γͳ͍Αʂ ͍͍ͪͪηοτΞοϓͯ͠ΒΕͳ͍Αʂ ͜Μͳʹͨ͘͞ΜཧͰ͖ͳ͍Αʂ
)FSPLVΛ͍·͠ΐ͏
ͯ͢)FSPLVͰӡ༻ͯ͠·͢
wαʔόʔͷηοτΞοϓ࡞ۀ͕ෆཁ wΞϓϦέʔγϣϯͷઃఆ࡞ۀ͕؆୯ wαʔόʔͷࢮ׆ࢹ͕ෆཁ wαʔόʔͷεέʔϧΞτ͕؆୯ w๛ͳΞυΦϯͰ֦ு؆୯ )FSPLVͷڧΈ ʮӡ༻ͷෛ୲͕গͳ͍ʯʹ͋Γ·͢
IFSPLVDSFBUF</".&> ηοτΞοϓίϚϯυҰ͚ͭͩ Πϯετʔϧ࡞ۀෆཁͰ͢
HJUQVTIIFSPLVNBTUFS ΞϓϦέʔγϣϯͷσϓϩΠʹ (JUΛ͍·͢
IFSPLVDPOpHTFU,&:7"-6& IFSPLVDPOpH ڥมͷઃఆɾ֬ೝίϚϯυͰ
EJ⒎Va IFSPLVDPOpHBQQNZBQQQSPEVDUJPO a IFSPLVDPOpHBQQNZBQQTUBHJOH 1SP5JQڥมͷࠩνΣοΫ
IFSPLVQTTDBMFXFC εέʔϧΞτίϚϯυҰ͚ͭͩʂ αʔόʔػثͷखɾηοτΞοϓෆཁ ඵͰϦιʔεΛ૿ڧͰ͖·͢
IFSPLVGPSL</&8/".&> ΞϓϦέʔγϣϯͷෳͰ͖·͢ ςετ༻ɾσϞ༻ڥ͙͢࡞Ε·͢
IFSPLVDSFBUFBQQ HJUQVTIIFSPLVNBTUFS IFSPLVGPSLBQQEFNP IFSPLVDPOpHTFU%&.0BQQBQQEFNP σϞ༻ͷڥΛ࡞Δͱͨ͠Β͜Μͳײ͡
๛ͳΞυΦϯ /FX3FMJD ύϑΥʔϚϯεܭଌ
๛ͳΞυΦϯ 4FOE(SJE ϝʔϧ৴
ͦͷଞ͍͔ͭͬͯ͘·͢ w.FNDBDIJFS Ωϟογϡ w3FEJT5P(P ,FZ7BMVFετΞ w)FSPLV4DIFEVMFS DSPO w44-
͋͑ͯΞυΦϯΛΘͳ͍͜ͱ
.POHP-BC .POHP%#ϗεςΟϯά wෳΞϓϦέʔγϣϯ͔Βڞ༗ wݸผܖͷ΄͏͕ྉ͕͍ۚ҆ wΞΫηεݖݶͷదͳ੍ݶ wBEEPOTSFNPWFϛεࢭ
͔͜͜Β۩ମతͳϢʔεέʔεΛ հ͠·͢ wϩάهϛυϧΣΞ w"1*αʔόʔͷϚΠάϨʔγϣϯ w#J[%FW͕1VMM3FRVFTUΛςετ
Ϣʔεέʔε ϩάهϛυϧΣΞ
Ϣʔεέʔε ϩάهϛυϧΣΞ wϦΫΤετɾϨεϙϯεΛͯ͢ه wௐࠪతͰ࣌ؒͷར༻Λఆ w3BDLϛυϧΣΞͱ࣮ͯ͠
Ϣʔεέʔε ϩάهϛυϧΣΞ class LoggingMiddleware def initialize(app) @app = app end
def call(env) ENV['ENABLE_LOGGING'] ? call_with_logging(env) : call_without_logging(env) end def call_with_logging(env) request = Rack::Request.new env status, headers, body = call_without_logging(env) Log.create(request: request, response: [status, headers, body]) [status, headers, body] end def call_without_logging(env) @app.call env end end
Ϣʔεέʔε ϩάهϛυϧΣΞ wڥมͰ༗ޮɾແޮͷΓସ͑ wίʔυͷมߋɾσϓϩΠͱʹෆཁ wτϥϒϧ࣌ʹ͙͑͢Δ
Ϣʔεέʔε "1*αʔόʔͷϚΠάϨʔγϣϯ
Ϣʔεέʔε "1*αʔόʔͷϚΠάϨʔγϣϯ w(SBQF 3BDL ͔Β3BJMTϕʔε wNBTUFSͱSBJMTϒϥϯνΛฒߦՔಇ w༷ࢠΛݟͳ͕ΒΏͬ͘ΓΓସ͑Δ
αʔόʔߏ Database API
αʔόʔߏ Database API API (Rails)
αʔόʔߏ Database API API (Rails)
"1*αʔόʔଆͷ࡞ۀ IFSPLVGPSLBQJSBJMTBQQBQJ IFSPLVEPNBJOTBEEBQJSBJMTRVJQQFSDPN HJUQVTIIFSPLVSBJMTNBTUFS
ΞϓϦέʔγϣϯଆͷ࡞ۀ ʢ˞ڥม"1*@63-ͰΤϯυϙΠϯτΛࢦఆʣ IFSPLVDPOpHTFUa "1*@63-IUUQTBQJSBJMTRVJQQFSDPN
࠷খݶͷΦϖϨʔγϣϯͰҠߦྃ ʢ˞ΞϓϦέʔγϣϯͷ࣮ʹΑΓ·͕͢ɾɾɾʣ wμϯλΠϜແ͠ɺʮΏͬ͘ΓʯҠߦ w৽چαʔόʔΛฒߦՔಇ wαʔόʔΛʮ෦ʯͱͯ͠ѻ͏ w%JTQPTBCMF$PNQPOFOUT
wσϓϩΠɾ࠶ىಈɾઃఆมߋͷཤྺ wʮ୭͕ʯʮ͍ͭʯʮԿΛ͔ͨ͠ʯ w(JUͷίϛοτ͕ه͞ΕΔ wෳਓͰͷӡ༻ʹඞਢ 1SP5JQIFSPLVSFMFBTFT
Ϣʔεέʔε #J[%FW͕1VMM3FRVFTUΛςετ ඇ։ൃऀ(JU)VC'MPXʹר͖ࠐΜͰ ΈΜͳϋοϐʔʹͳͬͨ IUUQCMPHNBEPSPPSHNO
։ൃऀ͕1VMM3FRVFTU ʢςελʔ͚ͷνΣοΫϦετ͖ʣ
+FOLJOT͕1VMM3FRVFTUϒϥϯνΛςετ (SFFOͩͬͨΒ)FSPLVʹσϓϩΠ
ςελʔσϓϩΠ͞Εͨ63-Λ։͍ͯ ϒϥβͰಈ࡞νΣοΫ
ίʔυϨϏϡʔ ςελʔͷಈ࡞νΣοΫ ྆ํ0,ͳΒଞͷ։ൃऀ͕Ϛʔδ
%FNPOTUSBCMF1VMM3FRVFTUT wϚʔδ͕શһʹͱͬͯͷʮྃʯʹ wίϛϡχέʔγϣϯ͘͢͠ͳͬͨ wνʔϜશମͷεϐʔυײ͕͕͋ͬͨ wϦϦʔεɾσϓϩΠࣄނ͕ݮͬͨ IUUQTCMPHIFSPLVDPNBSDIJWFTIFSPLVGPSL
˞࣮ࡍͷίϚϯυ ͬͱటष͍Ͱ͕͢ɾɾɾ IFSPLVGPSLBQJGFBUVSF(*5@#3"/$)BQQBQJ HJUQVTIa HJU!IFSPLVDPNBQJGFBUVSF(*5@#3"/$)HJUa (*5@#3"/$)NBTUFS
ٯʹ)FSPLVͰΠϚΠνͳͱ͜Ζʁ wڥมʹґଘ͗͢͠ΔϦεΫ w)FSPLVʹ׳Ε͗ͯ͢ΨϥύΰεԽ͢ΔϦεΫ wݸਓͰ͏ʹͪΐͬͱׂߴʢແྉআ͘ʣ wʢਖ਼ͦΜͳʹෆຬແ͍ʂʣ
ڥมʹґଘ͗͢͠ΔϦεΫ wಈతʹܾ·ΔڥมѲͮ͠Β͍ཁૉ wຊདྷόʔδϣϯཧ͖͢ʢઃఆϑΝΠϧʣ wΞϓϦέʔγϣϯ͕ڥมʹґଘ͗͢͠Δ wʮਖ਼͍͠ʯΛΒͳ͍ͱಈ͔ͤͳ͍ wυΩϡϝϯτͱίϛϡχέʔγϣϯͰΧόʔ
ʢ͕ࣗʣΨϥύΰεԽ͢ΔϦεΫ w)FSPLVҎ֎ͷڥͰԿͰ͖ͳ͘ͳΔ wྲྀߦͷ%FW0QTٕज़Λࢼ͢ػձ͕ແ͍ wศར͗ͯ͢ΠϯϑϥͷτϨϯυʹૄ͘ͳΔ w)FSPLVϓϥοτϑΥʔϜʹғ͍ࠐ·ΕΔ w༨ՋΛར༻ͯ͠1BB4*BB4Λݚڀ͠·͠ΐ͏
ݸਓͰ͏ʹͪΐͬͱׂߴʢແྉআ͘ʣ wʮ͘͞Βͷ714ʯ͕҆͗͢Δ͚ͩʁ wࢿͱࢥͬͯదʹ՝ۚ͢Δͷ͕٢ʁ w)FSPLV͕Ṷ͔ͬͯԼ͛͢ΔͱΈΜͳخ͍͠ wզʑ։ൃऀ͕Γཱ͍͖ͯͯ·͠ΐ͏
·ͱΊ w2VJQQFSͷ։ൃࣄྫΛհ͠·ͨ͠ w)FSPLV༏ΕͨϓϥοτϑΥʔϜͰ͢ wࣄʢϓϩμΫγϣϯ༻్ʣͰ͑·͢ w)FSPLVΤίγεςϜΛཧղ͢Δͱ͞Βʹศར
5IBOLZPV