Cloud storage is a vital service for developers who need to store and access large amounts of data on the cloud. However, choosing the right cloud storage provider can be challenging, as there are many factors to consider, such as pricing, performance, reliability, compatibility, and features.
In this article, we will compare two popular cloud storage services: Cloudflare R2 and AWS S3. We will look at the similarities and differences between these two services in terms of their pricing, performance, reliability, compatibility, and features. Let’s get started!
What Is AWS S3?
AWS S3 is short for a simple storage solution, it is a cloud-based service that stores data. It lets you store and access any amount of data over the internet. Data is stored in buckets, you can create buckets to organize your data and control who can access it. Customers are charged a monthly fee for storing their data and a network fee for each time it is requested over the internet.
S3 can be used to host static websites, backup files, archive data, and integrate with other AWS services. S3 is highly scalable, reliable, and secure – and above all, has a thriving ecosystem and community.
What is Cloudflare R2?
Cloudflare R2 is a cloud storage service that lets you store and access data over the internet. The most attractive feature of this service is the absence of network egress fees. However, customers are still charged a monthly fee for storing their data, changing it, and reading it. It is compatible with the S3 API, which means you can use existing tools and libraries to work with your data.
R2 can be integrated with Cloudflare Workers, a serverless platform that lets you run code at the edge. R2 is globally distributed and integrated with Cloudflare’s CDN, which makes it fast and reliable.
Cloudflare R2 vs AWS S3: Features Comparison
Both Cloudflare R2 and AWS S3 do not have a limit on the amount of data that can be stored in a bucket. You can store as much data as you like. However, there is a limit on the size of individual objects. A single object can be a maximum of 5 TB, and to upload files larger than 5GB, you have to use the multipart upload process.
AWS S3 offers a range of storage options for different use cases and performance requirements. The main storage options are:
- S3 Standard: This is the default storage option for frequently accessed data. It is suitable for cloud applications, dynamic websites, content distribution, and big data analytics. The first 50 TB of data costs $0.023 per GB every month.
- S3 Intelligent-Tiering: This is a storage option that automatically moves data to the most cost-effective access tier based on access frequency without performance impact or operational overhead. It is ideal for data with unknown or changing access patterns, such as long-lived data sets that are accessed infrequently but require rapid access when needed.
It has a complex pricing structure – Frequent, Infrequent, and Archive Instant Access Tier are all priced differently, starting at $0.023, $0.0125, and $0.004 per GB per month. In addition to this, customers are also charged a monitoring and automation fee for objects greater than 128 KB which costs $0.0025 per 1,000 objects.
- S3 Standard-Infrequent Access: This storage option is for less frequently accessed data that still needs to be available quickly when accessed. It is suitable for backups and disaster recovery. It costs $0.0125 per GB per month.
- S3 One Zone-Infrequent Access: This is similar to the above option except that S3 Standard-IA stores data across multiple Availability Zones, while S3 One Zone-IA stores data in a single Availability Zone and has a lower cost. It is more suitable for re-creatable data that is not important. This storage class is priced at $0.01 per GB.
- S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval (formerly S3 Glacier), and S3 Glacier Deep Archive: These are storage options for archiving data that is rarely accessed and does not require immediate access. They offer different retrieval times and costs depending on the urgency of the data access. They are suitable for long-term archiving and digital preservation of data.
For example, if you need to store a large number of logs for regulatory purposes, this is the right choice for it. Data stored in Instant Retrieval ($0.004/GB), Flexible Retrieval ($0.0036/GB), and Deep Archive ($0.00099/GB) can be accessed within a couple of milliseconds, or it can take up to 12 hours.
- S3 Outposts: This is a storage option for storing S3 data on-premises using AWS infrastructure. This service extends AWS infrastructure and services to customer sites. It is suitable for data residency requirements that cannot be met by an existing AWS Region and costs tens of thousands of dollars per month.
You can also use S3 Lifecycle policies to automatically transition objects between storage options. All the prices mentioned above are for the North Virginia region of AWS, the exact prices vary from region to region.
Cloudflare R2 provides only one storage class and does not change prices based on location. The first ten GB of storage, ten million read operations and one million write operations are free every month. Beyond the free limit, you can pay $0.015/GB for storage, $0.36, and $4.50 for a million write and read operations, respectively.
The buckets are created automatically in a region closest to you, you can suggest a suitable location for your bucket, but it is not guaranteed. The object life cycle feature (currently in beta) from Cloudflare can automatically delete objects that are older than a certain time period – this is great for reducing billing costs.
Cloudflare R2 encrypts your data at rest – all objects stored in R2, including their metadata, are encrypted at rest using AES-256. The encryption keys are stored and managed by Cloudflare internally. In addition to this, Cloudflare adheres to industry-standard security compliance certifications, such as SOC 2 Type II, PCI DSS Level 1, ISO 27001/27002, GDPR, and CCPA.
AWS S3 on the other hand offers far more flexibility. AWS S3 supports server-side encryption with three key management options: SSE-KMS, SSE-C, and SSE-S3, as well as client-side encryption. SSE-KMS allows you to use AWS Key Management Service (KMS) or your own customer master keys (CMKs) to encrypt your data. SSE-C allows you to provide your own encryption keys. SSE-S3 uses keys that are managed by S3 and protected by AWS KMS1. These options are not available in Cloudflare R2.
Although both Cloudflare and AWS use TLS to encrypt your data in transit, AWS takes it one step further by offering AWS PrivateLink, a service to establish a private connection between your VPC and S3 – this transfers your data without exposing it to the internet.
AWS S3 maintains compliance programs, such as PCI-DSS, HIPAA/HITECH, FedRAMP, EU Data Protection Directive, and FISMA, to help you meet regulatory requirements. AWS S3 also provides various mechanisms to control access to your data, such as AWS Identity and Access Management (IAM), Access Control Lists (ACLs), bucket policies, query string authentication, and pre-signed URLs.
AWS S3 provides various options for migrating data from different sources, such as on-premises systems, other cloud providers, or other S3-compatible services. You can either use online services such as AWS DataSync, AWS Direct Connect, AWS Transfer Family, etc. or physically move your data using offline services such as AWS Snowcone, AWS Snowball, and AWS Snowmobile.
Cloudflare R2 is still evolving and growing, it has a limited number of features that work well in certain environments. You can use it with Cloudflare Workers, a serverless runtime, to bind a bucket to a Worker and change objects on the fly as they go in or out of R2 storage buckets.
AWS S3, on the other hand, offers a solution for all your requirements and offers many features that are not available on Cloudflare R2.
AWS Marketplace for S3 allows you to explore and subscribe to third-party software products that are built for Amazon S3 from within the S3 Management Console. You can choose from various product types, such as SaaS, AMI, CFT, and containers.
There are solutions available for many categories, such as Storage, backup and Recovery, Data Integration and Analytics, Observability and Monitoring, Threat Detection, and Permissions. The marketplace helps streamline the process of deploying software solutions that run on AWS.
AWS S3 bucket versioning is a feature that allows you to keep multiple versions of an object in the same bucket. You can use bucket versioning to preserve and restore every version of an object stored in your bucket. This can help you recover objects from accidental deletion or overwriting.
By default, your bucket is unversioned, which means that there is only one version of each object in the bucket. If you enable versioning for a bucket, AWS S3 automatically generates a unique version ID for each object that is stored or modified in the bucket.
If you overwrite an object in a versioned bucket, AWS S3 adds a new version of the object in the bucket. The previous version remains in the bucket, you can still access and restore the previous version of the object if you need to.
Object locking in AWS S3 is a feature of versioned buckets that allows you to store objects using a write-once-read-many (WORM) model. This can help prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely. It is useful if you need to meet regulatory requirements that require WORM storage or add an extra layer of protection against object changes and deletion.
Object locking provides two retention modes: governance mode and compliance mode. These retention modes apply different levels of protection to your objects. In governance mode, users can’t overwrite or delete an object version or alter its lock settings unless they have special permissions. In compliance mode, a protected object version can’t be overwritten or deleted by any user, including the root user in your AWS account. When an object is locked in compliance mode, its retention mode can’t be changed, and its retention period can’t be shortened.
Performance and Reliability
Both Cloudflare and AWS are the titans of the cloud industry and boast 99.999999999% (eleven 9’s) of annual durability. This is very hard to interpret, let’s understand this with the help of an example. Imagine you have a big bucket of rice with one billion grains, if your bucket offered similar reliability then you will lose a maximum of one grain every year.
Both cloud services are globally distributed, have redundancy built into their infrastructure, and offer a similar level of performance and reliability.
Cloudflare takes pride in its simple pricing plans. It offers a generous free tier, beyond which customers are charged $0.015 per GB of storage, $4.50 for million operations that change the state of the object, and $0.36 per million object reads every month. Cloudflare R2 does not charge any network egress fee.
AWS, on the other hand, is infamous for its complex pricing structure. Even for experienced professionals, calculating your AWS bill is an arduous ordeal. You are charged separately for each storage class, you pay a fee for requests made against your buckets, and you pay for all bandwidth into and out of Amazon S3 (except in a few cases). There is an additional data retrieval fee for reading data from certain storage classes. Moreover, if you are using storage management features such as Amazon S3 Inventory, S3 Storage Class Analysis, etc. then you will be billed for them separately.
Let us assume you store 10000 GB of data in a cloud bucket that is frequently accessed from North Virginia. You perform 5000000 write operations and 25000000 read operations every month. The above scenario will cost you $265 ($230 for storage, $25 for PUT requests, and $10 for GET requests) every month when using AWS S3 Standard. A similar solution will cost $173.25 per month on Cloudflare.
If you are serving traffic to the internet, then AWS will also levy an outbound data transfer fee. If you transfer 10TB of data, you will be charged $921 per month. Cloudflare does not charge any network egress fee.
In this scenario, if you use AWS S3, you will end up paying $1,186.60 ($265+$921) every month whereas if you use Cloudflare R2, you will only need to pay $174 per month.
In this scenario, let’s assume you need to store 100000 GB of data that is seldom accessed. On AWS, there is a special storage class for such objects, S3 Glacier Deep Archive. If you perform 5000 write operations every month and a negligible amount of read requests and outbound data transfer, then your AWS bill will be approximately $100 whereas Cloudflare will charge you nearly $1500.
Cloudflare R2 is a new and upcoming service. It has not fully matured yet and still has some room for improvement. It has lower prices than AWS S3 and can be a good option for delivering data on the web. However, it does not have all the features and flexibility offered by S3.
In short: It’s a good option for some use cases – in fact, in some cases, even a great solution – but not to be considered a drop-in substitute for S3 and what it’s capable for (especially if you already use AWS for various other parts of your architecture.
If you’re tired of managing your own servers – you might want to check out RunCloud (yep, that’s us!). RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. Painless server configuration, so you don’t need to spend hours figuring it out – get started with RunCloud today & get up and running in minutes.