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
serverside-development-and-kaizen-with-golang
Search
azihsoyn
May 18, 2016
Technology
0
1.4k
serverside-development-and-kaizen-with-golang
azihsoyn
May 18, 2016
Tweet
Share
More Decks by azihsoyn
See All by azihsoyn
FlyleでのDBとの堅牢な付き合い方と パフォーマンス改善への取り組み
azihsoyn
1
150
crawler_by_aws_and_kotlin
azihsoyn
0
1.4k
firebase-with-flutter
azihsoyn
3
2.3k
Implementing Go Go Go
azihsoyn
4
4.3k
Other Decks in Technology
See All in Technology
Product Utilization of Large Language Models Starting Today
ymatsuwitter
2
620
「ばん・さく・つき・たー!」にならないためにSHIROBAKOから 学んだこと
ysknsid25
3
120
LINEヤフー新卒採用 コーディングテスト解説 アルゴリズム問題編
lycorp_recruit_jp
0
12k
【shownet.conf_】放送局とShowNetが共創する、未来の放送システム ~Media over IP 特別企画の裏側~
shownet
PRO
0
260
OPENLOGI Company Profile
hr01
0
53k
[JAWS-UG GameTech] 第6回 各種事例紹介_18TRIPにおけるAWSサービスを活用した負荷テスト・障害テスト
naoto_yasuda
0
100
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
4
1.7k
【インフラエンジニアbooks】30分でわかる「AWS継続的セキュリティ実践ガイド」
hssh2_bin
3
880
Hazard pointers with reference counter
ennael
PRO
0
110
テストコードの品質を客観的な数値で担保しよう〜Mutation Testのすすめ〜
ysknsid25
2
120
Oracle Cloud Infrastructure:2024年9月度サービス・アップデート
oracle4engineer
PRO
0
350
XPを始める新人に伝えたい近道の鍵
nakasho
1
250
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
8.9k
Rails Girls Zürich Keynote
gr2m
93
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
25
640
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Designing for humans not robots
tammielis
249
25k
RailsConf 2023
tenderlove
28
840
Making the Leap to Tech Lead
cromwellryan
130
8.8k
Docker and Python
trallard
40
3k
Building an army of robots
kneath
302
42k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Transcript
GoαʔόͷϦϦʔεΛ͍͔ʹͯ͠ݮΒ͔ͨ͠ Gunosy Inc. 2016.5 @azihsoyn
©Gunosy Inc. 2 ࣗݾհ ▪ azihsoyn – Twitter – Github
– …etc ▪ ۀ – GoͰAPIαʔόͷ։ൃɾӡ༻ ▪ झຯ – Γ(5ׂ) • γʔόεΛϧΞʔͰ • ←ઌͬͨγʔόεͰ͢ – Ξχϝ(4ׂ) • ࠓظNo.1ࡾऀࡾ༿ – ։ൃ(1ׂ) • Androidͱ͔ @azihsoyn (͋͡;ͦΜͬͯಡΉΒ͍͠)
©Gunosy Inc. 3 ͍͖ͳΓͰ͕͢ɺA/Bςετͯ͠·͔͢ʁ
©Gunosy Inc. 4 Gunosyͷࣾ෩ ▪ ৽ػೳͷެ։ ▪ هࣄͷॱং ▪ νϡʔτϦΞϧ
▪ จݴมߋ ▪ ࠂग़͚͠ ▪ …etc ࣈ͕ਆΑΓਖ਼͍͠ = (جຊతʹ) ͲΜͳࢪࡦA/Bςετͯ͠ɺޮՌ͕ͳ͔ͬͨΒΊΔ શ෦A/Bςετ͠·͢
©Gunosy Inc. 5 ͲͷΑ͏ʹӡ༻͍͔ͯͨ͠ ͦͦϋʔυίʔσΟϯάͩͬͨ
©Gunosy Inc. 6 ͲͷΑ͏ʹӡ༻͍͔ͯͨ͠ ͦͦϋʔυίʔσΟϯάͩͬͨ ݻఆʂʂA/Bͱ… ·͔͞ͷʂʂ ͜ͷϢʔβʔʹͨ͠ҙຯ͕ίʔυ͔ΒΘ͔Βͳ͍
©Gunosy Inc. 7 ͲͷΑ͏ʹӡ༻͍͔ͯͨ͠ ▪ A/B։͍࢝ͨ͠ਓ͕ϓϧϦΫΛૹΔ – ίʔυमਖ਼ – ςετՃ
▪ APIνʔϜ͕ϨϏϡʔ ▪ Ϛʔδ ▪ ϦϦʔε࡞ۀ – git flow – stagingͰಈ࡞֬ೝ – ϦϦʔε࿈བྷ – σϓϩΠ ϋʔυίʔσΟϯάͱ͍͏͜ͱɺɺɺ ऴྃ࣌ಉ༷ͷϑϩʔʂʂ
©Gunosy Inc. 8 ͜͏͍͏ґཔׂ͕ΓͱΧδϡΞϧʹདྷΔ
©Gunosy Inc. 9 ▪ A/Bςετͷ։࢝ɾมߋɾऴྃʹ͔͔Δίετ͕ߴ͍ – ࠓதʹ͓ئ͍͠·͢ͱ͔ͩͱ1͙࣌ؒΒ͍༨༟Ͱ௵ΕΔ – ࣗͷ࡞ۀ͕Ͱ͖ͳ͍
▪ ͍ΖΜͳνʔϜ͔ΒA/Bͷґཔ͕͘ΔͷͰϦϦʔεසଟ͘ͳΔ – 1ϦϦʔε/4.4dayͩͬͨ – ϦϦʔεΛίϯτϩʔϧͰ͖ͳ͍ ▪ ਖ਼ࣜͳϦϦʔεΛ͏ͷͰɺٸͳґཔʹରԠͰ͖ͳ͍ – ͏developʹϚʔδͯͨ͠ͷʹɺɺɺͱ͔ – ༵ۚʹA/BΛ։࢝ͨ͘͠ͳ͍ ▪ ίʔυ͔ΒA/Bςετ͕Ͳ͏͍͏ঢ়ଶͳͷ͔Θ͔Βͳ͍ – ͏ऴΘͬͨͷ͔ – ͍͔ͭΒͬͯΔͷ͔
©Gunosy Inc. 10 Ͳ͏վળ͔ͨ͠
©Gunosy Inc. 11 A/BςετʹؔΘΔίʔυΛ֎෦ઃఆϑΝΠϧԽ
©Gunosy Inc. 12 ͬͨ͜ͱ ▪ ෆཁͳ(ऴྃͨ͠)A/BςετͷίʔυΛআ ▪ ඞཁͳมͷચ͍ग़͠ – ϢʔβʔID,
OSछผ, ΞϓϦόʔδϣϯ,… ▪ ඞཁͳϩδοΫͷચ͍ग़͠ – mod, ൣғ, Ұக, … ▪ ઃఆϑΝΠϧͷϑΥʔϚοτ – json, yaml, toml, go, ಠࣗDSL… ▪ ઃఆϑΝΠϧ͔Βಈతʹܭࢉ͢ΔϥΠϒϥϦ୳͠ ▪ ӡ༻ํ๏ ཁϦϑΝΫλϦϯά
©Gunosy Inc. 13 ෆཁͳA/BςετͷίʔυΛআ ▪ ຊʹϨεϙϯεฦ͞ͳͯ͘ͳ͍͔ʁ – ݻఆ͚ͩͲΞϓϦ͕ύʔεͯ͠Δ͔ – →Ϩεϙϯε͔Βআͨ͠ΒΫϥογϡ͢Δ͔
▪ ͦͦandroid͚ͩɺios͚ͩͷͨΊͷϑΟʔϧυͱ͔͋ͬͨ ؆୯ͳ͜ͱͰͳ͔ͬͨ… ΞϓϦνʔϜʹڠྗͯ͠Β͍ͳ͕ΒͳΜͱ͔ୀ࣏
©Gunosy Inc. 14 ඞཁͳมͷચ͍ग़͠ ▪ ϢʔβʔID – Θ͔Δ ▪ OS
– ·͊Θ͔Δ ▪ ΞϓϦόʔδϣϯ – ΞϓϦΛߋ৽͠ͳ͍ͱA/B։࢝Ͱ͖ͳ͍ͣͳͷͰ͍Βͳ͍ͣ – আ ▪ ܕ – boolҎ֎ฦ͞ͳ͍ ϢʔβʔID͚ͩͰ͍͍ͣ
©Gunosy Inc. 15 ඞཁͳϩδοΫͷચ͍ग़͠ ▪ mod ▪ in ▪ is
▪ and/or ▪ ݻఆ – ݻఆฦͯ͠ΔͳΒA/BऴྃͰ͍͍ͣ – ޙํޓͷͨΊʹํͳ͘ɺɺɺ ▪ span – ظؒࢦఆͰ͖ΔΑ͏ʹՃ ͕͜͜Ұ൪Μͩɺɺɺ
©Gunosy Inc. 16 ઃఆϑΝΠϧͷϑΥʔϚοτ jsonҰ(طʹଞͷઃఆϑΝΠϧjsonͩͬͨ)
©Gunosy Inc. 17 ઃఆϑΝΠϧ͔Βಈతʹܭࢉ͢ΔϥΠϒϥϦ୳͠ ▪ ͋Δʹ͋ͬͨ – https://github.com/mattn/anko – https://github.com/Knetic/govaluate
▪ ࣗ༝ա͗ΔͱٯʹࣄނΓͦ͏ – ͔ͿͬͪΌ͍͚ͳ͍Ϣʔβʔʹద༻ͪ͠Όͬͨͱ͔ ▪ goͷ੩తܕ͚ͷϝϦοτ͕ࣦΘΕΔ ▪ ٯʹ੍ݶ͍ͯ͘͠ํʹγϑτ phpͷeval(bashͷexpr)Έ͍ͨͳͷ͕ཉ͍͠ɺɺɺ ͦ͏ࢥ͍ͬͯͨ࣌ظ͕Զʹ͋Γ·ͨ͠ ࣗલͰϥΠϒϥϦ࡞ͬͨ
©Gunosy Inc. 18 ӡ༻ํ๏ ▪ ઃఆϑΝΠϧΛฤू͢Δͷʁ – ؆୯ͳjsonͩͬͨΒ·ͩ͠… – ଞͷਓʹઃఆϑΝΠϧฤूͯ͠Β͏ͱࣄނ͕ා͍
▪ A/Bςετ͕Ͳ͏͍͏ঢ়ଶ͔͔Βͳ͍ղܾͯ͠ͳ͍ – ͔ͱ͍ͬͯཧπʔϧΘ͟Θ͟࡞Δͷ… issueͰཧ͢Δͷ͙ܾ͢·͕ͬͨ
©Gunosy Inc. 19 ͦΕɺGoogle εϓϨουγʔτͰͰ͖·͢Α GAS+S3ΛͬͯαʔϏεӡӦ͚ઃఆπʔϧΛઈ؆୯ʹ࡞͢Δํ๏ http://qiita.com/hirokidaichi/items/769e330284302a799095
©Gunosy Inc. 20 ͜ΜͳεϓϨουγʔτ͔Β
©Gunosy Inc. 21 ͜ΜͳjsonΛੜ { "enable_A_ab_test": [ { "fixed": true
} ],... "enable_F_ab_test": [ { "span": { "start": "2016-02-15T00:00:00+09:00", "end": null }, "mod": { "value_key": "user_id", "divisor": 20, "values": [ 0,1,2,3,4,5,6,7,10 ] }, "is": { "value_key": "os", "value": "ios" } } ],... }
©Gunosy Inc. 22 Ϙλϯ1ൃͰS3ʹΞοϓϩʔυ ͋ͱOpsWorksͰۭσϓϩΠ͢Δ͚ͩ
©Gunosy Inc. 23 ӡ༻ํ๏ ▪ A/B։͍࢝ͨ͠ਓ͕issueΛىථ – 1 A/B 1
issue – ׂ߹มߋه – ऴྃ࣌ʹclose ▪ APIνʔϜ͕εϓϨουγʔτͰϙνϙνฤू – Ϙλϯ1ͭͰjsonʹมͯ͠S3ʹΞοϓϩʔυ ▪ ઃఆϑΝΠϧΛ࠶ಡࠐ͢ΔͨΊʹۭσϓϩΠ – εςʔδϯάͰͷݕূجຊ͍ͯ͠ͳ͍ – → ͢Ͱʹಈ͍͍ͯͨίʔυͳͷͰͳΜͷෆ҆ͳ͍ͨΊ ࠷ऴతʹ͜͏ͳͬͨ 15͙Β͍ͰऴΘΔ
©Gunosy Inc. 24 վળ ▪ Ұճͷ࡞ۀ͕࣌ؒ15ʹॖʂ – ࡞ۀͷ߹ؒʹͰ͖Δ ▪ ϦϦʔεස͕1ճ/4.4day
→ 1ճ/7.5dayʹʂ – ϦϦʔεΛίϯτϩʔϧͰ͖ΔΑ͏ʹͳͬͨ ▪ ༵ۚͰA/Bͷ։࢝ɾมߋɾऴ͕ྃͰ͖ΔΑ͏ʹͳͬͨ – ࢪࡦΛΒͤͳ͍ ▪ εϓϨουγʔτͰA/Bςετͷঢ়ଶ͕ݟ͘͢ͳͬͨ େମղܾͰ͖ͨ
©Gunosy Inc. 25 ՝·ͩ͋Δ ▪ ͦͦεϓϨουγʔτͰཧͬͯͲ͏ͳͷʁ – ཤྺͱ͔ݖݶͱ͔ – ཧผγεςϜʹ͍ͨ͠…
▪ ؾܰʹมߋͰ͖Δͷ͍͍͚ͲɺώϡʔϚϯΤϥʔ͕ى͖͘͢ͳͬͨ – A/BࢭΊ͕ͨͣࢭ·ͬͯͳ͔ͬͨͱ͔ ▪ ۭσϓϩΠΊΜͲ͍͘͞ – ఆظతʹ࠶ಡࠐ͢Δʁ(͜Ε͍ۙ͏ͪʹͰ͖ͦ͏) ▪ ϩδοΫͷมߋ࣌ʁ – ۙͷ՝
©Gunosy Inc. 26 ·ͱΊ ▪ jsonศར ▪ ϓϩηεΩϟογϡศར – ىಈ࣌ʹઃఆϑΝΠϧಡΈࠐΉ
▪ ൚༻ੑΑΓ੍ݶ͢ΔํͰߟ͑Δ – interfaceଟ༻͢Δ͜ͱʹͳΔͷͰGoͷ੩తܕ͚ͷϝϦοτ͕ࣦΘ Εͯ͠·͏ ▪ શ෦ࣗલͰ࡞ΔͷͰͳ͘ɺ͋ΔͷΛΈ߹Θͤͯ࡞Δ – ؤுͬͯཧπʔϧ࡞Ζ͏ͱ͠ͳͯ͘Α͔ͬͨ – εϓϨουγʔτ࠷ߴա͗Δ
©Gunosy Inc. 27 ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
©Gunosy Inc. 28 ͦͷଞࢿྉ ▪ https://github.com/mattn/anko – phpͷevalతͳͷΛgoͰ୳ͯ͠ ▪ https://github.com/Knetic/govaluate
– phpͷevalతͳͷΛgoͰ୳ͯ͠ ▪ https://github.com/guregu/buildver – όʔδϣϯ൪߸ൺֱ͢ΔϥΠϒϥϦ ▪ http://qiita.com/hirokidaichi/items/769e330284302a799095 – εϓϨουγʔτ͔ΒS3ʹΞοϓϩʔυ ͓ੈʹͳͬͨϥΠϒϥϦͱ͔