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

モバイルアプリとAPIのありかたを考える2014

ar_tama
August 30, 2014

 モバイルアプリとAPIのありかたを考える2014

YAPC::Asia 2014

ar_tama

August 30, 2014
Tweet

More Decks by ar_tama

Other Decks in Programming

Transcript

  1. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ͜Ε͔ΒͷϞόΠϧΞϓϦͱ
    "1*ͷ͋Γ͔ͨΛߟ͑Δ
    1

    View full-size slide

  2. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    2
    • ͋Βͨ·
    • !BS@UBNB

    View full-size slide

  3. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    3
    • ͋Βͨ·
    • !BS@UBNB
    • גࣜձࣾσΟʔɾΤψɾΤʔ
    • γεςϜຊ෦ϓϥοτϑΥʔϜγεςϜ෦αʔόʔάϧʔϓ
    • ࣗࣾϓϥοτϑΥʔϜͷΊΜͲ͏ΛݟΔͱ͜Ζ

    View full-size slide

  4. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    4
    • झຯͰJ04ΞϓϦΛ͍ͭͬͯ͘·͢
    • IUUQUFOTVOFU

    View full-size slide

  5. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    5

    View full-size slide

  6. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    6
    w ͖ΐ͏ͷ΋ͪ΋ͪ

    View full-size slide

  7. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ΠϯτϩμΫγϣϯ
    7

    View full-size slide

  8. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ࣭໰Ͱ͢
    8
    • αʔόαΠυΤϯδχΞͩΑʔ
    • ΫϥΠΞϯταΠυΤϯδχΞͩΑʔ
    • Ͳͬͪ΋΍ΔΑʔ

    View full-size slide

  9. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ຊฤʹೖΔ·͑ʹʜ
    9
    • ͜ΜͳͻͱΛର৅ʹ͍ͯ͠·͢
    • ΫϥΠΞϯταΠυΤϯδχΞ͚ͩͲɺαʔόαΠυ ͱΤϯδχΞ
    ͷ
    ͜ͱΛ΋ͬͱ஌Γ͍ͨ
    • αʔόαΠυΤϯδχΞ͚ͩͲɺΫϥΠΞϯταΠυ ͱΤϯδχΞ
    ͷ
    ͜ͱΛ΋ͬͱ஌Γ͍ͨ
    • ϞόΠϧΞϓϦؔ࿈ͷτϐοΫʹڵຯ͕͋Δ
    • ϞόΠϧΞϓϦ։ൃΛ΋ͬͱΑ͍ͨ͘͠
    • ݰਓʹ͸෺଍Γͳ͍͔΋ʂ

    View full-size slide

  10. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ຊฤʹೖΔ·͑ʹʜ
    10
    • ʮϞόΠϧΞϓϦʯͷఆٛ
    • ͓΋ʹJ04"OESPJEΞϓϦΛࢦͯ͠࢖͍ͬͯ·͢
    • ΫϥΠΞϯταΠυͷࣄྫ΍σϞͱͯ͠ڍ͛Δͷ͸J04ͷΈ

    View full-size slide

  11. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϞόΠϧΞϓϦ͋Δ͋Δ
    11
    • খ͘͞ग़ͯ͠ίπίπվળ͕΍Γʹ͍͘ͱ͔
    • WJFX෦෼ͷHJU؅ཧͭΒ͍ͱ͔
    • αΠζ੍ݶ͍ͨ΁Μͱ͔
    • σόΠεؒಉظ͋ͨΓ·͑ͩΑͶͱ͔
    • ௨৴ͱ͔

    View full-size slide

  12. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϞόΠϧΞϓϦ͋Δ͋Δ
    12
    • খ͘͞ग़ͯ͠ίπίπվળ͕΍Γʹ͍͘ͱ͔
    • WJFX෦෼ͷHJU؅ཧͭΒ͍ͱ͔
    • αΠζ੍ݶ͍ͨ΁Μͱ͔
    • σόΠεؒಉظ͋ͨΓ·͑ͩΑͶͱ͔
    • ௨৴ͱ͔

    View full-size slide

  13. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϞόΠϧΞϓϦ͋Δ͋Δ
    13
    • ϢʔβͷΞΫγϣϯͷͨͼʹʮ௨৴தʜʯ

    View full-size slide

  14. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϞόΠϧΞϓϦ͋Δ͋Δ
    14
    • ਓࡐෆ଍ͰͨͲͨͲ͘͠όοΫΤϯυΛ࡞͍ͬͯͨΒϘτϧωοΫʹʜ
    • ݸਓɾখதن໛։ൃʹ͋Γ͕ͪ

    View full-size slide

  15. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϞόΠϧΞϓϦ͋Δ͋Δ
    15
    • ຖճΞϓϦΛ࡞ΔͨͼτʔΫϯอଘ΍σʔλಉظ͘Β͍͔͠͠ͳ͍όοΫ
    ΤϯυΛ࡞͍ͬͯΔ
    • ͱ͸͍͑࢓༷͕ͪΐͬ͜ͱҧͬͨΓͯ͠ڞ௨Խͮ͠Β͍
    • PSڞ௨ԽͰ͖Δ͘͠Έʹͳ͍ͬͯͳ͍

    View full-size slide

  16. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ཧ૝
    16

    View full-size slide

  17. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ཧ૝
    17
    • γεςϜ౎߹Ϣʔβ౎߹
    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍
    • ૹ৴தΫϧΫϧͱ͔
    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ

    View full-size slide

  18. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ཧ૝ʹۙͮͨ͘Ίʹʜ
    18
    • .#BB4
    • +40/31$#BUDI

    View full-size slide

  19. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ཧ૝ʹۙͮͨ͘Ίʹʜ
    19
    • .#BB4
    • +40/31$#BUDI

    View full-size slide

  20. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    .#BB4
    20
    • .PCJMF#BDLFOEBTB4FSWJDF
    • ୅ද֨ͷ1BSTFͱ͍͏αʔϏεʹ͍ͭͯ͢͜͠۷ΓԼ͛·͢

    View full-size slide

  21. • ϞόΠϧΞϓϦͷόοΫΤϯυΛ·Δͬͱ໘౗Έͯ͘ΕΔαʔϏε
    Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    21

    View full-size slide

  22. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    22
    • σʔλετΞ
    • 4%,ͱ3&45"1*ͷఏڙ
    • ϓογϡ௨஌ૹ৴
    • ղੳ
    • ΢ΣϒΞϓϦͷϗεςΟϯά
    • SEQBSUZQMVHJOTͷಋೖࢧԉ
    • "QQ-JOLTͱ͔

    View full-size slide

  23. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    23
    • .#BB41BB4ͳΠϝʔδ
    • Ұ෦ͷػೳ͸)FSPLVͬΆ͍
    • ͦ͏͍͑͹)FMJPT͍ͬͯ·ʜʁ

    View full-size slide

  24. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    24
    • σʔλετΞ
    • 4%,ͱ3&45"1*ͷఏڙ
    • ϓογϡ௨஌ૹ৴
    • ղੳ
    • ΢ΣϒΞϓϦͷϗεςΟϯά
    • SEQBSUZQMVHJOTͷಋೖࢧԉ
    • "QQ-JOLTͱ͔

    View full-size slide

  25. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    25
    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ
    • খதن໛ΞϓϦͷϓϩτλΠϐϯάͱεϞʔϧελʔτ
    • UPLFOͷอଘ΍σʔλͷಉظͷͨΊ͚ͩʹόοΫΤϯυΛ༻ҙ͠ͳͯ͘Α͘ͳΔ
    • ΞϓϦͦͷ΋ͷͷ։ൃʹूதͰ͖Δ
    • ˠ1BSTFͷͶΒ͍Ͳ͓Γʂ

    View full-size slide

  26. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    26
    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυɾαʔόαΠυ
    • ϞόΠϧΞϓϦɾ΢ΣϒΞϓϦͰͬ͘͞ͱσʔλಉظ
    • 4%,ͷ෯͕޿͍3&45"1*΋ఏڙ͞Ε͍ͯΔͷͰ൚༻ੑ͕ߴ͍
    • 3&45"1*ͷϢʔβ֦ு΋Ͱ͖Δ

    View full-size slide

  27. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    1BSTF
    27
    • σϞ

    View full-size slide

  28. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ͪΐͬͱدΓಓ
    28
    • %SPQCPY%BUBTUPSF"1*
    • ΦϑϥΠϯͰ$36%ͨ͠%SPQCPY಺ͷσʔλΛΦϯϥΠϯʹͳͬͨλ
    ΠϛϯάͰΑ͠ͳʹಉظͯ͘͠ΕΔ܅
    • ϢʔεέʔεʹΑͬͯ͸ΊͪΌΊͪΌศརͳΑ͔Μʂ

    View full-size slide

  29. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ͜͜Ͱ͓͞Β͍
    29
    • γεςϜ౎߹Ϣʔβ౎߹
    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍
    • ૹ৴தͱ͔
    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ

    View full-size slide

  30. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϏϑΥʔΞϑλʔ
    30
    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ
    • αʔϏεɾϓϩμΫτͦͷ΋ͷʹϑΥʔΧεͰ͖Δ؀ڥ͕੔͍ͭͭ͋Δ

    View full-size slide

  31. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ཧ૝ʹۙͮͨ͘Ίʹʜ
    31
    • .#BB4
    • +40/31$#BUDI

    View full-size slide

  32. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$
    32
    • +40/Ͱ31$͢ΔͨΊͷ࢓༷
    • +40/ܗࣜͰΓ΋ʔͱͳ΀Ζ͠ʔ͡ΌΛ͜ʔΔ͢Δ

    View full-size slide

  33. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$
    33
    • ʮͨͩ+40/ܗࣜͰϝοηʔδΛ΍ΓͱΓ͢Δ͚ͩͳͷʹԿ͕ͦΜͳʹ͏
    Ε͍͠ͷʁʯ

    View full-size slide

  34. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$
    34
    • ಛ௃
    • جຊతʹ1045ͷΈ
    • 63*͸ͻͱͭʢݺͼग़͢ॲཧ͸1045ύϥϝʔλͰఆٛʣ

    View full-size slide

  35. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$
    35
    • ͓͕ͯΔʂ

    View full-size slide

  36. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    36
    • Ͱ৽͘͠௥Ճ͞Εͨ࢓༷
    • /PUJpDBUJPOͱ#BUDI

    View full-size slide

  37. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    37
    • ඪ४తͳSFRSFTͷྫ
    • ௨৴ͱϦΫΤετ͕
    client server
    connec+on
    req
    res
    connec+on
    req
    res
    connec+on
    req
    res

    View full-size slide

  38. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    38
    • +40/31$#BUDISFRSFTͷྫ
    • ௨৴ͱϦΫΤετ͕O
    client server
    connec+on
    req
    res

    View full-size slide

  39. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    39
    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ
    • Ұ౓ʹͨ͘͞ΜϦΫΤετΛૹΓ͍ͨλΠϛϯά
    • ෼ੳͷͨΊͷϢʔβͷૢ࡞ϩάΛ͹͠͹͠ૹΓ͚͍ͭͨͳͲ

    View full-size slide

  40. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    40
    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ
    • ෳ਺ͷॲཧΛ૊Έཱͯ΍͍͢ɾίʔυͷ࠶ར༻ੑ͕ߴ·Δ
    • ରԠ͢ΔॲཧΛಠཱͤͯ͞ॻ͍͓͍ͯͯɺϦΫΤετΛ૊ΈཱͯΔ
    A
    B
    C
    A
    C
    req
    res

    View full-size slide

  41. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    41
    • ͜Μͳͱ͖ʹ͋͠Θͤ!αʔόαΠυ
    • ෳ਺ͷॲཧΛ૊Έཱͯ΍͍͢
    • ʮ"ͱ#Λ͢ΔΤϯυϙΠϯτʯʮ"ͱ#ͱ$Λ͢ΔΤϯυϙΠϯτʯͳΜͯ෼͚
    ͯఏڙ͠ͳͯ͘Α͘ͳΔ
    POST  /xxx A,  B
    POST  /yyy A,  B,  C
    [{method:  “A”},
    {method:  “B”},
    {method:  “C”}]
    A
    B
    C

    View full-size slide

  42. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    42
    • ͜Μͳͱ͖ʹ͋͠Θͤ!Ϣʔβ
    • ෳ਺SFRSFTΛ·ͱΊͯૹΕΔ͔Βɺ௨৴ίετ͕Լ͕Δ
    • όοΫΤϯυଆͰॏͨ͗͢Δॲཧ͕૸ΔϦΫΤετΛࠞͥͳ͍ͳͲɺ౰વ޻෉
    ͸ඞཁͳ΋ͷͷɺମײ࣌ؒ͸͙ͬͱ୹͘ͳΔ͸ͣʂ

    View full-size slide

  43. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    43
    • ֤ݴޠͷ࣮૷ঢ়گ
    • +40/31$ͦͷ΋ͷͷ$MJFOU4FSWFS࣮૷͸ଟ͍΋ͷͷɺ#BUDIʹ
    ରԠ͍ͯ͠ͳ͍΋ͷ͕ଟ͍
    • J04ͷ௨৴ϥΠϒϥϦ୅ද֨"'/FUXPSLJOH ͱɺ"'+40/31$$MJFOU
    ΋
    #BUDIʹରԠ͍ͯ͠ͳ͍
    • ࢀߟIUUQFOXJLJQFEJBPSHXJLJ+40/31$*NQMFNFOUBUJPOT

    View full-size slide

  44. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ͪΐͬͱدΓಓ
    44

    View full-size slide

  45. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    νϥγϧ
    45
    • ؔ౦ݍͷεʔύʔͷνϥγ৘ใ͔Β
    ಛച৘ใͷνΣοΫ΍͓ͶͩΜͷൺֱ͕Ͱ͖ͪΌ͏ΞϓϦ

    View full-size slide

  46. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    νϥγϧ
    46
    ʊਓਓਓਓਓਓਓʊ
    ʼɹಥવͷએ఻ɹʻ
    ʉ:?:?:?:?:?:ʉ

    View full-size slide

  47. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    νϥγϧ
    47
    • +30/31$#BUDIΛ࢖ͬͯαʔόαΠυͱ΍ΓͱΓ͍ͯ͠Δ
    • $34+40/31$$MJFOUCZ!TJOUBSJP

    View full-size slide

  48. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    $34+40/31$$MJFOU
    48
    • +40/31$#BUDIʹରԠͨ͠"1*$MJFOU
    • ϦΫΤετͦͷ΋ͷͱରԠ͢Δ3FRVFTU*%ͷ࠾൪ɺ؅ཧ
    • "'/FUXPSLJOHͷ͏͑ʹ৐͔͍ͬͬͯ·͢
    • /463-4FTTJPOϕʔε
    • J04Ή͚ʹ/463-$POOFDUJPOϕʔε΋͋ΔΑʂ

    View full-size slide

  49. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    $34+40/31$$MJFOU
    49
    • HJUIVCDPNʹͯۙ೔ެ։༧ఆʂ
    • 'PSL*U

    View full-size slide

  50. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    +40/31$#BUDI
    50
    • σϞ

    View full-size slide

  51. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ͜͜Ͱ͓͞Β͍
    51
    • γεςϜ౎߹Ϣʔβ౎߹
    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍
    • ૹ৴தͱ͔
    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ

    View full-size slide

  52. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϏϑΥʔΞϑλʔ
    52
    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍
    • #BUDI3FRVFTUʹΑΔSFRSFTͷߴ଎Խ

    View full-size slide

  53. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϏϑΥʔΞϑλʔ
    53
    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍
    • #BUDI3FRVFTUʹΑΔSFRSFTͷߴ଎Խ
    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ
    • αʔϏεɾϓϩμΫτͦͷ΋ͷʹϑΥʔΧεͰ͖Δ؀ڥ͕੔͍ͭͭ͋Δ

    View full-size slide

  54. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ϏϑΥʔΞϑλʔ
    54
    • ʮϢʔβͷͨΊͷཧ૝ʯʹۙͮ͘؀ڥ͸੔͍ͭͭ͋Δ

    View full-size slide

  55. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ࠓ೔Ͱ͖ͳ͔͓ͬͨ͸ͳ͠
    55
    • QSPTDPOTͰ͍͏ͱ͜ΖͷDPOTͷ͓͸ͳ͠
    • .#BB4ಋೖ࣌ͷݒ೦
    • αʔϏε͕ؒʹͻͱͭ͸͞·Δ͝ͱʹɺͦΕʹҾ͖ͣΒΕΔϦεΫ͕ੜ͡Δ
    • ͓ͻͬ͜͠͸ʁ
    • #BUDI3FRVFTUΛ࢖͏΂͖Ͱͳ͍έʔε
    • αʔόαΠυଆͰ΍ͨΒॏ͍ͨॲཧΛڬΉඞཁ͕͋Δͱ͔
    • TJOUBSJPࢯʮΫϥΠΞϯταΠυɾαʔόαΠυͱີʹ࿈ܞͰ͖Δͱ͖ʹ࢖Θͳ
    ͍ͱ͜Θ͍ΑͶʜʯ

    View full-size slide

  56. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved.
    ͓ΘΓ
    56

    View full-size slide