We are India’s digital payments and leading financial services company that offers full-stack payments and financial solutions to consumers, offline merchants and online platforms. We are on a mission to bring half a billion Indians into the mainstream economy through our payments, commerce, banking, investments, and financial services.
Being a tech-first company, we are leveraging the Content Delivery Network (CDN) heavily to serve our customers. For this, we have improved the Edge Engineering through CDN optimization.
CDN is a globally distributed network of servers that store (commonly referred as ‘cache’) and deliver some or all of their website’s content. Each of these servers in the CDN’s network is called a Point of Presence (PoP) or an edge server. Instead of delivering the website resources directly from the website server, it is delivered through PoPs.
When the user accesses our website, instead of getting the resources from the website server in Mumbai, the user gets them from the CDN server that is closer to him. Geographically, the user and the CDN server that responds to the user’s request are just a few miles apart, which reduces the time taken to load the resource significantly. The page loads faster and your users are happy.
Other Functions of CDN
There are other benefits as well, some that are implicit to using a CDN and some that are used by slightly larger and technologically advanced organizations.
Increasing Availability: This is an automatic result of using any CDN. For simplicity, availability can be considered a simple measure of how long the website and its functions remain accessible in a given period.
Usually, when the users are serving content from their servers, they need to add more servers as the traffic goes up. If there is an unexpected issue with the server or a database, it could take the application down.
With a CDN coming into the picture, it does two things; One, a lot of traffic doesn’t even come to their servers. The edge server of the CDN serves a lot of content from its cache. So, they need a slightly fewer number of servers.
Second, as long as the content is available in the CDNs cache, even if the actual servers are not working, the CDN will keep serving the content. This gives the user some buffer time to fix issues on their servers while the CDN serves whatever content it can from its cache.
Website Security: This is a more advanced use of CDNs that is generally used by larger companies. Since the CDN PoP or edge server is now the first layer in the system which accepts incoming traffic, it also becomes the first line of defense against attacks on your website.
Now, if a CDN can isolate bad traffic from good traffic, it can stop all the bad traffic from coming to their servers. The servers only respond to the “good” requests coming from actual users.
Website security is a vast topic in itself and beyond the scope of this blog. But, there are certain features like blocking access on non-HTTP ports, which are a standard feature in all CDNs and help provide basic security. Such features are accessible to everyone.
Then there are more advanced features like Bot Protection, Web Application Firewall (WAF), DDoS protection, etc. that are available as add-ons in certain CDNs. Such add-ons are usually expensive, and configuring them takes time and effort too. Therefore, they are used by a select few companies who face such challenges and can afford to deploy more expensive customized solutions.
SEO Improvement: Google and other search engines prefer fast and efficient websites. Speed is the most important Google SEO ranking factor. Better the speed, the higher a website can appear in search. So, therefore, more leads and sales it can acquire.
User Experience: The final point, of course, is customer experience. Having a great website that loads quickly helps the visitors get what they want quicker. With a CDN, the website will load quicker and be more reliable; it won’t crash easily. With a website that has great performance, it will create a better retention rate and a better conversion rate. All this is good news if the user is the business website owner.
We serve a few trillion CDN hits yearly to provide a better experience to hundred million customers by providing faster page loading, image transformation, delivering high-quality content and so on. This helps us in providing better mobile and website performance.
Here is how we are leveraging all capabilities of CDN such as HTTP2, Brotli, Caching, Image Transformation, Content Optimisation, and many more which make us much faster to server our customers.
HTTP2 Protocol Enablement: We have enabled the HTTP2 protocol, which gives 2x better performance over HTTP1, provides a faster customer experience, and is more reliable. The HTTP 2.0 can reduce fully loaded page load time (TTLB) by more than 45%.
Brotli Compression: The abundance of Android phone users is significantly higher in the Indian subcontinent. Additionally, average hardware and limited network availability make every byte count. Brotli, an open-source compression algorithm developed by Google, helps us overcome this hurdle.
Brotli compression came out significantly faster with a 20-26% increase in compression ratio for text-based data like Js, JSON, etc, as compared to Gzip. The less download size helps to reduce overall website loading response time, and sites are accessible even with low internet bandwidth.
Dynamic Caching: A globally distributed CDN network takes help of edge servers. For a high tracsacting service (few million hits in a minute), CDN calls to backend servers is reduced by more than 99% due to the addition of dynamic caching to the edge servers. This also contributed to the reduced customer latency by 80% (500ms to 100ms) and reduced backend infra cost by 95%. The same phenomenon was implemented across many other services.
Security: Security is of utmost priority for us. Therefore, we use the Web Application Firewall (WAF) solution of CDN to boost our security posture and provide secure and safe transactions. A WAF creates a shield between a web app and the Internet, and this helps mitigate many common attacks.
Global Traffic Manager (GTM): We are using the GTM feature to continuously serve our customers even if one of the sites is unavailable, which provides more reliability for our platform. Therefore we always say “Paytm Karo”.
Images/Video Manager: We also use CDN Image/Video transformation capability to display images on different devices or mobiles with better quality.
Cost optimization: We are focused on effective and efficient ways of using managed services. Hence, we did some architectural/configuration changes and our annual cost is reduced by a few crores due to the deprecation of a considerable amount of backend infrastructure components.
The blog was contributed by the Infra Technology Lab at Paytm. Want to be a part of Paytm? Explore our career opportunities here.