API Design Optimized for Mobile Platform

8327d09b0bd5ac97409aa10f927b3c30?s=47 Gea-Suan Lin
October 28, 2012

API Design Optimized for Mobile Platform

Speaker: Gea-Suan Lin (@gslin), KKBOX Inc.
Topic: API Design Optimized for Mobile Platform
Conference: MOPCON 2012 (in Kaohsiung, Taiwan)

How to design API optimized for mobile platform.

8327d09b0bd5ac97409aa10f927b3c30?s=128

Gea-Suan Lin

October 28, 2012
Tweet

Transcript

  1. API Design Optimized for Mobile Platform Gea-Suan Lin KKBOX, Inc.

  2. KKBOX

  3. Mobile Platform

  4. Mobile Network Mobile Device

  5. Compare to Landline

  6. Network Part

  7. Speed

  8. Reliability

  9. Latency

  10. Device Part

  11. It’s much slower.

  12. So,

  13. To adopt mobile environment,

  14. We care about these two different faces

  15. Client Modification

  16. Server Modification

  17. API Modification

  18. First, Merge Operations

  19. Reduce Connections

  20. POST /login username= password= GET /check-version GET /rank/album/top100 GET /rank/song/top100

    GET /rank/artist/top100
  21. Merge to...

  22. POST /login username= password= extra=check-version,rank-album- top100,rank-song-top100,rank-artist- top100

  23. It’s dirty.

  24. But it’s much efficient.

  25. Second, Operation with Strict-Increasing Serial

  26. Avoid Duplicate API Call

  27. POST /mybox/room/1/ message message= serial=

  28. Use database to store the serial of each device.

  29. Third, Multiple Objects Design

  30. Reduce Client CPU Resource

  31. And Reduce Connections

  32. GET /song/ 1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15,16,17,18,19, 20

  33. Fourth, Filter Results

  34. Reduce Traffic

  35. Reduce Client CPU Resouce

  36. GET /song/ 1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15,16,17,18,19, 20/name

  37. Then...

  38. Fifth, Compression

  39. Reduce Traffic

  40. Sixth, Use Port 80 & 443

  41. Reduce Firewall Issue

  42. Thank You!