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

バンドルカードの クレジットカード決済システムの 泥臭い運用

Hiroaki Sano
November 30, 2022

バンドルカードの クレジットカード決済システムの 泥臭い運用

Hiroaki Sano

November 30, 2022
Tweet

More Decks by Hiroaki Sano

Other Decks in Technology

Transcript

  1. όϯυϧΧʔυͷ ΫϨδοτΧʔυܾࡁγεςϜͷ టष͍ӡ༻
 టष͘΋Ձ஋Λಧ͚Δܾࡁͷ࢓૊Έͱ޻෉ by 10X + CAMPFIRE + Kanmu


    Nov 30, 2022 Kanmu, Inc. Hiroaki Sano
  2. 2 ࠤ໺༟ষ Backend Engineer at Kanmu, Inc. @hiroakis @hiroakis_

  3. 3 όϯυϧΧʔυ

  4. ँࡑ 4 0 • ԾλΠτϧͰʮόϯυϧΧʔυͷΫϨδοτΧʔυܾࡁγε ςϜͷྺ࢙ʯͱ͍ͯ͠·͕ͨ͠ɺ1࣌ؒҎ্ඞཁͳ͜ͱ͕Θ ͔ͬͯ͠·ͬͨͷͰɺటष͍෦෼ʹϑΥʔΧεͨ͠಺༰ʹม ߋ͠·ͨ͠…

  5. ໨࣍ 5 0 • 0. Χʔυܾࡁۀք಺ͰͷΧϯϜͷཱͪҐஔ • ΧʔυܾࡁۀքͷΤίγεςϜʹ͍ͭͯઆ໌͠·͢ • 1.

    র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ۀ຿ϩδοΫͷటͷ෦෼Λ࿩͠·͢ • 2. Ϗδωεύʔτφʔͱͷཁ݅Λຬͨ͢ωοτϫʔΫઃܭ • Πϯϑϥͷటͷ෦෼Λ࿩͠·͢
  6. Χʔυܾࡁۀք಺ͰͷΧϯϜͷཱͪҐஔ 0

  7. Χʔυܾࡁۀք಺ͰͷΧϯϜͷཱͪҐஔ Acquirer
 (ΞΫϫΠΞϥ) Issuer
 (ΠγϡΞ) 7 0 Brand
 (ϒϥϯυ) •

    Brand (Visa, MasterCard, JCB, ࿆ۜ, Amex...) • ϓϥοτϑΥʔϜͷఏڙɺऔҾϧʔϧͷنఆ • Acquirer • ΧʔυՃໍళͷ։୓Λߦ͏ • Issuer • Χʔυձһ(Ϣʔβ)ͷ։୓Λߦ͏ Χʔυձһܖ໿ Χʔυձһ ళฮ Ճໍళܖ໿ ΞϥΠΞϯε ΞϥΠΞϯε ֤ొ৔ਓ෺ͷؔ܎ Χʔυͷར༻/঎඼ͷड͚౉͠
  8. Χʔυܾࡁۀք಺ͰͷΧϯϜͷཱͪҐஔ Acquirer
 (ΞΫϫΠΞϥ) Issuer
 (ΠγϡΞ) 8 0 Brand
 (ϒϥϯυ) •

    Brand (Visa, MasterCard, JCB, ࿆ۜ, Amex...) • ϓϥοτϑΥʔϜͷఏڙɺऔҾϧʔϧͷنఆ • Acquirer • ΧʔυՃໍళͷ։୓Λߦ͏ • Issuer • Χʔυձһ(Ϣʔβ)ͷ։୓Λߦ͏ Χʔυձһܖ໿ Χʔυձһ ళฮ Ճໍళܖ໿ ΞϥΠΞϯε ΞϥΠΞϯε ֤ొ৔ਓ෺ͷؔ܎ Χʔυͷར༻/঎඼ͷड͚౉͠ ΧϯϜ
  9. র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨ Γ͢ΔԾച্ͱ࣮ച্ 1

  10. 10 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ໔੹ࣄ߲ʹͳΓ·͕͢͜͜Ͱڍ͛ΒΕ͍ͯΔ໰୊఺΍όά͸ओʹܾࡁγε ςϜͷ৽نϦϦʔε௚ޙʹൃੜͨ͠΋ͷͰ͋Γɺݱࡏ͸جຊతʹղফ͞Ε ͓ͯΓ·͢

  11. Acquirer
 (ΞΫϫΠΞϥ) Issuer
 (ΠγϡΞ) 11 1 Brand
 (ϒϥϯυ) (1)ར༻ (0)Χʔυൃߦ

    Χʔυձһ ళฮ (1)Ծച্ (1)Ծച্ (1)Ծച্ (2)੥ٻ (2)࣮ച্ (2)࣮ച্ (2)࣮ച্ ΫϨδοτΧʔυܾࡁ͸2ϑΣʔζ (1) Ծച্ : ΦʔιϦθʔγϣϯ (༩৴ɾΦʔιϦ) (2) ࣮ച্ : ΫϦΞϦϯά (ച্֬ఆ) ຊࢿྉͰ͸ʮܾࡁʯͱݴ͏ͱ͜ͷ2ͭͷ͜ͱΛࢦ͢͜ͱͱ͠·͢ ͓ۚͷྲྀΕ ΧϯϜ র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্
  12. 12 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ͜͜Ͱ͸Ծച্ͱ࣮ച্ͷ͜ͱΛʮܾࡁʯͱݺͿ • Ծച্͸࣮ച্ͷ౸ୡΛ΋ͬͯച্֬ఆͱͳΔ • ʮ֬ఆʯʹΑͬͯΤίγεςϜ಺Ͱ͓͕ۚճΔ

  13. 13 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ 5JNF 5SBOTBDUJPO "NPVOU "# -#  ೖۚ

    ʴ    Ծച্ ʔ    ࣮ച্ ʔ   • ܾࡁΛߦ͏ͱϢʔβͷ࢒ߴ͕ಈ͘ • ࢒ߴʹ͸ Available Balance (AB), Ledger Balance (LB) ͱ͍͏֓೦͕͋Δ • Ծച্ͰҾ͔ΕΔͷ͕ABɺ࣮ച্ͰҾ͔ΕΔͷ͕ LB • όϯυϧΧʔυʹೖۚ -> 400ԁͷങ͍෺ -> ࣮ച্Ͱ300ԁ͕ಧ͍ͨɺͱ͍ ͏έʔεͷֹۚͷಈ͖͸ҎԼͷΑ͏ʹͳΔ • ࣮ച্͕ಧ͍ͨΒԾച্ͱর߹͠ɺԾച্ͱ࣮ച্Ͱֹ͕ۚҟͳΔ৔߹͸ ࣮ച্Λਖ਼ͱͯ͠ิਖ਼͢Δ • όϯυϧΧʔυ͸ͲͷΑ͏ͳܾࡁ͕ߦΘΕͯ΋࠷ऴతʹ͸ AB ʹ LB ͱͳΔ • র߹ʹ͸Ծച্͓Αͼ࣮ച্ͦΕͧΕͰඈΜͰ͘ΔσʔλΛ࢖͏ ↑ ิਖ਼ͱͯ͠+100ԁ͞Ε͍ͯΔ
  14. 14 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • Ծച্ͷిจͷྫ • ࣮ച্ͷྫ΋঺հ͍ͨ͠ͱ͜ΖͰ͕͢ɺͦͪΒ͸Πϯλʔωοτ্ʹ࢓ ༷͕ग़͓ͯΒͣ Con fi

    dential ͷͨΊׂѪ͠·͢ • Ծച্͍ͭͯ͸ඪ४Խ͞Ε͍ͯͯ ISO8583 Ͱݕࡧ͢Δͱग़͖ͯ·͢ 0x0100f224648108e08016000000000000000410401 924999999999900000000000000400012210805420 003812212599908400100000b012345678901f7f3f5f 5f0f8f0f0f0f3f8f1e3c5d9d4c9c4f0f1c3c1d9c440c1c3c 3c5d7e3d6d94040c1c3d8e4c9d9c5d940d5c1d4c540 4040404040404040404040c3c9e3e840d5c1d4c5404 04040e4e2084001420800000000000000000580000 000020e0040000000000000f1f140f1f2f3
  15. 15 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ 0x0100f224648108e08016000000000000000410401 924999999999900000000000000400012210805420 003812212599908400100000b012345678901f7f3f5f 5f0f8f0f0f0f3f8f1e3c5d9d4c9c4f0f1c3c1d9c440c1c3c 3c5d7e3d6d94040c1c3d8e4c9d9c5d940d5c1d4c540 4040404040404040404040c3c9e3e840d5c1d4c5404 04040e4e2084001420800000000000000000580000

    000020e0040000000000000f1f140f1f2f3 PAN ༗ޮظݶ(22೥/12݄) 010: ΦϯϥΠϯܾࡁ ֹۚ(4000) ※ PAN: Primary Account Number ɺΧʔυ൪߸ͷ͜ͱ • Ծച্ͷిจ͸όΠφϦϑΥʔϚοτʹͳ͍ͬͯΔ • Brand ͷΤϯυϙΠϯτʹ TCP ઀ଓ͢Δͱ޲͜͏͔Βϓογϡ͞Εͯ͘Δ • ࣮ച্͸όΠφϦϑΝΠϧͰఏڙ͞ΕΔ • ࣮ച্΋ Brand ͷωοτϫʔΫ͔ΒόονͰऔಘ͢Δ • ͲͪΒ΋ਓؒʹ͸ಡΈͮΒ͍ (׳ΕΔͱಡΊΔΑ͏ʹͳΔ)
  16. Acquirer
 (ΞΫϫΠΞϥ) Issuer
 (ΠγϡΞ) 16 1 Brand
 (ϒϥϯυ) (1)ར༻ (PAN,

    ༗ޮظݶ...ͳͲΛೖྗ) Χʔυձһ ళฮ (6)ΠγϡΞ͔ ΒͷԠ౴͕౸ୡ র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ (5) ApprovalCode Λੜ੒ͯ͠Ԡ౴ (2) ֹۚ, ܾࡁखஈͳͲΛ෇༩ (3) Retrieval Reference Number
 ΍ΞΫϫΠΞϥIDͳͲΛ෇༩ (4) Transaction Identi fi er ͳͲΛ෇༩ ֤ڌ఺Ͱσʔλ͕෇༩͞ΕΔ • ΠγϡΞ͕Ծച্Λঝೝͨ͠Ԡ౴͕ళฮʹ౸ୡͨ͠ޙ೔࣮ച্͕ൃੜ͢Δ • ࣮ച্͸Ծച্Ͱ෇༩͞ΕͨσʔλΛՃ޻ͤͣʹ্͛Δ͜ͱʹͳ͍ͬͯΔ • ΋ͪΖΜྫ֎͸͋Δ͕ɺ͜ΕΒͷσʔλΛҾ͖ճ͢͜ͱͰর߹Λߦ͏
  17. 17 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • র߹ʹ͸ઌ΄Ͳͷిจʹؚ·ΕΔ͍͔ͭ͘ͷ ID ͷΑ͏ͳ΋ͷΛ࢖͏͜ͱ͕ Ͱ͖ΔɻID Ҏ֎ͷ΋ͷ (ྫ͑͹Ճໍళ໊)Λ࢖͏͜ͱ΋Ͱ͖Δɻ

    • Brand ͷ࢓༷ॻʹর߹ʹؔ͢ΔϕετϓϥΫςΟε͸ॻ͔Ε͍ͯΔ͕ɺ͜ ΕΒ͕ඞͣ߹͏อূ͸ͳ͍Α͏ͳॻ͖ํ͕͞Ε͍ͯΔ • Transaction Identi fi er Λ࢖ͬͯ΋ྑ͍ • Approval Code Λ࢖ͬͯ΋ྑ͍ • ΞΫϫΠΞϥIDΛ࢖ͬͯ΋ྑ͍ • Ճໍళ໊Λ࢖ͬͯ΋ྑ͍ • ܾࡁֹۚ΍ܾࡁ೔࣌Λ࢖ͬͯ΋ྑ͍
  18. 18 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • র߹ͷॲཧΛૉ௚ʹॻ͖࢝ΊΔ • Ծച্͸ॲཧͨ͠Β DB ʹిจΛه࿥͍ͯ͠Δ •

    ࣮ച্͕དྷͨΒઌ΄ͲͷIDྨͰԾച্Λݕࡧ͢Δ • ܾࡁγεςϜ։ൃ౰ॳͷর߹ॲཧ SELECT xx FROM Ծച্ςʔϒϧ
 WHERE
 transaction_identi fi er = 'xx' AND approval_code = 'xx' • ݁߹ࢼݧͰ͸͜ΕΒ͕Ұக͍ͯͨ͠ͷͰ৴༻ͯ͠ૉ௚ʹAND৚݅ͱ͍ͯ͠ ͕ͨԾച্͕ݟ͔ͭΒͳ͍Τϥʔ͕ࢄݟ͞ΕΔ • ௐ΂Δͱ Transaction Identi fi er ͸Ұக͍ͯ͠Δ͕ ApprovalCode ͸Ұக ͍ͯ͠ͳ͍ɺ·ͨ͸ͦͷٯɺͱ͍͏Α͏ͳݱ৅͕ى͖͍ͯΔ͜ͱ͕Θ͔ͬ ͨ
  19. 19 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • Αͬͯ͜͜Ͱ΋ૉ௚ʹมߋ͢Δ SELECT xx FROM Ծച্ςʔϒϧ
 WHERE


    transaction_identi fi er = 'xx' OR approval_code = 'xx' • ࠓ౓͸ޡͬͨর߹͕͞Ε͍ͯΔέʔε͕ݱΕͨ • ͳ͔ͥʁ approval_code ͷ࢓༷͸ 6ܻͷ਺ࣈɻͭ·Γ 000000 - 999999 ͷ ൣғɻඇৗʹ୹͘ϢχʔΫੑʹ๡͍͠ɻ͜Ε͘Β͍ͷܻͩͱ؆୯ʹॏෳ͢ Δɻ
  20. 20 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ݕࡧൣғΛߜͬͯΈΔ SELECT xx FROM Ծച্ςʔϒϧ
 WHERE


    (transaction_identi fi er = 'xx' OR approval_code = 'xx' )
 AND
 created_at > x೔લ • ࠓ౓͸Ծച্͔Βx೔ܦաޙʹ࣮ച্͕དྷΔέʔεʹରԠͰ͖ͳ͍͜ͱ͕Θ ͔ͬͨ • ࣮ച্্͕͍͕ͭͬͯ͘Δ͔͸อূ͞Ε͍ͯͳ͍ • x೔ޙʹ࣮ച্͕͘ΔͱԾച্Λݟ͚ͭΔ͜ͱ͕Ͱ͖ͳ͍
  21. 21 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • Ծച্ڧ੍ฦۚͱͷ߹ΘٕͤͰରԠ • ౰࣌͸Ծച্͔Β45೔ܦաޙ΋࣮ച্͕དྷͳ͍৔߹͸ฦۚ͢Δ࢓༷͕͋ͬ ͨ (※ ݱࡏ͸͜ͷڧ੍ฦۚͷ࢓༷ࣗମ͕มߋ͞Ε͍ͯ·͢)

    • 45೔ܦͯ͹ඞͣڧ੍ฦۚ͞Ε͍ͯΔͱ͍͏લఏͰॲཧΛߦ͏ • 45೔ܦաޙ͸AB͕໭͍ͬͯΔͷͰABͱLB྆ํΛҾ͘ SELECT xx FROM Ծച্ςʔϒϧ
 WHERE
 (transaction_identi fi er = 'xx' OR approval_code = 'xx' )
 AND
 created_at > 45೔લ 5JNF 5SBOTBDUJPO "NPVOU "# -#  ೖۚ ʴ    Ծച্ ʔ    ڧ੍ฦۚ ʴ    ࣮ച্ ʔ  
  22. 22 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ࠓ౓͸Ծച্ͷΩϟϯηϧͷ͋ͱʹ࣮ച্͕ಧ͘έʔε΋ൃݟ͞Εͨ 5JNF 5SBOTBDUJPO "NPVOU "# -#

     ೖۚ ʴ    Ծച্ ʔ    Ծച্Ωϟϯηϧ ʴ    ࣮ച্ ʔ   • ࣮ച্ͷલʹԾച্͕Ωϟϯηϧ͞ΕͯAB͕ࠩ͠໭͞Εͨ • ࣮ച্ͷॲཧ͸Ծച্͕Ωϟϯηϧ͞Ε͍ͯΔՄೳੑ͕͋Δͱ͍͏ߟྀ͕ ͞Ε͍ͯͳ͔ͬͨͨΊૉ௚ʹॲཧΛਐΊΔͱ AB ͱ LB ͕ٯస͢Δ • ͜Ε͸࣮ࡍʹ͸600ԁ͔͍࣋ͬͯ͠ͳ͍͕ɺ1000ԁ·Ͱ࢖͑ͯ͠·͏ͱ͍ ͏࢒ߴʹෆ੔߹͕ൃੜ͍ͯ͠Δঢ়گ
  23. 23 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ͜ΕͷରԠͷͨΊʹԾച্ͱর߹͢ΔલʹԾച্͕Ωϟϯηϧ͞Ε͍ͯͳ ͍͔ͷ֬ೝΛߦ͏ϩδοΫΛ௥Ճ • Ծച্͕Ωϟϯηϧ͞Εͨ͋ͱʹ࣮ച্্͕͕ͬͯ͘Δͱ͍͏ঢ়گΛ૝ఆ ͍ͯ͠ͳ͔ͬͨ

  24. 24 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ͔͠͠·ͩऴΘΒͳ͍ • ೔ʑ༷ʑͳύλʔϯ͕ݟ͔ͭΔ • Ծച্ ->

    ࣮ച্ -> Ծച্Ωϟϯηϧ -> ࣮ച্Ωϟϯηϧ • Ծച্ -> ࣮ച্ -> ࣮ച্ -> ࣮ച্ • ࣮ച্ (Ծച্͕ຊ౰ʹଘࡏ͠ͳ͍) • ͻͨ͢ΒύονΛ౰ͯͯ௵͍ͯͬͨ͠ • র߹ͷϩδοΫ͕ෳࡶʹͳΔ
  25. 25 1 র߹Ͱ͖ͨΓͰ͖ͳ͔ͬͨΓ͢ΔԾച্ͱ࣮ച্ • ͜ΕΒ͸஌ࣝෆ଍ͱۀքͷ͍Ζ͸Λ஌Βͳ͍͜ͱ͔Βੜ·Εͯ͠·ͬͨ • Πϯλʔωοτ্ʹϊ΢ϋ΢͕ͳ͘ख୳Γ͔͠Ͱ͖ͳ͔ͬͨ • ಛʹϢʔβͷ࢒ߴ͕ζϨΔͷ͸͔ͳΓةݥ •

    ࣮ച্ͷόον͸೔தଳʹ࣮ߦͯͦ͠ͷ৔Ͱϩά֬ೝ͢ΔΑ͏ʹͨ͠ • র߹͕Ͱ͖ͳ͍΋ͷ͸͋͑ͯΤϥʔͰམͱͯ͠खಈͰऔΓࠐΉΑ͏ʹͨ͠ • ܾࡁͷύλʔϯΛͻͨ͢Β஝ੵ͍ͯͬͨ͠ • ৽ϝϯόʔୡͷ׆༂ͳͲ΋͋Γ࠷ऴతʹ͸র߹Τϥʔθϩʹͳͬͨ
  26. Ϗδωεύʔτφʔͱͷ઀ଓཁ݅
 Λຬͨ͢ωοτϫʔΫઃܭ 2

  27. 27 2 Ϗδωεύʔτφʔͱͷ઀ଓཁ݅Λຬͨ͢ωοτϫʔΫઃܭ • ܾࡁΛࡹͨ͘Ίʹ Brand ͷΤϯυϙΠϯτʹ઀ଓ͢Δඞཁ͕͋Δ • ͪ͜ΒͷγεςϜ͸AWSͰɺ઀ଓઌ͸ΦϯϓϨʹ͋Δ •

    ઌʹॻ͍ͨΑ͏ʹԾച্͸TCPͷৗ࣌઀ଓɺ࣮ച্͸όον(※) • ※ ϒϥϯυͷఏڙ͢Διϑτ΢ΣΞʴզʑͷ։ൃͨ͠ιϑτ΢ΣΞͷ߹੒ • ϓϩτίϧ͸෬ͤ·͢ • ཁ݅ͱͯ͠͸͜ΕΒͷϓϩτίϧͰࢦఆͷϙʔτʹ઀ଓͰ͖Δ͜ͱ • Ճ͑ͯ • Ծച্ɺ࣮ച্ͷ઀ଓ͸DC಺ͷࢦఆ͞Εͨૹ৴ݩIPʹͳ͍ͬͯΔ͜ͱ • Ծച্αʔόͱ࣮ച্αʔόͷૹ৴ݩIP͸ผͰ͋Δ͜ͱ • Ծച্ɺ࣮ച্ͦΕͧΕͷαʔόʹڐՄ͞ΕΔૹ৴ݩIP͸1ͭͷΈͰ͋Δ͜ͱ • ͜ͷલఏͰͲͷΑ͏ʹΤϯυϙΠϯτʹ઀ଓͯ͠ɺಛʹৗ࣌઀ଓͷԾച্αʔόͷ৑௕ ԽΛ͢Δ͔ʁ Acquirer
 (ΞΫϫΠΞϥ) Issuer
 (ΠγϡΞ) Brand
 (ϒϥϯυ) ΦϯϓϨ AWS Ծച্: TCP ࣮ച্: όον
  28. 2 ࣮ച্ HAProxy AWS Direct Connect Ծച্ VPC peering API

    VPC peering Processor (ΧϯϜͷܾࡁγεςϜ) Vandle ܾࡁ νϟʔδ ENI ENI Subnet Subnet Subnet Direct Connect Λड͚ΔϧʔλͰ͍Ζ͍Ζ͕Μ͹Δ HAProxy, ࣮ച্αʔόʹENIΛΞλονͯ͠AWS ଆͷEC2ͷIPΛݻఆɺ 
 AWSଆͷૹ৴ݩIPͰԾച্αʔό͔࣮ച্αʔό͔Λ൑அͤ͞Δ ͦΕʹΑͬͯͦΕͧΕ͕ڐՄ͞ΕΔDC಺ͷૹ৴ݩIPʹSNAT͢Δ IP ݻఆ IP ݻఆ DC಺ͷૹ৴ݩIPͰ ΞΫηε੍ޚ ͞Ε͍ͯΔ Ծച্ ૹ৴ݩIP͸1͔ͭ͠ڐՄ͞Ε͍ͯͳ͍ͷͰ HAProxy ͰԾച্αʔόͷૹ৴ݩΛ1ͭݟͤΔ ͜ͷഎޙʹԾച্αʔόΛ഑ஔͯ͠৑௕Խ ΑΜ͝ͱͳ͖ࣄ৘ʹΑΓԾച্ͱ VPCΛ෼͚Δඞཁ͕͋Δ Amazon RDS
 (PostgreSQL) API Amazon RDS
 (PostgreSQL) BrandͷΤϯυϙΠϯτ Ϗδωεύʔτφʔͱͷ઀ଓཁ݅Λຬͨ͢ωοτϫʔΫઃܭ
  29. 29 2 • ͜ͷߏ੒ͷ໰୊఺ • HAProxy ͕׬શͳ SPOF • ো֐࣌͸खӡ༻ͰͲ͏ʹ͔͢Δ

    • DC಺ʹஔ͍ͨϧʔλͷઃఆมߋͰ͏·͍͜ͱͰ͖ͦ͏͕ͩ1౓ࣦഊ • ܾࡁΛࢭΊΔϝϯς͕ͮ͠Β͍͜ͱʹՃ͑ͯ৺ཧతڪාͰखΛग़ͤͳ͍ ঢ়گ͕ଓ͍ͨ • ͜ͷͱ͖ͷDC͸๭ݝ๭ॴ (ͱͯ΋ԕ͍) Ϗδωεύʔτφʔͱͷ઀ଓཁ݅Λຬͨ͢ωοτϫʔΫઃܭ
  30. 2 ࣮ച্ AWS Direct Connect Ծച্ API VPC peering Processor

    (ΧϯϜͷܾࡁγεςϜ) Vandle Subnet Subnet ίϯϑΟάϨʔγϣϯΛมߋͯ͠ Ծച্ɺ࣮ച্ͷαϒωοτ͔Βͷ઀ଓΛ ͦΕͧΕ1ͭͷIPʹม׵͢ΔΑ͏ʹͨ͠ DC಺ͷૹ৴ݩIPͰ ΞΫηε੍ޚ ͞Ε͍ͯΔ Ծച্ DCҠઃͷλΠϛϯάͰΞʔΩςΫνϟͱίϯϑΟάΛมߋͯ͠΋Ζ΋Ζվળ HAProxy ͸ୀ໾ DCҠઃͷλΠϛϯάͰࣄ৘ͷ੔ཧ͕͖ͭ
 Ծച্ͱಉ͡VPCʹͳͬͨ Amazon RDS
 (PostgreSQL) API Amazon RDS
 (PostgreSQL) ܾࡁ νϟʔδ BrandͷΤϯυϙΠϯτ Ϗδωεύʔτφʔͱͷ઀ଓཁ݅Λຬͨ͢ωοτϫʔΫઃܭ
  31. 31 2 • Ϗδωεύʔτφʔͷཁ݅ΛՃຯͯ͠࠷దͳઃܭΛ͢Δඞཁ͕͋ͬͨ • ॳظͷ͜Ζ͸ SPOF ΋͋Γӡ༻ͰΧόʔ͢ΔΑ͏ͳ੬ऑͳΠϯϑϥͩͬͨ • DCҠઃ΍ओʹωοτϫʔΫͷΞʔΩςΫνϟมߋΛܦͯͦΕͳΓʹ៉ྷʹ

    ͳͬͨ Ϗδωεύʔτφʔͱͷ઀ଓཁ݅Λຬͨ͢ωοτϫʔΫઃܭ
  32. ·ͱΊ 3

  33. 33 3 ·ͱΊ • 20෼ͱ͍͏୹͍࣌ؒͰݶΒΕͨ͜ͱ͔͠஻Ε·ͤΜͰ͕ͨ͠ɺΠϯλʔ ωοτ্ʹ஌ݟͷ΄ͱΜͲͳ͍γεςϜΛख୳Γ͠ͳ͕Βӡ༻͢Δͷ͕͓ ΋͠Ζ͍ͱ͜ΖͰ͢ɻ • ·༷ͨʑͳ੍໿ԼͰ͍͔ʹεϚʔτʹ΍Δ͔ʁΛߟ͑ɺ࣮ߦ͢Δͷ΋ຯ͕ ͋Γ·͢ɻ

    • ࠓ೔͸Πϯϑϥ໘ͷ੍໿ʹ͍ͭͯ঺հΛ͠·͕ͨ͠ɺଞʹ΋࣮͸ Brand ͷΤϯυϙΠϯτ͸઀ଓ਺ʹ੍ݶ͕ೖ͍ͬͯͯɺԾച্ͷॲཧੑ ೳΛεέʔϧͤ͞Δʹ͸Ұۤ࿑Ͱͨ͠ • ͜ΕΛͲ͏εέʔϧͤ͞Δ͔ʁ͸ٕज़తʹ໘ന͍औΓ૊ΈͰͨ͠ɻڵຯ ͋Δํ͸ҎԼͷಉ྅ͷࢿྉΛݟͯΈ͍ͯͩ͘͞ɻ • Ref) GoͰ࣮૷͢ΔϒϥϯυωοτϫʔΫͱͷ઀ଓϙΠϯτ • https://speakerdeck.com/pongzu/godeshi-zhuang- suruburandonetutowakutofalsejie-sok-pointo • ͜Μͳ؀ڥͰ΍ͬͯΈ͍ͨํ͸͝࿈བྷ͍ͩ͘͞ • -> https://kanmu.co.jp/jobs/
  34. ͓ΘΓ