Upgrade to Pro — share decks privately, control downloads, hide ads and more …

serverside-development-and-kaizen-with-golang

 serverside-development-and-kaizen-with-golang

azihsoyn

May 18, 2016
Tweet

More Decks by azihsoyn

Other Decks in Technology

Transcript

  1. ©Gunosy Inc. 2 ࣗݾ঺հ ▪ azihsoyn – Twitter – Github

    – …etc ▪ ۀ຿ – GoͰAPIαʔόͷ։ൃɾӡ༻ ▪ झຯ – ௼Γ(5ׂ) • γʔόεΛϧΞʔͰ • ←͸ઌ೔௼ͬͨγʔόεͰ͢ – Ξχϝ(4ׂ) • ࠓظNo.1͸ࡾऀࡾ༿ – ։ൃ(1ׂ) • Androidͱ͔ @azihsoyn (͋͡;ͦ΍ΜͬͯಡΉΒ͍͠)
  2. ©Gunosy Inc. 4 Gunosyͷࣾ෩ ▪ ৽ػೳͷެ։ ▪ هࣄͷॱং ▪ νϡʔτϦΞϧ

    ▪ จݴมߋ ▪ ޿ࠂग़͠෼͚ ▪ …etc ਺ࣈ͕ਆΑΓਖ਼͍͠ = (جຊతʹ) ͲΜͳࢪࡦ΋A/Bςετͯ͠ɺޮՌ͕ͳ͔ͬͨΒ΍ΊΔ શ෦A/Bςετ͠·͢
  3. ©Gunosy Inc. 7 ͲͷΑ͏ʹӡ༻͍͔ͯͨ͠ ▪ A/B։͍࢝ͨ͠ਓ͕ϓϧϦΫΛૹΔ – ίʔυमਖ਼ – ςετ௥Ճ

    ▪ APIνʔϜ͕ϨϏϡʔ ▪ Ϛʔδ ▪ ϦϦʔε࡞ۀ – git flow – stagingͰಈ࡞֬ೝ – ϦϦʔε࿈བྷ – σϓϩΠ ϋʔυίʔσΟϯάͱ͍͏͜ͱ͸ɺɺɺ ऴྃ࣌΋ಉ༷ͷϑϩʔʂʂ
  4. ©Gunosy Inc. 9 ໰୊఺ ▪ A/Bςετͷ։࢝ɾมߋɾऴྃʹ͔͔Δίετ͕ߴ͍ – ࠓ೔தʹ͓ئ͍͠·͢ͱ͔ͩͱ1͙࣌ؒΒ͍༨༟Ͱ௵ΕΔ – ࣗ෼ͷ࡞ۀ͕Ͱ͖ͳ͍

    ▪ ͍ΖΜͳνʔϜ͔ΒA/Bͷґཔ͕͘ΔͷͰϦϦʔεස౓΋ଟ͘ͳΔ – 1ϦϦʔε/4.4dayͩͬͨ – ϦϦʔε೔ΛίϯτϩʔϧͰ͖ͳ͍ ▪ ਖ਼ࣜͳϦϦʔεΛ൐͏ͷͰɺٸͳґཔʹରԠͰ͖ͳ͍ – ΋͏developʹϚʔδͯͨ͠ͷʹɺɺɺͱ͔ – ༵ۚ೔ʹA/BΛ։࢝ͨ͘͠ͳ͍ ▪ ίʔυ͔ΒA/Bςετ͕Ͳ͏͍͏ঢ়ଶͳͷ͔Θ͔Βͳ͍ – ΋͏ऴΘͬͨͷ͔ – ͍͔ͭΒ΍ͬͯΔͷ͔
  5. ©Gunosy Inc. 12 ΍ͬͨ͜ͱ ▪ ෆཁͳ(ऴྃͨ͠)A/BςετͷίʔυΛ࡟আ ▪ ඞཁͳม਺ͷચ͍ग़͠ – ϢʔβʔID,

    OSछผ, ΞϓϦόʔδϣϯ,… ▪ ඞཁͳϩδοΫͷચ͍ग़͠ – mod, ൣғ, Ұக, … ▪ ઃఆϑΝΠϧͷϑΥʔϚοτ – json, yaml, toml, go, ಠࣗDSL… ▪ ઃఆϑΝΠϧ͔Βಈతʹܭࢉ͢ΔϥΠϒϥϦ୳͠ ▪ ӡ༻ํ๏ ཁ͸ϦϑΝΫλϦϯά
  6. ©Gunosy Inc. 13 ෆཁͳA/BςετͷίʔυΛ࡟আ ▪ ຊ౰ʹϨεϙϯεฦ͞ͳͯ͘໰୊ͳ͍͔ʁ – ݻఆ஋͚ͩͲΞϓϦ͕ύʔεͯ͠Δ͔΋ – →Ϩεϙϯε͔Β࡟আͨ͠ΒΫϥογϡ͢Δ͔΋

    ▪ ͦ΋ͦ΋android͚ͩɺios͚ͩͷͨΊͷϑΟʔϧυͱ͔͋ͬͨ ؆୯ͳ͜ͱͰ͸ͳ͔ͬͨ… ΞϓϦνʔϜʹڠྗͯ͠΋Β͍ͳ͕ΒͳΜͱ͔ୀ࣏
  7. ©Gunosy Inc. 14 ඞཁͳม਺ͷચ͍ग़͠ ▪ ϢʔβʔID – Θ͔Δ ▪ OS

    – ·͊Θ͔Δ ▪ ΞϓϦόʔδϣϯ – ΞϓϦΛߋ৽͠ͳ͍ͱA/B։࢝Ͱ͖ͳ͍͸ͣͳͷͰ͍Βͳ͍͸ͣ – ࡟আ ▪ ܕ – boolҎ֎ฦ͞ͳ͍ ϢʔβʔID͚ͩͰ͍͍͸ͣ
  8. ©Gunosy Inc. 15 ඞཁͳϩδοΫͷચ͍ग़͠ ▪ mod ▪ in ▪ is

    ▪ and/or ▪ ݻఆ஋ – ݻఆ஋ฦͯ͠ΔͳΒA/BऴྃͰ͍͍͸ͣ – ޙํޓ׵ͷͨΊʹ࢓ํͳ͘ɺɺɺ ▪ span – ظؒࢦఆͰ͖ΔΑ͏ʹ௥Ճ ͕͜͜Ұ൪೰Μͩɺɺɺ
  9. ©Gunosy Inc. 17 ઃఆϑΝΠϧ͔Βಈతʹܭࢉ͢ΔϥΠϒϥϦ୳͠ ▪ ͋Δʹ͸͋ͬͨ – https://github.com/mattn/anko – https://github.com/Knetic/govaluate

    ▪ ࣗ༝ա͗ΔͱٯʹࣄނΓͦ͏ – ͔ͿͬͪΌ͍͚ͳ͍Ϣʔβʔʹద༻ͪ͠Όͬͨͱ͔ ▪ goͷ੩తܕ෇͚ͷϝϦοτ͕ࣦΘΕΔ ▪ ٯʹ੍ݶ͍ͯ͘͠ํ޲ʹγϑτ phpͷeval(bashͷexpr)Έ͍ͨͳͷ͕ཉ͍͠ɺɺɺ ͦ͏ࢥ͍ͬͯͨ࣌ظ͕Զʹ΋͋Γ·ͨ͠ ࣗલͰϥΠϒϥϦ࡞ͬͨ
  10. ©Gunosy Inc. 18 ӡ༻ํ๏ ▪ ઃఆϑΝΠϧΛ௚઀ฤू͢Δͷʁ – ؆୯ͳjsonͩͬͨΒ·ͩ͠΋… – ଞͷਓʹઃఆϑΝΠϧฤूͯ͠΋Β͏ͱࣄނ͕ා͍

    ▪ A/Bςετ͕Ͳ͏͍͏ঢ়ଶ͔෼͔Βͳ͍໰୊΋ղܾͯ͠ͳ͍ – ͔ͱ͍ͬͯ؅ཧπʔϧΘ͟Θ͟࡞Δͷ΋… issueͰ؅ཧ͢Δͷ͸͙ܾ͢·͕ͬͨ
  11. ©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" } } ],... }
  12. ©Gunosy Inc. 23 ӡ༻ํ๏ ▪ A/B։͍࢝ͨ͠ਓ͕issueΛىථ – 1 A/B 1

    issue – ׂ߹มߋ͸௥ه – ऴྃ࣌ʹclose ▪ APIνʔϜ͕εϓϨουγʔτͰϙνϙνฤू – Ϙλϯ1ͭͰjsonʹม׵ͯ͠S3ʹΞοϓϩʔυ ▪ ઃఆϑΝΠϧΛ࠶ಡࠐ͢ΔͨΊʹۭσϓϩΠ – εςʔδϯάͰͷݕূ͸جຊ͍ͯ͠ͳ͍ – → ͢Ͱʹಈ͍͍ͯͨίʔυͳͷͰͳΜͷෆ҆΋ͳ͍ͨΊ ࠷ऴతʹ͜͏ͳͬͨ 15෼͙Β͍ͰऴΘΔ
  13. ©Gunosy Inc. 24 վળ఺ ▪ Ұճͷ࡞ۀ͕࣌ؒ15෼ʹ୹ॖʂ – ࡞ۀͷ߹ؒʹͰ͖Δ ▪ ϦϦʔεස౓͕1ճ/4.4day

    → 1ճ/7.5dayʹʂ – ϦϦʔε೔ΛίϯτϩʔϧͰ͖ΔΑ͏ʹͳͬͨ ▪ ༵ۚ೔Ͱ΋A/Bͷ։࢝ɾมߋɾऴ͕ྃͰ͖ΔΑ͏ʹͳͬͨ – ࢪࡦΛ஗Βͤͳ͍ ▪ εϓϨουγʔτͰA/Bςετͷঢ়ଶ͕ݟ΍͘͢ͳͬͨ େମ໰୊఺͸ղܾͰ͖ͨ
  14. ©Gunosy Inc. 25 ՝୊΋·ͩ͋Δ ▪ ͦ΋ͦ΋εϓϨουγʔτͰ؅ཧͬͯͲ͏ͳͷʁ – ཤྺͱ͔ݖݶͱ͔ – ཧ૝͸ผγεςϜʹ͍ͨ͠…

    ▪ ؾܰʹมߋͰ͖Δͷ͸͍͍͚ͲɺώϡʔϚϯΤϥʔ͕ى͖΍͘͢ͳͬͨ – A/BࢭΊͨ͸͕ͣࢭ·ͬͯͳ͔ͬͨͱ͔ ▪ ۭσϓϩΠ΋ΊΜͲ͍͘͞ – ఆظతʹ࠶ಡࠐ͢Δʁ(͜Ε͸͍ۙ͏ͪʹͰ͖ͦ͏) ▪ ϩδοΫͷมߋ࣌͸ʁ – ௚ۙͷ՝୊
  15. ©Gunosy Inc. 26 ·ͱΊ ▪ jsonศར ▪ ϓϩηεΩϟογϡ΋ศར – ىಈ࣌ʹઃఆϑΝΠϧಡΈࠐΉ

    ▪ ൚༻ੑΑΓ੍ݶ͢Δํ޲Ͱߟ͑Δ – interfaceଟ༻͢Δ͜ͱʹͳΔͷͰGoͷ੩తܕ෇͚ͷϝϦοτ͕ࣦΘ Εͯ͠·͏ ▪ શ෦ࣗલͰ࡞ΔͷͰ͸ͳ͘ɺ͋Δ΋ͷΛ૊Έ߹Θͤͯ࡞Δ – ؤுͬͯ؅ཧπʔϧ࡞Ζ͏ͱ͠ͳͯ͘Α͔ͬͨ – εϓϨουγʔτ࠷ߴա͗Δ
  16. ©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ʹΞοϓϩʔυ ͓ੈ࿩ʹͳͬͨϥΠϒϥϦͱ͔