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.9k
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.3k
広告配信管理システムを支える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
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Being A Developer After 40
akosma
87
590k
Gamification - CAS2011
davidbonilla
80
5.1k
A designer walks into a library…
pauljervisheath
204
24k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Designing Experiences People Love
moore
138
23k
Making the Leap to Tech Lead
cromwellryan
133
9k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
RailsConf 2023
tenderlove
29
940
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͕ͪΐ͏Ͳ͍͍