Cloudflare (NET -3.18%) is best known for speeding up its customers' applications and protecting them from hackers and attacks. The company's global network sits between a website visitor and a customer's infrastructure, protecting that infrastructure from being overloaded with malicious traffic and caching content close to the user.
Cloud computing has been a revolution for developers, allowing virtual servers and storage to be quickly provisioned and scaled with ease. If a developer wants to build an application, they can go to Amazon (NASDAQ: AMZN) Web Services and have infrastructure ready to go in a few minutes.
The downside of this approach is that code and data are executed and stored in one place. AWS and other major cloud providers are split into regions, and your application is generally going to live in one of those regions. If someone visits your website from California and you're using one of AWS's regions on the East Coast, requests are going to be flying across the country. It's a fast process, but it's not instantaneous.
Cloudflare's core products help with this situation by allowing some of those requests to be served from cached data at one of its more than 200 locations around the world. Bringing the data closer to the user reduces the time it takes to retrieve that data, speeding up website load times and providing a better user experience. This is edge computing in a nutshell.
Becoming a full-fledged development platform
While Cloudflare works great as a middleman, the company has greater ambitions. Over the past few years, Cloudflare has been building out a set of products that make it capable of eliminating cloud giants like AWS from the picture entirely. The company's developer platform has some shortcomings and isn't for everyone, but it's a powerful alternative to the traditional cloud computing model.
Cloudflare Pages is the first piece of Cloudflare's solution. Pages allows developers to host static websites on Cloudflare's global network. It works the same as other serverless platforms like Netlify. A developer pushes a change to their codebase to GitHub, then Cloudflare picks up that change, rebuilds the website, and deploys it within a couple of minutes.
A static website on its own can't do much other than display fixed content. The second part of Cloudflare's solution, Cloudflare Workers, tackles making those websites dynamic. Workers are pieces of code that live and run in all Cloudflare's data centers. Instead of a virtual server handling requests from one place, a Cloudflare Worker runs on whatever data center is closest to the user. Putting this code on the edge makes response times lighting fast.
The third part of Cloudflare's solution is storage. Typically, an application needs a database of some kind to store user data. Cloudflare doesn't offer a database of its own, but it gets close with Workers KV and Durable Objects. These storage products don't support complex queries like MongoDB, but they work well for basic use cases.
Beyond databases, applications usually need to store images, videos, and other big pieces of content. Amazon S3 is a popular way to do that, but costs can quickly get out of control. Amazon charges for storage and bandwidth, so serving images to millions of website visitors can really run up your cloud computing bill.
Cloudflare's latest storage product, R2, aims to replace Amazon S3 at a much lower cost. R2 will only charge for storage when it comes out of beta. For S3 users that eat up a lot of bandwidth, switching to R2 can dramatically cut costs.
Cloudflare now offers developers most of what they need to build a full application. They can host their websites, add a serverless backend with Workers, and persist and store data with Cloudflare's storage products. And because all of this is happening close to the user, performance is impressive.
Cloudflare's approach does have some limitations. The biggest one may be the inability of Workers to easily connect to popular databases like MongoDB. Many database connections use a protocol that Workers don't currently support, so something that's dead simple on other cloud platforms is impossible on Cloudflare without putting a middleman between a Worker and the database.
Despite the limitations, Cloudflare is a compelling option for developers. The company's platform can lower costs compared to AWS, and it can provide extreme performance thanks to its many locations around the world. Pricing is also much simpler on Cloudflare compared to the Kafkaesque pricing calculators that are part of any AWS user's life.
AWS has its own edge computing products, but the platform is geared toward the traditional cloud computing model. Cloudflare, in contrast, is an edge-first company. While Cloudflare doesn't offer anywhere close to the number of features offered by AWS, Amazon should certainly be worried as more developers discover the benefits of moving compute and storage to the edge.