I was reading up on CDNs and found that they help in lowering bandwidth costs on origin server. So, why is bandwidth cost on CDNs less than bandwidth cost on origin servers?
I understand that they serve traffic from edge servers, so load on origin server is reduced a lot. So, for hosting my origin server, I need to pay less on bandwidth costs of my origin server. But even the edge servers would incur bandwidth costs. I need to pay AWS CloudFront or some CDN provider for using their POPs. Their hardware should also incur the same bandwidth costs that my origin server does, shouldn't it? The only difference I seem to gauge is that using CDNs less network hops are required in IP layer as origin server might be quite far from user. This might save network costs that the ISP of the user concurs. But how does this translate into cost saving for server, that I don't understand.
Yes, it is true that CDNs incur their own bandwidth costs for serving content from their edge servers, but they can negotiate lower bandwidth prices because of their large scale and relationships with ISPs.
As you mentioned, CDNs can reduce network hops and improve delivery speed because content is closer to the end users. This also has a cost-saving effect on the server owner because they need to pay less for network usage charges.
CDNs also reduce your server load, allowing you to handle more traffic with a smaller server, which can also reduce your costs.
You can check prices of some popular CDN providers like Cloudflare, Fastly, and Google CDN and calculate whether is it better in your case.
Here is a list of some other CDN benefits: