WebSDK : Switching b/w service providers on the fly.
Submitted by NISHI JAIN (@nishij) on Thursday, 31 January 2019
Technical level: Intermediate
We are familiar with the service layer in web applications. We all maintain it. But how about developing a service layer that has multiple providers for a single service. The client can choose between different providers. Let’s say, X is a service provider that does n different tasks in an application, we want to replace X with Y, but Y is still in development. This process of replacement has to be incremental. We replace X with Y, one task at a time and once Y successfully takes up all n tasks, we kill X.
Sounds interesting ? Have you done it before ? We have done it in Hotstar.
WebSDK is the service layer of an application that can be integrated with multiple clients. This web-sdk implementation has several challenges and solves multiple problems. I will be discussing these challenges and the problems it solve in detail.
This talk is about sharing an experience that I had while solving a challenging problem. While discussing about the service layer in the application I will cover following important areas:
1. Caching at the service layer
2. Chunking (Creating different chunks for server and browser)
3. Adapters (Maitaining a common response format b/w providers for the clients)
4. Handling Error codes
5. Test cases
6. Switching b/w different service providers. How does client chooses the service provider?
7. How is the service layer integrated in the web application ?
Nishi Jain, a Software Engineer at Hotstar with 4.5 years of experience. I am currently working on a powerful tool that manages content and empowers client facing apps in multiple geographies. I like to solve challenging problems and try to keep myself updated with latest updates in the tech-world.