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

ネットスーパーの買い物体験を支える工夫と決済機能実現の過程

yamarkz
November 30, 2022

 ネットスーパーの買い物体験を支える工夫と決済機能実現の過程

泥臭くも価値を届ける決済の仕組みと工夫 by 10X + CAMPFIRE + Kanmu

https://kanmu.connpass.com/event/266209/

yamarkz

November 30, 2022
Tweet

More Decks by yamarkz

Other Decks in Technology

Transcript

  1. ©10X, Inc. All Rights Reserved. 2 ࣗݾ঺հ Kazuki Yamaguchi yamakazu

    (@yamarkz) Software Engineer at 10X, inc. Flutter, Dart, Kubernetes, Architecture ͸͡Ίʹ
  2. ©10X, Inc. All Rights Reserved. 10Xʹ͍ͭͯ • খചΓνΣʔϯ޲͚ECϓϥοτϑΥʔϜ Stailerͷ։ൃӡ༻ •

    খചࣄۀऀ༷޲͚ʹωοτεʔύʔɾωοτυϥοάετΞࣄۀͷ্ཱͪ͛Λࢧԉ • αʔϏείϯηϓτʮຖ೔ͷੜ׆Λࢧ͑Δങ͍෺ʹ৽ͨͳબ୒ࢶΛʯ 3 ͸͡Ίʹ
  3. ©10X, Inc. All Rights Reserved. ࠓ೔ͷ࿩ͷίϯηϓτ • ങ͍෺ମݧΛ࣮ݱ͢ΔͨΊʹࢪͨ͠޻෉
 • ωοτεʔύʔʹ͓͚Δܾࡁػೳͷಛ௃ͱ࢓૊Έ


    • ܾࡁػೳͷ࣮૷աఔͱ࣮૷දݱ 4 10XͷϓϩμΫτͰ͋ΔStailerΛ୊ࡐʹɺࣗ෼ͨͪͳΓͷܾࡁػೳͷ࣮૷աఔΛ঺հ͠·͢ɻ 
 ෳࡶͳܾࡁ੍ޚ͕ඞཁͱ͞ΕΔϓϩμΫτͷ։ൃʹऔΓ૊ΉํͷࢀߟʹͳΔΑ͏ͳ࿩ʹ·ͱΊ·ͨ͠ɻ ͸͡Ίʹ
  4. ©10X, Inc. All Rights Reserved. ωοτεʔύʔͷങ͍෺ମݧͷಛ௃ 8 ωοτεʔύʔʹ͓͚Δങ͍෺ମݧͷಛ௃ͱ஫จૢ࡞ ҰൠతͳEC ωοτεʔύʔ

    ߪೖ఺਺ 2~3఺ 20఺Ҏ্ ஫จૢ࡞ ஫จมߋͳ͠ ஫จมߋ͋Γ ࡏݿ؅ཧ ඼੾Εൃੜͳ͠ ඼੾Εൃੜ͋Γ ঎඼؅ཧ ෆඋՄೳੑ௿ ෆඋՄೳੑߴ • ಛ௃ͱͯ͠ߪೖ఺਺ͷଟ͞ɺ஫จૢ࡞ͷॊೈੑ (≒ෆ࣮֬ੑ)ɺࡏݿෆ࣮֬ੑɺ঎඼ෆ࣮֬ੑ͕͋Δ • ωοτεʔύʔ͸ҰൠతͳECαʔϏε (Amazon, Yahooγϣοϐϯά) ͱൺ΂ͯɺෆ࣮֬ͳཁҼ͕ଟ͍
  5. ©10X, Inc. All Rights Reserved. ωοτεʔύʔͷओͳϢʔεέʔε 10 ωοτεʔύʔʹ͓͚Δങ͍෺ମݧͷಛ௃ͱ஫จૢ࡞ ར༻ϋʔυϧΛԼ͛Δ޻෉ͷ1ͭ͸ ”஫จมߋ”

    
 
 1౓஫จͨ͠ޙʹɺมߋՄೳظؒ಺Ͱ͋Ε͹Կ౓Ͱ΋มߋՄೳʹ 
 ʮ๨ΕͯͨΞϨ΋ങ͍଍͍ͨ͠ʯʮྫྷଂݿʹ͔͋ͬͨΒ΍ͬͺΓങ͏ͷ΍Ί͍ͨʯ͕Ͱ͖Δ 
 
 ٯʹ1౓஫จͨ͠Βม͑ΒΕͳ͍ͱ͍͏ෆՄٯͳ஫จૢ࡞͸ɺར༻ϋʔυϧ͸ߴ͍ 
 = ஫จૢ࡞ͷॊೈੑ͕ٻΊΒΕ͍ͯΔ (ࢀর) https://10x.co.jp/blog/10xblog/to-c-product-growth/
  6. ©10X, Inc. All Rights Reserved. ஫จૢ࡞ͱܾࡁૢ࡞ 11 ωοτεʔύʔʹ͓͚Δങ͍෺ମݧͷಛ௃ͱ஫จૢ࡞ ͳͥɺܾࡁͷ࿩Ͱઌʹ஫จૢ࡞ͷ࿩Λ͢Δͷ͔ʁ ஫จͱܾࡁ͕ີ݁߹Ͱɺ”ܾࡁ͸஫จֹۚʹґଘ͢Δ”

    ͔Β ͭ·Γɺ஫จૢ࡞Ͱॊೈੑ͕ٻΊΒΕΔͳΒɺܾࡁૢ࡞ʹ΋ॊೈੑ͕ٻΊΒΕΔͱ͍͏͜ͱ 
 ܾࡁૢ࡞ΛॊೈʹͰ͖ͳ͚Ε͹ɺॊೈͳ஫จૢ࡞Λ࣮ݱ͢Δ͜ͱ͸Ͱ͖ͳ͍ 🙅 ͜ͷॊೈͳ஫จૢ࡞Λ࣮ݱ͢ΔͨΊʹɺܾࡁૢ࡞ΛͲ͏දݱ͢Δͷ͔͕ຊ୊ 
 ༷ʑͳ޻෉Λࢪܾͯ͠ࡁػೳͷ։ൃΛ͖͕ͯͨ͠ɺࠓճ͸͜ͷॊೈͳ஫จૢ࡞ͷ޻෉Λਂ΅Δ
  7. ©10X, Inc. All Rights Reserved. ॊೈͳܾࡁૢ࡞ͷ࣮ݱΛ໨ࢦͯ͠ 13 ॊೈͳ஫จૢ࡞Λ࣮ݱ͢ΔͨΊʹɺܾࡁૢ࡞ͷॊೈੑ͕୲อ͞Ε࣮ͨ૷Λ໨ࢦ͢͜ͱʹɻ 
 ΋ͱ΋ͱ͋ͬͨػೳΛকདྷతͳ֦ுੑΛߟྀͯ͠ϦϑΝΫλϦϯά͢Δγʔϯ͕௚ۙ͋Γɺ

    
 ࣮ࡍʹऔΓ૊ΜͩϞσϦϯάΛऔΓ্͛ɺ͞Βʹ۩ମͷ࣮૷දݱ͕Ͳ͏ͳͬͨͷ͔Λࣔ͠·͢ɻ 
 
 ͳ͓ɺ͜͜ͰͷϞσϦϯά͸ػೳ։ൃͷϞσϦϯάͰ͋ΓɺσʔλϞσϦϯάͰ͸͋Γ·ͤΜɻ 
 ܾࡁػೳ͸֎෦ͷܾࡁ୅ߦձࣾΛར༻͍ͯ͠·͢ɻ Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷
  8. ©10X, Inc. All Rights Reserved. ஫จঢ়ଶͷมભͱܾࡁૢ࡞ͷશମ૾ 14 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ ஫จલ ஫จ׬ྃ

    Ωϟϯηϧ ঎඼४උ ഑ୡ׬ྃ ࢧ෷֬ఆ ஫จมߋ Stailerͷ஫จঢ়ଶͷมભΛந৅Խͯ͠දݱ͢Δ ஫จมߋ
  9. ©10X, Inc. All Rights Reserved. ஫จঢ়ଶͷมભͱܾࡁૢ࡞ͷશମ૾ 15 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ ஫จલ ஫จ׬ྃ

    Ωϟϯηϧ ঎඼४උ ഑ୡ׬ྃ ࢧ෷֬ఆ ஫จมߋ ஫จมߋ ஫จঢ়ଶͷมભʹ߹Θͤͯݺ͹ΕΔܾࡁૢ࡞ͷΠϕϯτΛϚοϐϯά 
 4ͭͷૢ࡞ύλʔϯɺ6ͭͷૢ࡞γʔϯ ΦʔιϦ Ωϟϯηϧ ࠶ΦʔιϦ ࠶ΦʔιϦ Ωϟϓνϟʔ
  10. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ3ͭͷม਺ 16 શମΛ၆ᛌͭͭ͠ৄࡉΛ෼ੳ͢Δͱɺܾࡁૢ࡞͸3ͭͷม਺Ͱܾఆ͢Δ͜ͱ͕ݟ͖͑ͯͨ 1. ܾࡁૢ࡞Λߦ͏จ຺

    (create, update, cancel, finalize) 2. ݱࡏͷࢧ෷ֹ͍ۚ (0ҎԼ, 1Ҏ্) 3. ݱࡏͷΦʔιϦऔಘঢ়گ (ະऔಘ, औಘෆཁ, औಘࡁΈ, ΩϟϯηϧࡁΈ) Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷
  11. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ3ͭͷม਺ 17 ͳͥɺ͜ͷ3ͭͷม਺ͩͱݴ͍੾ΕΔͷ͔ʁ ૝ఆ͢ΔશͯͷϢʔεέʔεͰԿͷܾࡁૢ࡞Λબ୒͢Δ΂͖͔Λઆ໌Ͱ͖Δ͔Β ྫ1.

    ΦʔιϦΛऔಘ͢Δ ஫จ࡞੒ͷίϯςΩετ(1), ࢧ෷ֹ͍͕ۚ2800ԁ(2), ΦʔιϦ͕ະऔಘ(3) 
 => ΦʔιϦΛऔಘ͢Δ 
 
 
 ྫ2. ΦʔιϦΛߋ৽͢Δ 
 ஫จมߋͷίϯςΩετ(1), ࢧ෷ֹ͍͕ۚ4700ԁ(2), ΦʔιϦऔಘࡁΈ(3), 
 => ΦʔιϦΛ࠶औಘ͢Δ Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷
  12. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷύλʔϯ੔ཧ 19 3ͭͷม਺ͱঢ়ଶભҠͷ੔ཧΛܦͯɺૢ࡞ͷύλʔϯԽΛࢼΈΔ 
 ݁Ռͱͯ͠32ύλʔϯͷૢ࡞Λચ͍ग़͢͜ͱ͕Ͱ͖ͨ

    
 ίϯςΩετ (4) * ࢧ෷ֹ͍ۚ (2) * ΦʔιϦঢ়گ (4) = 32ύλʔϯ… 🤯 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷
  13. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ࣮૷ 20 ͜͜·Ͱ͕ϞσϦϯάͷ࿩ɻ͜ͷϞσϦϯάͰ੔ཧͰ͖ͨ಺༰Λݩʹ࣮૷Λߦ͏ ચ͍ग़ͤͨ32ύλʔϯͷ෼ذΛ۪௚ʹ࣮૷͢Δͷ͔…? ౴͑͸No.

    🙅 
 อकੑ, Մಡੑ, ςετ༰қੑΛඋ࣮͑ͨ૷Λ໨ࢦ͠ɺߏ଄Խ͞ΕͨΫϥεઃܭΛࢼΈΔ Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷
  14. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ࣮૷ 23 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ ԿΛ࣮ߦ͢Δ͔ΛӅṭ͢ΔPaymentTransaction 


    Public Interface͸executeͱrollbackͷΈ 
 ܾࡁૢ࡞ͷ੹຿Λ୯ҰΫϥεͰදݱ͢Δૂ͍ 1Ϋϥε͋ͨΓ60~80ߦͰऩ·Δ
  15. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ࣮૷ 25 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ ͲΕΛ࣮ߦ͢Δͷ͔ΛӅṭ͢ΔFactory 


    Public Interface͸createͷΈ 
 ύλʔϯબ୒(෼ذॲཧ)ΛΧϓηϧԽ͢Δૂ͍ શମͰ150ߦɺ1ϝιου͋ͨΓ࠷େ20ߦ΄Ͳ
  16. ©10X, Inc. All Rights Reserved. ܾࡁૢ࡞ͷ࣮૷ 27 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ executeͱrollbackΛݺͼग़͚ͩ͢ͷUseCase 


    ۩ମͷखଓॲཧΛ஌Βͳͯ͘Α͘͢Δૂ͍ 
 ʮΠϯλʔϑΣʔεʹରͯ͠ϓϩάϥϛϯά͢Δʯ વΔ΂͖ݺͼग़͠λΠϛϯάͰϝιουΛݺͼग़͚ͩ͢
  17. ©10X, Inc. All Rights Reserved. ϞσϦϯάͱ࣮૷ʹΑͬͯಘΒΕͨ΋ͷ 29 Stailerʹ͓͚Δܾࡁૢ࡞ͷϞσϦϯάͱ࣮૷ • ඞਢཁ݅Ͱ͋ͬͨɺܾࡁػೳͷॊೈੑ͸ύλʔϯΛ໢ཏ͢Δ͜ͱͰ࣮ݱͰ͖ͨ


    • ϞσϦϯάաఔͰੜΈग़ͨ͠੒Ռ෺ (ύλʔϯද, ঢ়ଶભҠਤ, γʔέϯεਤ) Λݩʹ
 ੜΈग़ͨ͠ίʔυ͸ɺอकੑ, Մಡੑ, ςετ༰қੑ͕උΘͬͨ
 • ෳ਺ਓͰڠྗͯ͠औΓ૊Μͩ͜ͱͰɺ։ൃӡ༻ऀͷՄ༻ੑ΋ಘΒΕͨ
  18. ©10X, Inc. All Rights Reserved. ·ͱΊ 31 ωοτεʔύʔͷങ͍෺ମݧΛࢧ͑Δ޻෉ͱܾࡁػೳ࣮ݱͷաఔ • ωοτεʔύʔͷങ͍෺ମݧΛࢧ͑Δ޻෉ͷ1͕ͭ஫จมߋ


    • ॊೈͳ஫จૢ࡞Λ࣮ݱ͢ΔͨΊʹ͸ɺܾࡁૢ࡞ͷॊೈੑ͕ඞཁ
 • StailerͰ͸32ύλʔϯͷܾࡁૢ࡞Λݟग़ͨ͠
 • υϝΠϯͷෳࡶͳ՝୊Λ۪௚ʹటष͘ϞσϦϯάΛॏͶͯղܾʹ޲͔͍ͬͯΔ