More Related Content
Similar to GraphQL distribution (20)
GraphQL distribution
- 1. Copyright © 2017 iflix. All rights reserved.1
In global scale
GRAPHQL API DISTRIBUTION
- 2. Copyright © 2017 iflix. All rights reserved.2
JAKUB RIEDL
Software Engineer @iflix
lead of GraphQL project
- 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
- 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. 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. 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. 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
- 13. Copyright © 2017 iflix. All rights reserved.13
NAIVE APPROACH
MICROSERVICE - A
MICROSERVICE - B
MICROSERVICE - C
MICROSERVICE - D
- 14. Copyright © 2017 iflix. All rights reserved.14
NAIVE APPROACH
MICROSERVICE - A
MICROSERVICE - B
MICROSERVICE - C
MICROSERVICE - D
- 15. Copyright © 2017 iflix. All rights reserved.15
STATIC CONTENT
CDN
MICROSERVICE - B
MICROSERVICE - C
MICROSERVICE - D
STATIC DATA GENERATOR
- 16. Copyright © 2017 iflix. All rights reserved.16
STATIC CONTENT
CDN
MICROSERVICE - B
MICROSERVICE - C
MICROSERVICE - D
STATIC DATA GENERATOR
distance from user
- 17. Copyright © 2017 iflix. All rights reserved.17
LAST MILE
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 18. Copyright © 2017 iflix. All rights reserved.18
LAST MILE GOOD
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 19. Copyright © 2017 iflix. All rights reserved.19
LAST MILE GOOD
SCALABILITY EXCELLENT
FLEXIBILITY
MAINTAINABILITY
- 20. Copyright © 2017 iflix. All rights reserved.20
LAST MILE GOOD
SCALABILITY EXCELLENT
FLEXIBILITY BAD
MAINTAINABILITY
- 21. Copyright © 2017 iflix. All rights reserved.21
LAST MILE GOOD
SCALABILITY EXCELLENT
FLEXIBILITY BAD
MAINTAINABILITY BAD
- 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. 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. 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. Copyright © 2017 iflix. All rights reserved.25
LAST MILE
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 26. Copyright © 2017 iflix. All rights reserved.26
LAST MILE BAD
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 27. Copyright © 2017 iflix. All rights reserved.27
LAST MILE BAD
SCALABILITY NOT GOOD
FLEXIBILITY
MAINTAINABILITY
- 28. Copyright © 2017 iflix. All rights reserved.28
LAST MILE BAD
SCALABILITY NOT GOOD
FLEXIBILITY EXCELLENT
MAINTAINABILITY
- 29. Copyright © 2017 iflix. All rights reserved.29
LAST MILE BAD
SCALABILITY NOT GOOD
FLEXIBILITY EXCELLENT
MAINTAINABILITY EXCELLENT
- 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. Copyright © 2017 iflix. All rights reserved.
GRAPHQL
GATEWAY
31
CACHING
DATACENTER
1x 10x
Up to 400ms on every request
- 32. Copyright © 2017 iflix. All rights reserved.
PUBLIC @CDN
GRAPHQL
GATEWAY
32
CACHING
DATACENTER
1x 3x
7x
- 33. Copyright © 2017 iflix. All rights reserved.
GRAPHQL
GATEWAY
33
CACHING
DATACENTER
1x 2x
PUBLIC @CDN
7x
PERSONALIZED @CDN
1x
- 34. Copyright © 2017 iflix. All rights reserved.
GRAPHQL
GATEWAY
34
CACHING
DATACENTER
1x 1x
PUBLIC @CDN
7x
PERSONALIZED @CDN
1x
1x Private
- 35. Copyright © 2017 iflix. All rights reserved.
GRAPHQL
GATEWAY
35
CACHING
DATACENTER
1x 1x
PUBLIC @CDN
7x
PERSONALIZED @CDN
1x
1x Private
- 36. Copyright © 2017 iflix. All rights reserved.36
LAST MILE
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 37. Copyright © 2017 iflix. All rights reserved.37
LAST MILE EXCELLENT
SCALABILITY
FLEXIBILITY
MAINTAINABILITY
- 38. Copyright © 2017 iflix. All rights reserved.38
LAST MILE EXCELLENT
SCALABILITY GOOD
FLEXIBILITY
MAINTAINABILITY
- 39. Copyright © 2017 iflix. All rights reserved.39
LAST MILE EXCELLENT
SCALABILITY GOOD
FLEXIBILITY EXCELLENT
MAINTAINABILITY
- 40. Copyright © 2017 iflix. All rights reserved.40
LAST MILE EXCELLENT
SCALABILITY GOOD
FLEXIBILITY EXCELLENT
MAINTAINABILITY EXCELLENT
- 41. Copyright © 2017 iflix. All rights reserved.
GRAPHQL
GATEWAY
41
CACHING
1x
PUBLIC @CDN
7x
PERSONALIZED @CDN
1x
1x Private
CACHING CDN
- 42. Copyright © 2017 iflix. All rights reserved.42
LAST MILE EXCELLENT
SCALABILITY EXCELLENT
FLEXIBILITY EXCELLENT
MAINTAINABILITY EXCELLENT
- 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. Copyright © 2017 iflix. All rights reserved.
● jakubriedl.com
● @jakubriedl
● jakubriedl
● jakubriedl
● @jakubriedl
44
GET IN TOUCH