News for hackers. Stuff that matters.
Re:What is a CDN? How do CDNs work? by diceduckmonk on Wednesday February 08, 2023 @02:46AM (#34705323)
The CDN jargon became less magical when I realized CloudFlare was just a tuned and managed NGINX-as-a-service.

Edit: didn't even realize the F is Cloudflare has since been lowercased: https://blog.cloudflare.com/end-of-the-road-for-cloudflare-n....

Re:What is a CDN? How do CDNs work? by dgb23 on Wednesday February 08, 2023 @03:26AM (#34705570)
From the article all I gathered was that you’re essentially right.

In more general terms:

A distributed reverse proxy with sensible defaults for caching.

Even though it doesn’t sound like much, it’s pretty cool and useful.

One of the things in ops that can be hard and expensive is any kind of high availability. Say you’re restarting your origin server regularly after pushing new code.

Depending on your use case, it might just be enough to have exactly two well provisioned web servers (VM/dedicated) and maybe one DB server. Then put a CDN in front of it and voila, high availability reads.

Re:What is a CDN? How do CDNs work? by animesh371g on Wednesday February 08, 2023 @03:39AM (#34705658)
Much of the ops related to high availability is also abstracted now since Cloud is extensively used and managed solutions are employed instead of having bare metal deployments. The era before cloud was radically different, now we don't hear the word downtime so often.
Re:What is a CDN? How do CDNs work? by dgb23 on Wednesday February 08, 2023 @03:51AM (#34705757)
If you care mostly about reads, the above setup can be operationally simpler and likely more cost effective and agnostic than a full suite of Cloud products.
Re:What is a CDN? How do CDNs work? by animesh371g on Wednesday February 08, 2023 @03:57AM (#34705798)
Yes, depends on the product that is being built and the traffic it is going to server. In case it's not a high traffic website, we can definitely bypass Cloud. In my stint at a startup, we were directly serving the content via Nginx instead of CDN. Our scope was limited to only country and the use case was also simple, just to display a transaction page with few images to the customers.
Re:What is a CDN? How do CDNs work? by animesh371g on Wednesday February 08, 2023 @03:10AM (#34705467)
That is correct. Internally, it's a high performing web server to return the static content at speed. In addition, the websites get additional functionality such as DDOS protection out of the box by leveraging CDNs.
Re:What is a CDN? How do CDNs work? by astrange on Wednesday February 08, 2023 @04:15AM (#34705892)
Well, it was that once. It's certainly got a lot more features now.
Re:What is a CDN? How do CDNs work? by amelius on Wednesday February 08, 2023 @04:17AM (#34705910)
I'm betting they don't just use NGINX, but also specialized hardware.
Re:What is a CDN? How do CDNs work? by comprev on Wednesday February 08, 2023 @05:22AM (#34706311)
Cloudflare has an article on introducing specialist hardware to their stack [0]

[0] https://blog.cloudflare.com/asics-at-the-edge/

Re:What is a CDN? How do CDNs work? by sophacles on Wednesday February 08, 2023 @11:58AM (#34710921)
Not the same type of specialized "CDN Hardware" that was implied in the parent, this is just "big network" customization at the packet forwarding layer.
Re:What is a CDN? How do CDNs work? by bosch_mind on Wednesday February 08, 2023 @09:52AM (#34708782)
They don’t use NGINX anymore
Re:What is a CDN? How do CDNs work? by AdamN on Wednesday February 08, 2023 @05:24AM (#34706323)
With multicast IPs too - that's the other critical component.
Re:What is a CDN? How do CDNs work? by pjc50 on Wednesday February 08, 2023 @06:16AM (#34706658)
It's free bandwidth as well. That's a fairly huge part of the deal.
Re:What is a CDN? How do CDNs work? by kentonv on Wednesday February 08, 2023 @11:08AM (#34710058)
It's more like Cloudflare forked nginx a long time ago, and is meanwhile in the very slow (like, decade-long) process of replacing it entirely.

The Cloudflare Workers Runtime∗, for instance, is built directly around V8; it does not use nginx or any other existing web server stack. Many new features of Cloudflare are in turn built on Workers, and much of the old stack build on nginx is gradually being migrated to Workers. https://workers.dev https://github.com/cloudflare/workerd

In another part of the stack, there is Pingora, another built-from-scratch web server focused on high-performance proxying and caching: https://blog.cloudflare.com/how-we-built-pingora-the-proxy-t...

Even when using nginx, Cloudflare has rewritten or added big chunks of code, such as implementing HTTP/3: https://github.com/cloudflare/quiche And of course there is a ton of business logic written in Lua on top of that nginx base.

Though arguably, Cloudflare's biggest piece of magic is the layer 3 network. It's so magical that people don't even think about it, it just works. Seamlessly balancing traffic across hundreds of locations without even varying IP addresses is, well, not easy.

I could go on... automatic SSL certificate provisioning? DDoS protection? etc. These aren't nginx features.

So while Cloudflare may have gotten started being more-or-less nginx-as-a-service I don't think you can really call it that anymore.

∗ I'm the tech lead for Cloudflare Workers.