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
Automating Front-end Workflow
addyosmani
1366
200k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Speed Design
sergeychernyshev
25
620
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
GitHub's CSS Performance
jonrohan
1030
460k
Designing Experiences People Love
moore
138
23k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Faster Mobile Websites
deanohume
305
30k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Side Projects
sachag
452
42k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Gamification - CAS2011
davidbonilla
80
5k
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͕ͪΐ͏Ͳ͍͍