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
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Building an army of robots
kneath
302
43k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Scaling GitHub
holman
458
140k
How to Ace a Technical Interview
jacobian
276
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Ruby is Unlike a Banana
tanoku
97
11k
We Have a Design System, Now What?
morganepeng
50
7.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
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͕ͪΐ͏Ͳ͍͍