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

Python으로 쿠키런 운영하기

Python으로 쿠키런 운영하기

PyCon KOREA 2014
쿠키런 for KAKAO, LINE 쿠키런 운영에 Python을 사용했던 경험에 대한 공유.
다양한 일들을 빠르고 효율적으로 처리하는 데에 사용되었던 Python의 기능들.
Python과 함께라면 1년차 개발자도 프로덕션에서 쓸만한 기능 만들 수 있다!
- 산타맛 쿠키 보유 유저를 찾아라!
- Celery를 이용하여 10분만에 전체 사용자 푸시보내기
- 게임 데이터 관리, 단번에 해결하기

Sang-gon Lee

August 30, 2014
Tweet

Other Decks in Programming

Transcript

  1. 1ZUIPOਵ۽௢ః۠਍৔ೞӝ
    ൔೠ֙ରѐߊ੗੄1ZUIPOࢎਊӝ
    %FWTJTUFST$PSQ੉࢚Ҍ

    View full-size slide

  2. Cookierun with Python
    2
    ൔೠ֙ରѐߊ੗੄1ZUIPOࢎਊӝ
    դࢤ୊਺ٜযрഥࢎ
    1SPEVDUJPOীࢲॳ੉חӝמਸѐߊೡࣻ੓ਸө
    ޙߨ݅ঌ؍1ZUIPO
    ঴݃աࡅܰѱ ঴݃ա݆਷ࢿҗܳյࣻ੓ਸө
    ૕ޙ

    View full-size slide

  3. Cookierun with Python
    3
    ъো੗ࣗѐ
    _അ੤
    ,"*45੹࢑೟җ೟ࢎҗ੿
    ੉࢚Ҍ
    _
    ֎੉ߡ࠺ૉפझ೒ۖಬੋఢ
    _അ੤
    ؘ࠳दझఠૉࢲߡѐߊ౱

    View full-size slide

  4. Cookierun with Python
    4
    ௢ః۠ࣗѐ
    ↟ ݅־੸׮਍۽٘
    ↟ ୭؀ ݅%"6
    ↟ ೠҴ ੌࠄ కҴ١ৈѐҴ׮਍۽٘ਤ
    ↟ 5PQ׮਍۽٘ҴоࣻѐҴ

    View full-size slide

  5. Cookierun with Python
    5
    ݾର
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ



    View full-size slide

  6. Cookierun with Python
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  7. Cookierun with Python
    ↟֙௼ܻझ݃झ੉߮౟ࠁ࢚ਵ۽૑әػ௢ః
    ↟ടӘઙਸѐݽইঠ঳ਸࣻ੓ח௢ః
    7
    ࢑ఋݍ௢ః
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  8. Cookierun with Python
    8
    ੉޷࢑ఋݍ௢ఃܳо૓ਬ੷о
    ↟সؘ੉౟ળ࠺оѢ੄৮ܐػ࢚ട
    !
    ↟ٍןѱࢤпդয࠭੷੄ઓ੤
    䡬 য࠭૚ਵ۽੉޷࢑ఋݍ௢ఃܳо૓ਬ੷о੓׮
    䡬 ੉੹ী۽Ӓ࠙ࢳਸా೧࢑ఋݍ௢ఃܳо૓য࠭੷о੓׮חࢎपਸঌও਺
    !
    ↟য࠭੷ٜਸ৔ҳ੿૑PS࢑ఋݍ௢ః݅࢏ઁ
    䡬 য࠭੷ٜ੉о૓࢑ఋݍ௢ఃܳ࢏ઁೞחߑߨਸࢶఖ
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  9. Cookierun with Python


    9
    ੹ۚ
    ↟ੌױ࢑ఋݍ௢ఃࠁਬਬ੷੄ݾ۾ਸࡳইղ੗
    䡬 $PVDICBTF7JFXܳࢎਊೞৈ࢑ఋݍ௢ఃࠁਬਬ੷੄ݾ۾ਸ୶୹
    ↟ডݺ੉࢑ఋݍ௢ఃܳࠁਬೣਸഛੋ
    䡬 $PVDICBTFਢ௑ࣛ۽ೠݺঀ୊ܻೞӟցޖ݆Ҋ
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  10. Cookierun with Python
    10
    ੹ۚ
    ↟ 1ZUIPOী$PVDICBTFۄ੉࠳۞ܻо੓਺
    䡬 $PVDICBTF7JFX੄௪ܻѾҗܳ1ZUIPOীࢲJUFSBUPS۽оઉৢࣻ੓਺
    䡬 ௪ܻѾҗܳ௏٘۽૒੽оઉয়פपࣻೡਤ೷ب੸਺
    ↟ ௪ܻػഥਗߣഐ۽ࢎਊ੗੄ੋ߮షܻܳоઉয়੗
    䡬 ࢎਊ੗੿ࠁח$PVDICBTFী+40/ഋక۽੷੢غয੓਺
    䡬 1ZUIPOীࢲEJDUUZQFਵ۽оઉয়޲۽ࢎਊ੗੿ࠁܳ߄۽ࣻ੿оמ
    ↟ ੋ߮షܻܳѨ࢝ೞৈ૒੽࢑ఋݍ௢ఃܳઁѢ
    JGࢎਊ੗੿ࠁ<ੋ߮షܻ><ই੉మߣഐ>࢑ఋݍ௢ః
    ࢑ఋݍ௢ఃઁѢ
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  11. Cookierun with Python
    11
    ࣘ੹ࣘѾ
    ↟दрউীݽٚ࢑ఋݍ௢ఃઁѢࢿҕ
    䡬 ডݺ੄য࠭੷۽ࠗఠ࢑ఋݍ௢ఃઁѢ
    ↟рױೠੌ੉૑݅ѐঀ૑਋੗פগݒೞҊ
    䡬 ѐ੄࢑ఋݍ௢ఃѐঀ૑਋ӝWT઴੄झ௼݀౟੘ࢿೞӝ
    ↟੗زചदఆࣻ੓חझ௼݀౟ٜܳ݅੗Ӓؘ۠যڃ঱য۽
    䡬 ׮ܲ঱যܳࢎਊ೮؊ۄݶ੉ۧѱऔҊࡅܰѱ೧Ѿೡࣻ੓঻ਸө
    䡬 QJQJOTUBMMDPVDICBTF
    ࢑ఋݍ௢ఃࠁਬਬ੷ܳ଺ইۄ

    View full-size slide

  12. Cookierun with Python
    $FMFSZܳ੉ਊೞৈ࠙݅ী
    ੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  13. Cookierun with Python
    13
    ௢ః۠੹୓ࢎਊ੗ীѱಹदܳࠁղ੗
    ↟ਬബೠಹदష௾੄іࣻড ݅ѐ
    ௢ః۠GPS,","0ӝળ

    !
    ↟ૣ਷दрউীಹदоݽٚࢎਊ੗ٜীѱ੹࣠غযঠೣ
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  14. Cookierun with Python
    14
    ਃҳࢎ೦
    ↟ࡅܲदрউী
    ↟੹୓ࢎਊ੗ীѱಹदܳ੹࣠
    ↟ࢲߡѐߊ੗੄ѐੑহ੉־ҳաࢎਊೡࣻ੓ب۾
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  15. Cookierun with Python
    15
    ҅ദ
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ


    ↟੿೧૓दрীಹद੹࣠ਸ৘ডೡࣻ੓ب۾
    䡬 $FMFSZUBTLоप೯ؼदрਸѱ੐਍৔੗оࢸ੿ೡࣻ੓ب۾
    ↟$FMFSZܳࢎਊ
    䡬 ৈ۞ѐ੄XPSLFS۽زदী੘সਸ୊ܻೞب۾
    ↟ਢਵ۽ٜ݅যࢲ੽Ӕ੉ಞܻೞب۾
    䡬 %KBOHP۽ҳഅػӝઓ੄਍৔ోীࢲࢎਊೡࣻ੓ب۾

    View full-size slide

  16. Cookierun with Python
    16
    $FMFSZ۽рױೞѱ
    ↟ $FMFSZੋझఢझܳ੿੄ೞҊ
    !
    !
    !
    !
    ↟ ਗೞחӝמীUBTL
    EFDPSBUPSܳࠢৈUBTLҳഅ
    !
    !
    !
    ↟ ؀ӝ઺ੋUBTLٜਸ੷੢ೡ2VFVF݅૑੿೧઱ݶ՘
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  17. Cookierun with Python
    17
    ӒܻҊٜ݅঻׮
    ↟ਢীࢲݫࣁ૑ղਊҗ੹࣠दрਸੑ۱ೞݶUBTLо৘ডؽ
    䡬 "84&$ੋझఢझܳߓ۽ט۰઱חUBTLѐ
    䡬 ಹदܳࠁղחUBTLܳࢤࢿ೧઱חUBTLѐ
    5BTL%PVCMF&$JOTUBODFT 5BTLಹदܳࠁղחUBTLٜਸࢤࢿ
    3FEJT
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  18. Cookierun with Python
    18
    "84&$*OTUBODFࣻܳߓ۽
    ↟ࢎਊ੗әૐী؀࠺ೞӝਤ೧ѱ੐ࢲߡ੄ࣻܳטܿ
    䡬 t૑Ә੽ࣘೞदݶ௼ܻझఎѐܳ٘۰ਃuۄחಹदо੹࣠ػ׮ݶ
    !
    ↟ಹद੹࣠੉द੘غӝ੹ী޷ܻט۰فযঠೣ
    䡬 ಹदо੹࣠غӝ࠙੹ীUBTLܳप೯
    !
    ↟CPUPܳࢎਊ
    䡬 അ੤ҳزغҊ੓חࢲߡ੄ࣻܳ౵ঈೞৈ زࣻܳ؊प೯दఇ
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ

    View full-size slide

  19. Cookierun with Python
    19
    ಹदܳࠁղחUBTLܳ١۾
    ↟ಹदష௾ਸѐঀੜۄࢲ पઁ۽ಹदܳࠁղחUBTLܳ١۾ೞח৉ೡ
    !
    ↟04߹۽ಹदష௾ਸҳ࠙ೞৈ($. "1/Tٮ۽ࠁղب۾ೣ
    !
    ↟ಹदܳࠁղחUBTLחXPSLFSٜ੉߄۽оઉоࢲ୊ܻೞחߑध
    5BTL($. 5BTL($. j 5BTL($. 5BTL"1/T j 5BTL"1/T
    3FEJT
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ
    8PSLFS 5BTLಹदܳࠁղח
    UBTLٜਸࢤࢿ
    5BTL($. 5BTL($. j 5BTL($. 5BTL"1/T j 5BTL"1/T

    View full-size slide

  20. Cookierun with Python
    20
    ࢿҗ
    ↟ࢲߡ੢গܳੌਵః૑ঋחউ੹ೠಹद੹࣠
    䡬 t૑Ә੽ࣘೞदݶ௼ܻझఎѐܳ٘۰ਃuۄחಹदо࠙݅ী੹୓ࢎਊ੗ীѱ੹࣠ػ׮ݶ
    䡬 ޖ঺ࠁ׮ѱ੐ࢲߡ੄উ੿ࢿ੉਋ࢶ
    $FMFSZܳ੉ਊೞৈ࠙݅ী੹୓ࢎਊ੗ಹदࠁղӝ
    ↟࠙݅ীড ݅ѐ੄ಹद੹࣠оמ
    䡬 $FMFSZXPSLFSࣻܳטܻҊ જ਷&$ੋझఢझܳࢎਊೞݶࢿמೱ࢚оמ
    ↟ࢲߡѐߊ੗হ੉بಹद੹࣠оמ
    䡬 ݫࣁ૑৬੹࣠दр݅ੑ۱ೞݶ־ҳٚ੹࣠оמ

    View full-size slide

  21. Cookierun with Python
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  22. Cookierun with Python
    22
    ׼द࢚ട
    ↟ুࣄ౵ੌ۽ҙܻغחѱ੐ؘ੉ఠ
    !
    ↟ѱ੐ؘ੉ఠ੄ࣻ੿੉೙ਃೡ҃਋
    ুࣄ౵ੌীࢲчࣻ੿
    %#੽ࣘో۽.Z42-ী੽ࣘ
    ೧׼ೞחప੉࠶ীুࣄद౟ܳ߈৔
    ੉җ੿ਸݽٚুࣄद౟ী؀೧߈ࠂ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  23. Cookierun with Python
    23
    ੉Ѣ҅ࣘ೧ঠೞաਃ
    ↟ؘ੉ఠद౟߈৔਷ױࣽ߈ࠂ੘স
    䡬 ߈৔೧ঠೡद౟оטযզࣻ۾੘স۝ૐо
    !
    ↟ؘ੉ఠܳੜޅ֍঻֎
    䡬 ࣻزਵ۽֍׮ࠁפपࣻೡоמࢿૐо
    !
    ↟Ӓۧ׮ݶ੗زചೡࣻ੓חోਸٜ݅੗
    䡬 दрب੺ডೞҊ
    䡬 पࣻب઴੉Ҋ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  24. Cookierun with Python
    24
    ࢎ੹ઑࢎ
    ↟ਃҳࢎ೦ਸ౵ঈ
    䡬 ুࣄ౵ੌ੄чਸ.Z42-ী੸ਊदఆࣻ੓যঠೣ
    䡬 .Z42-ী੷੢ػчਸুࣄ౵ੌ۽ࡳইյࣻ੓যঠೣ
    !
    ↟୭؀ೠࢎਊೞӝऔѱٜ݅੗
    䡬 ࢲߡѐߊ੗੄ب਑হ੉੗ਬ܂ѱؘ੉ఠܳҙܻೡࣻ੓ب۾
    䡬 ݆਷द౟ܳೠԁߣী֍ਸࣻ੓ب۾
    !
    ↟ুࣄ౵ੌਸ׮ܖח1ZUIPOۄ੉࠳۞ܻо੓ਸө
    䡬 0QFO1Z9-
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  25. Cookierun with Python
    25
    ӒܻҊٜ݅঻׮
    ↟%KBOHP۽ҳഅػӝઓ਍৔ోীࠢ੐
    䡬 ਢਵ۽਍৔غ޲۽־ҳաऔѱ੉ਊоמ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  26. Cookierun with Python
    26
    *NQPSU
    ↟ুࣄद౟੄ղਊਸ.Z42-ী߈৔
    !
    ↟%JGGܳ୹۱
    䡬 ুࣄ౵ੌਸ࠳ۄ਋੷ীՑয׮֬ਵݶ%#৬द౟੄ର੉੼ਸࠁৈળ׮
    䡬 (JU੄EJGGݺ۸ীࢲ଱উ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  27. Cookierun with Python
    27
    ਍৔ో੉द౟੉ܴਸҳ࠙ೡࣻ੓׮
    ↟؀ࠗ࠙੄द౟੉ܴ਷%KBOHPNPEFMݺҗزੌ
    !
    ↟ੌࠗद౟੄҃਋NPEFM߹۽द౟੉ܴী؀ೠ੿੄о೙ਃ
    䡬 ೞա੄NPEFMীুࣄद౟оৈ۞ѐٜযоח҃਋

    䡬 ࠗٙ੉ೞѱद౟ݺਸ߄Եࣻহח҃਋
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  28. Cookierun with Python
    28
    %JGGܳҳೞחঌҊ્ܻ
    ↟ द౟੄ݽٚղਊਸ߈৔ೞب۾ҳഅ
    !
    ↟ .Z42-3&1-"$&ҳޙਵ۽֍חѪ୊ۢҳഅ
    !
    ↟ EJDUܳഝਊೞৈઓ੤ৈࠗܳрױ൤ഛੋ
    !
    ↟ (JU੄EJGGݺ۸୊ۢ୶оؼSPX৬࢏ઁؼSPX
    ܳҳೣ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  29. Cookierun with Python
    29
    ؘ੉ఠद౟߈৔
    ↟ਗೞחప੉࠶ਸࢶఖೞҊ*NQPSUߡౡ݅־ܰݶ՘
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  30. Cookierun with Python
    30
    &YQPSU
    ↟.Z42-੄ؘ੉ఠܳুࣄ౵ੌ۽୶୹ೞৈ
    ࠅࣻ੓חӝמ
    !
    ↟ਗೞחప੉࠶ٜਸࢶఖೞҊ&YQPSUߡౡਸ
    ־ܰݶুࣄ౵ੌ੉ࢤࢿؽ
    !
    ↟ৈ۞ѐ੄द౟ܳೞա੄౵ੌ۽ޘযࢲҙܻоמ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  31. Cookierun with Python
    31
    %#झః݃о߸҃غ঻যਃযڂೞભ
    ↟%#झః݃߸҃ীبਬোೠ؀୊ооמ
    !
    ↟DPMVNO੉୶оغ঻ਸٸ
    䡬 NPEFMী೧׼DPMVNOਸ੿੄݅೧઱ݶ՘
    !
    ↟UBCMF੉୶оغ঻ਸٸ
    䡬 ࢜۽਍NPEFMਸ੿੄݅೧઱ݶ՘
    !
    ↟JOTQFDUECܳࢎਊೞݶ%#۽ࠗఠ%KBOHPNPEFMਸऔѱٜ݅ࣻ੓਺
    䡬 QZUIPONBOBHFQZJOTQFDUEC
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  32. Cookierun with Python
    32
    ࢿҗ
    ↟ ؘ੉ఠद౟ܳೠٲೠٲৢܻחসޖ೐۽ࣁझ ؊੉࢚਷
    䡬 ݻߣ੄௿ܼ݅ਵ۽оמ೧૓ؘ੉ఠद౟߈৔
    䡬 ೠ׀ীٜযয়חEJGG
    !
    ↟ ੗ਬ੄ރ੉ػࢲߡѐߊ੗
    䡬 ؘ੉ఠҙܻ੗о૒੽%#ীؘ੉ఠܳ߈৔ೡࣻ੓ѱؽ
    䡬 ࠛ೙ਃೠழޭפா੉࣌੄хࣗ۽সޖബਯૐо
    !
    ↟ ղ஘ӣী%#৬%#ب࠺Ү೧ࢲৢܾࣻ੓ѱೞ੗
    䡬 పझ౟ജ҃ীࢲഛੋ੉՘դؘ੉ఠܳQSPEVDUJPOജ҃ী߄۽ৢܾࣻ੓ب۾
    䡬 %JGGҳೞחঌҊ્ܻਸڙэ੉੸ਊ %#৬%#࠺Үীഝਊ
    ѱ੐ؘ੉ఠҙܻ ױߣী೧Ѿೞӝ

    View full-size slide

  33. Cookierun with Python
    33
    1ZUIPO੉ইפ঻׮ݶ
    ↟֙ରѐߊ੗ب1SPEVDUJPOജ҃ীࢲѐߊೡࣻ੓׮
    !
    ↟рױೠੌࠗఠө׮۽਍ੌө૑
    䡬 әೠࠛਸՑࣻ੓חੌഥࢿझ௼݀౟
    䡬 ੹୓ࢎਊ੗ܳ઱ޖܰחߓ஖ࢲ࠺झ
    䡬 সޖ೐۽ࣁझܳب߄Բח਍৔ో
    䡬 ੉ݽٚੌਸ1ZUIPOਵ۽
    !
    ↟ࡅܰѱ݆਷ੌٜਸоמೞѱ೧ળ1ZUIPO

    View full-size slide

  34. Cookierun with Python
    34
    ↟ ୭Ҋ੄ੋ੤ٜ
    8&"3&)*3*/( DBSFFS!EFWTJTUFSTDPN

    View full-size slide

  35. Cookierun with Python
    35
    ↟ ൔೠѱ੐ഥࢎ੄ࣁՙधࢎ
    8&"3&)*3*/( DBSFFS!EFWTJTUFSTDPN

    View full-size slide

  36. хࢎ೤פ׮

    View full-size slide