Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GraphQL distribution

297 views

Published on

Distributing GraphQL API using API gateway and CDNs to the whole world including very distant countries in Africa. Talk taken on #GraphQLEU

Published in: Software
  • Be the first to comment

GraphQL distribution

  1. 1. Copyright © 2017 iflix. All rights reserved.1 In global scale GRAPHQL API DISTRIBUTION
  2. 2. Copyright © 2017 iflix. All rights reserved.2 JAKUB RIEDL Software Engineer @iflix lead of GraphQL project
  3. 3. Copyright © 2017 iflix. All rights reserved.3 ● Redefine television for 1 billion people ● Global video-on-demand platform for emerging markets ● Hollywood, Bollywood, Nollywood, Korean, local content and much more ● Different technical challenges than in 1st world countries ● Partners with TELCO to supply service in mobile data package IFLIX
  4. 4. Copyright © 2017 iflix. All rights reserved.4 IFLIX REGIONS
  5. 5. Copyright © 2017 iflix. All rights reserved.5 WHERE IS THE CATCH?
  6. 6. Copyright © 2017 iflix. All rights reserved.6 IFLIX REGIONS
  7. 7. Copyright © 2017 iflix. All rights reserved.7 AWS DATA CENTERS
  8. 8. Copyright © 2017 iflix. All rights reserved.8 CLIENT APPLICATIONS ● Web ● Android (Mobile) ● iOS ● Android TV & STBs ● 2x Samsung TV ● 2x LG TV ● Roku ● Alibaba TV ● …
  9. 9. Copyright © 2017 iflix. All rights reserved.9 ● 20+ engineering teams working on new features ● In 4 different timezones ● New features every day ● Ongoing refactoring ● Lot of shortcuts in early stage we need to deal with RAPIDLY CHANGING BUSINESS
  10. 10. Copyright © 2017 iflix. All rights reserved.10 LOAD 130k 4+m Asia’s fastest growing Internet TV service NOW ? 1b VISION USERS REQ / MIN
  11. 11. Copyright © 2017 iflix. All rights reserved.11 ● Video data are easy(-ish) with CDN ● Catalogue is quite static and for all users ● Personalized collections are per group of users but still quite static ● Watch history is dynamic and strictly private ● DRM works with one time key which cannot be cached STRUCTURE OF DATA
  12. 12. Copyright © 2017 iflix. All rights reserved.12 LET’S DO IT!
  13. 13. Copyright © 2017 iflix. All rights reserved.13 NAIVE APPROACH MICROSERVICE - A MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D
  14. 14. Copyright © 2017 iflix. All rights reserved.14 NAIVE APPROACH MICROSERVICE - A MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D
  15. 15. Copyright © 2017 iflix. All rights reserved.15 STATIC CONTENT CDN MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D STATIC DATA GENERATOR
  16. 16. Copyright © 2017 iflix. All rights reserved.16 STATIC CONTENT CDN MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D STATIC DATA GENERATOR distance from user
  17. 17. Copyright © 2017 iflix. All rights reserved.17 LAST MILE SCALABILITY FLEXIBILITY MAINTAINABILITY
  18. 18. Copyright © 2017 iflix. All rights reserved.18 LAST MILE GOOD SCALABILITY FLEXIBILITY MAINTAINABILITY
  19. 19. Copyright © 2017 iflix. All rights reserved.19 LAST MILE GOOD SCALABILITY EXCELLENT FLEXIBILITY MAINTAINABILITY
  20. 20. Copyright © 2017 iflix. All rights reserved.20 LAST MILE GOOD SCALABILITY EXCELLENT FLEXIBILITY BAD MAINTAINABILITY
  21. 21. Copyright © 2017 iflix. All rights reserved.21 LAST MILE GOOD SCALABILITY EXCELLENT FLEXIBILITY BAD MAINTAINABILITY BAD
  22. 22. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY Integration Layer Authentication Evolving Schema 22 WELCOME GRAPHQL! STATIC DATA MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D
  23. 23. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY Integration Layer Authentication Evolving Schema 23 SCHEMA EVOLUTION STATIC DATA MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D MICROSERVICE - D v1 v2
  24. 24. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY Integration Layer Authentication Evolving Schema 24 SCHEMA EVOLUTION STATIC DATA MICROSERVICE - B MICROSERVICE - C MICROSERVICE - D v2
  25. 25. Copyright © 2017 iflix. All rights reserved.25 LAST MILE SCALABILITY FLEXIBILITY MAINTAINABILITY
  26. 26. Copyright © 2017 iflix. All rights reserved.26 LAST MILE BAD SCALABILITY FLEXIBILITY MAINTAINABILITY
  27. 27. Copyright © 2017 iflix. All rights reserved.27 LAST MILE BAD SCALABILITY NOT GOOD FLEXIBILITY MAINTAINABILITY
  28. 28. Copyright © 2017 iflix. All rights reserved.28 LAST MILE BAD SCALABILITY NOT GOOD FLEXIBILITY EXCELLENT MAINTAINABILITY
  29. 29. Copyright © 2017 iflix. All rights reserved.29 LAST MILE BAD SCALABILITY NOT GOOD FLEXIBILITY EXCELLENT MAINTAINABILITY EXCELLENT
  30. 30. Copyright © 2017 iflix. All rights reserved.30 ● Bring data as close to user as possible ● Caching ● Infrastructure independent ● Docker + Kubernetes ● TELCO partners LAST MILE GRAPHQL GATEWAY
  31. 31. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY 31 CACHING DATACENTER 1x 10x Up to 400ms on every request
  32. 32. Copyright © 2017 iflix. All rights reserved. PUBLIC @CDN GRAPHQL GATEWAY 32 CACHING DATACENTER 1x 3x 7x
  33. 33. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY 33 CACHING DATACENTER 1x 2x PUBLIC @CDN 7x PERSONALIZED @CDN 1x
  34. 34. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY 34 CACHING DATACENTER 1x 1x PUBLIC @CDN 7x PERSONALIZED @CDN 1x 1x Private
  35. 35. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY 35 CACHING DATACENTER 1x 1x PUBLIC @CDN 7x PERSONALIZED @CDN 1x 1x Private
  36. 36. Copyright © 2017 iflix. All rights reserved.36 LAST MILE SCALABILITY FLEXIBILITY MAINTAINABILITY
  37. 37. Copyright © 2017 iflix. All rights reserved.37 LAST MILE EXCELLENT SCALABILITY FLEXIBILITY MAINTAINABILITY
  38. 38. Copyright © 2017 iflix. All rights reserved.38 LAST MILE EXCELLENT SCALABILITY GOOD FLEXIBILITY MAINTAINABILITY
  39. 39. Copyright © 2017 iflix. All rights reserved.39 LAST MILE EXCELLENT SCALABILITY GOOD FLEXIBILITY EXCELLENT MAINTAINABILITY
  40. 40. Copyright © 2017 iflix. All rights reserved.40 LAST MILE EXCELLENT SCALABILITY GOOD FLEXIBILITY EXCELLENT MAINTAINABILITY EXCELLENT
  41. 41. Copyright © 2017 iflix. All rights reserved. GRAPHQL GATEWAY 41 CACHING 1x PUBLIC @CDN 7x PERSONALIZED @CDN 1x 1x Private CACHING CDN
  42. 42. Copyright © 2017 iflix. All rights reserved.42 LAST MILE EXCELLENT SCALABILITY EXCELLENT FLEXIBILITY EXCELLENT MAINTAINABILITY EXCELLENT
  43. 43. Copyright © 2017 iflix. All rights reserved.43 ● Integration layer using GraphQL gateway ● Continuously evolving schema ● Static everything what is possible ● Caching within gateway ● Controlled using HTTP headers ● Gateway in region = data as close to user as possible SUMMARY
  44. 44. Copyright © 2017 iflix. All rights reserved. ● jakubriedl.com ● @jakubriedl ● jakubriedl ● jakubriedl ● @jakubriedl 44 GET IN TOUCH

×