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
Go at fluct
Search
Kenta Suzuki
November 18, 2020
0
3.8k
Go at fluct
Nature Bath vol.6での発表資料です
Kenta Suzuki
November 18, 2020
Tweet
Share
More Decks by Kenta Suzuki
See All by Kenta Suzuki
小さな機能、大きな仕事 PHPカンファレンス沖縄2019 / phpcon-okinawa-2019
suzuken
2
2.2k
ADエンジニアがみたre:Invent 2018
suzuken
0
5.2k
広告配信管理システムを支えるPHP - レガシーシステムからの段階的移行戦略 / phpcon2017
suzuken
10
20k
ディスプレイ広告の基礎とセキュリティ
suzuken
18
3.9k
How to use AWS Lambda in Document Processing Pipeline
suzuken
0
3.8k
Featured
See All Featured
Designing for humans not robots
tammielis
249
25k
Faster Mobile Websites
deanohume
305
30k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Raft: Consensus for Rubyists
vanstee
136
6.6k
How GitHub (no longer) Works
holman
310
140k
Happy Clients
brianwarren
97
6.7k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Facilitating Awesome Meetings
lara
49
6.1k
GitHub's CSS Performance
jonrohan
1030
460k
What's new in Ruby 2.0
geeforr
343
31k
Code Reviewing Like a Champion
maltzj
520
39k
Transcript
Go at fluct Nature Bath vol.6 #naturebath, 2020/11/18 @suzu_v
ࣗݾհ ླ݈ଠ, ͚ͣ͢Μ (Twitter: @suzu_v) גࣜձࣾfluct औకCTO ΈΜͳͷGoݴޠ ڞஶऀ ࠷ۙTypeScriptͱPHPͱYAMLΛΑ͘ॻ͍͍ͯ·͢
fluctͰͷGoར༻ -2015: PHP, Perl, Erlang͕ϝΠϯ 2015͘Β͍͔ΒঃʑʹαϒγεςϜ͔Βར༻։࢝ ݱঢ়ͰෳͷϓϩμΫγϣϯϫʔΫϩʔυʹΘΕ͍ͯΔ cliπʔϧɺdebuggerɺAPIαʔόɺόον... ࠓ3ͭͷࣄྫΛհ͠·͢
ϨΠςϯγͱ҆ఆੑΛੜΉΞʔΩςΫ νϟ - SSPͷݱʹֶͿɺߴՄ༻ੑͷͭ͘ Γํ: ΤϯδχΞHub https://eh-career.com/engineerhub/entry/ 2019/07/12/103000
ࣄྫ1: PHP -> Go ݩʑ: ࠂ৴ϩάΛग़ྗ͢Δαʔό Apache + PHP ׂ:
৴ύϥϝʔλͷ෮߸ɺϩάग़ྗʢٻ & ࢹ༻ʣ // PHP -> Apache (custom log module) -> log apache_setenv(F_ENV_NAME_STATUS, $status); Testability͍, Apacheͳ͍ͱखݩͰࢼͤͳ͍ -> ϦϓϨʔε
PHP -> Go: ςετ༰қੑͱҠ২ TestMain ͰPHP + ApacheίϯςφͱGoίϯςφΛ্ཱͪ͛ ֤ςετέʔεͰϓϩμΫγϣϯͱಉ༷ͷύϥϝʔλΛ࣮ࡍʹ͛Δ ग़ྗ͞ΕΔϩά͕PHP
+ Apache࣮ͱGo࣮ͰಉҰͰ͋Δ͜ͱΛࢼݧ ҉߸ԽɺloggerɺWeb API·ΘΓΛGoʹҠ২ & ֤ػೳΛpackageԽ
ࣄྫ2: Open Biddingͷଓ Google Ad Managerʹbidderͱͯ͠ଓ @tomita τϛʔϧ͞Μ͕։ൃ Open Biddingͱ
ͻͱ͜ͱͰ: Google͔ΒࠂϦΫΤετΛड͚ɺͦΕΛDSPsʹϦΞϧλΠϜʹΦʔΫγϣϯ͠ɺࠂΛฦ ͢Έʢͯ͢αʔόؒ௨৴ʣ ϝσΟΞ <- Google <-> bidder (fluct) <-> DSPs GoͰ࣮ʢRTBαʔϏεErlang࣮Λར༻ʣ 30ԯʙ req. / day ϚϧνΫϥυʢAWS, GCPʣɺϚϧνϦʔδϣϯ എܠ: ଟ༷ͳϦΫΤετɺεϧʔϓοτॏࢹɺطଘαʔϏεΛ͏·͍͘ճ͢
ࣄྫ2: Open Biddingͷଓ (cont.) https://www.youtube.com/watch?v=uE0ReWlYbNk
ࣄྫ3: romdb 2010- memcachedb + Berkeley DB forkͨ͠memcachedbʢC++ʣͷϏϧυ͕ͭΒ͍ Berkeley DBΛஈ֊తʹஔ͖͍͖͍͑ͯͨ
-> memcachedb෦ΛGoʹஔ͖͑
ࣄྫ3: romdb (cont.) @yowcow ͕GoͰϦϓϨʔε https://github.com/yowcow/goromdb storageͷࠩ͠ସ͕͑Մೳ: Berkeley DB, BoltDB,
JSON etc. ಛఆσΟϨΫτϦʹ͓͘ͱstorageΛࠩ͠ସ͑ΒΕΔ (memcachedbͱಉ༷ʣ ϓϩτίϧෳରԠՄೳʢmemcached, etc.ʣ ຊ൪ڥͰBoltDBͱBerkeley DBΛซ༻
·ͱΊ • ͍ΖΜͳਓ͕ͳΜ͔ͩΜͩGoΛ৮͍ͬͯΔ • ϓϩμΫτͷ伱ؒɺͪΐͬͱϏϧυɾςετΛ͍ͨ͘͢͠͠ ͱ͖ʹGo͕ͪΐ͏Ͳ͍͍