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

빠르게 훑어보는 리디페이 백엔드 개발기

RIDI
June 13, 2019

빠르게 훑어보는 리디페이 백엔드 개발기

RIDI

June 13, 2019
Tweet

More Decks by RIDI

Other Decks in Programming

Transcript

  1. ࡅܰѱ വযࠁח
    ܻ٣ಕ੉ ߔূ٘ ѐߊӝ
    झషয౱ Ѿઁ ౵౟ ъӏ

    View full-size slide

  2. Infrastructure as Code
    Terraform workspace
    Prod
    $ terraform workspace select prod
    $ terraform apply
    -> slave DB ࢤࢿ
    - ௏٘ ߸҃ ൤झషܻܳ ా೧ࢲ ੗ਗ੄ ߸҃ ൤झషܻ ୶੸ ਊ੉
    - Web UIܳ ా೧ࢲ ೐۽࠺ઉ׬ ೞח Ѫࠁ׮ ഻ঁ ૒ҙ੸
    - PQ పझ౟ ӝр زউ݅ ੗ਗਸ ೠद੸ਵ۽ ਍৔ೞח ࢚ടੋ ҃਋, ੗ਗਸ ೠߣী setup/
    destroy ೞח Ѫب рಞ
    - RIDI Payীࢲח Terraformܳ ੉ਊ೮णפ׮.
    resource "aws_db_instance" "slave" {
    count = “${terraform.workspace === ‘prod’ ? 1 : 0}”

    }
    - زੌೠ terraform ௏٘۽ terraform stateܳ workspace ߹۽ աׇࢲ ҙܻೡ ࣻ ੓ח ӝמ
    Dev
    $ terraform workspace select dev
    $ terraform apply
    -> slave DB ࢤࢿ X

    View full-size slide

  3. Test Code Coverageо ઱ח Ѫ
    - ਟ݅ೠ ੜޅػ ௏٘ ߸҃ ࢎ೦ٜ੉ ৈӝࢲ ؀ࠗ࠙ Ѧ۞૗
    - ࠺ૉפझ ۽૒ী ؀ೠ ࣁࠗ੸ੋ test ࡺ݅ ইפۄ, ஶ౟܀۞ ۨ߰੄ request/responseө૑ ࢚ട ߹۽ ప
    झ౟
    - ੉ۧѱ غפ testܳ Ӓր ޺ח׮. -> ੗न ੓ח ௏٘ ࣻ੿ -> ݃਺੄ ಣച
    - ࠛ೙ਃೞѱ ߈ࠂغח ۽ஸ పझ౟ܳ ઴ੌ ࣻ ੓׮.
    - ழߡܻ૑ח 100%ࠗఠ द੘੉ۄח ݈ب ੓૑݅, ੌױ 100%ө૑ ଻਋Ҋ र਷ زӝࠗৈо ؾפ׮.
    2019. 4. 11 ӝળ
    ೧ࠁҊ र਷ Ѫ
    TDD
    https://en.wikipedia.org/wiki/Test-driven_development

    View full-size slide

  4. ௏٘৬ API ޙࢲо ܻ࠙ غয੓ਸ ٸ ࢤӝח ੌ
    ௏٘ܳ ࣻ੿ೞҊ աࢲ ޙࢲ ࣻ੿ਸ өݡח׮.
    ٍןѱ ղо ޙࢲܳ ࣻ੿ೞݶ, ׮ܲ ࢎۈ੉ ௏٘ܳ ࣻ੿ೞҊ ޙࢲܳ ࣻ੿ਸ өݡח׮.



    ঈࣽജ
    ௏٘৬ ޙࢲо э੉ јन ⪟ਵݶ જѷ׮.
    Ӓۧ׮ݶ, ௏٘৬ ޙࢲ੄ ޛܻ੸ੋ Ѣܻܳ ࠢৈࢲ ੗઱ ޙࢲܳ ࠁѱ ೞݶ যڄө?
    phpdoc
    https://github.com/zircote/swagger-php

    View full-size slide

  5. phpdocਸ ੉ਊೠ API ޙࢲ ੗زച
    https://s3.ap-northeast-2.amazonaws.com/ridi-pay-backend-api-doc/api.html
    ௏٘৬ ޙࢲо ࠢয੓যࢲ, ௏٘੄ ߸҃ী ٮۄࢲ ޙࢲо ࠛੌ஖ غח ࠼بо ബҗ੸ਵ۽ ઴য٘ח Ѫਸ ו՝
    Build(CI Pipeline)

    View full-size slide

  6. Open Source
    Ѿઁ दझమ ࣗझ ௏٘о ҕѐغח Ѫ਷ ੉۹੸ੋ ੌ੉঻חؘ, RIDI Pay੄ ҃਋ܳ ࢤп೧ࠁݶ ҕѐ ޅ ೡ ੉
    ਬо হ׮.
    ࠁউ ݶীࢲب х୸׮Ҋ ա਷ Ѫب হ׮.
    য়൤۰ ੢੼੉ ؊ ݆׮.

    View full-size slide

  7. https://github.com/ridi/style-guide/blob/master/OSS.md

    View full-size slide

  8. ࠁউ ஂড੼ ઁࠁ

    View full-size slide

  9. ࠁউ ஂড੼ ઁࠁ ੉റ ࢤпٜ
    - ੌױ hot fix
    - ࢎࣗೠ ੿ӏध पࣻ۽ ߊࢤ೮૑݅, Ӓزউ Unit Testо ցޖ positive caseী ؀೧ࢲ݅ ੘ࢿغࢲ ֬ଢ଼؍ Ѫ੉ ইקө
    - ܻ٣ಕ੉ ߔূ٘ ࢲߡীࢲ KCP Ѿઁ ݽٕী ૒੽ ੽Ӕೡ ࣻ ੓ח ܖ౟ܳ ୭ࣗച ೞ੗.
    - KCP HTTP Proxy
    - ੉ઁۄب ࠁউ ୓௼ ܻझ౟ܳ ೠߣ ഛੋ೧ࠁݶ જѷ׮
    • https://www.owasp.org/index.php/OWASP_Secure_Coding_Practices_Checklist

    • https://www.owasp.org/images/3/33/OWASP_Application_Security_Verification_Standard_3.0.1.pdf

    View full-size slide

  10. Ҋ݌णפ׮!

    View full-size slide