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
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
810
Happy Clients
brianwarren
97
6.7k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Designing for humans not robots
tammielis
249
25k
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͕ͪΐ͏Ͳ͍͍