# Cloudflare Queues vs Google Cloud Pub/Sub

Canonical: https://inetgeek.com/compare/cloudflare-queues-vs-google-pubsub/

Every value below is read from Cloudflare Queues's and Google Cloud Pub/Sub's own documentation. See https://inetgeek.com/methodology/ for how.

## At a glance

| Criterion | Cloudflare Queues | Google Cloud Pub/Sub |
| --- | --- | --- |
| Free tier | Yes | Yes |
| Pricing model | Billed per operation, not per message: one operation per 64 KB written, read or deleted, and a message larger than 64 KB counts as several. Cloudflare states a normal delivery takes three operations — one write, one read, one delete — so a million messages is nearer three million operations. Workers Paid includes 1,000,000 operations a month, then $0.40 per million; the free plan allows 10,000 a day. | Three meters: throughput at $40 per TiB counting both publish and subscribe, storage at $0.27 per GiB-month for anything retained beyond a day, and data transfer when throughput crosses a zone or region boundary. Pub/Sub Lite is a separate product priced on reserved capacity rather than usage. |
| Included per month | 1,000,000 operations a month on Workers Paid, then $0.40 per million. An operation is each 64 KB written, read or deleted, so a typical message costs three — Cloudflare's own formula is ((messages × 3) − 1,000,000) / 1,000,000 × $0.40. Workers Free allows 10,000 operations a day. | 10 GiB of throughput free per billing account per calendar month, then $40 per TiB. Throughput counts bytes written to a topic plus bytes read from a subscription, so a message published once and read once is billed twice. BigQuery and Cloud Storage subscriptions are $50 per TiB and the 10 GiB does not apply to them; import topics run $50 or $80 per TiB by source. |
| Maximum message size | 128 KB per message, with roughly 100 bytes of that taken by internal metadata. Messages above 64 KB are billed as multiple operations. | Pub/Sub bills on bytes rather than message count; the pricing page states no per-message size ceiling and prices throughput and storage instead. |
| Message retention | 4 days by default on Workers Paid, configurable up to 14 days. Workers Free is fixed at 24 hours. | Retention is configurable and charged rather than granted: $0.27 per GiB-month for messages a topic is configured to retain, for snapshots, and for a subscription's backlog older than one day. A subscription's default retention is 7 days. |

## Where they differ

### Pricing model

- Cloudflare Queues: Billed per operation, not per message: one operation per 64 KB written, read or deleted, and a message larger than 64 KB counts as several. Cloudflare states a normal delivery takes three operations — one write, one read, one delete — so a million messages is nearer three million operations. Workers Paid includes 1,000,000 operations a month, then $0.40 per million; the free plan allows 10,000 a day. ([source](https://developers.cloudflare.com/queues/platform/pricing/))
- Google Cloud Pub/Sub: Three meters: throughput at $40 per TiB counting both publish and subscribe, storage at $0.27 per GiB-month for anything retained beyond a day, and data transfer when throughput crosses a zone or region boundary. Pub/Sub Lite is a separate product priced on reserved capacity rather than usage. ([source](https://cloud.google.com/pubsub/pricing))

### Included per month

- Cloudflare Queues: 1,000,000 operations a month on Workers Paid, then $0.40 per million. An operation is each 64 KB written, read or deleted, so a typical message costs three — Cloudflare's own formula is ((messages × 3) − 1,000,000) / 1,000,000 × $0.40. Workers Free allows 10,000 operations a day. ([source](https://developers.cloudflare.com/queues/platform/pricing/))
- Google Cloud Pub/Sub: 10 GiB of throughput free per billing account per calendar month, then $40 per TiB. Throughput counts bytes written to a topic plus bytes read from a subscription, so a message published once and read once is billed twice. BigQuery and Cloud Storage subscriptions are $50 per TiB and the 10 GiB does not apply to them; import topics run $50 or $80 per TiB by source. ([source](https://cloud.google.com/pubsub/pricing))

### Maximum message size

- Cloudflare Queues: 128 KB per message, with roughly 100 bytes of that taken by internal metadata. Messages above 64 KB are billed as multiple operations. ([source](https://developers.cloudflare.com/queues/platform/limits/))
- Google Cloud Pub/Sub: Pub/Sub bills on bytes rather than message count; the pricing page states no per-message size ceiling and prices throughput and storage instead. ([source](https://cloud.google.com/pubsub/pricing))

### Message retention

- Cloudflare Queues: 4 days by default on Workers Paid, configurable up to 14 days. Workers Free is fixed at 24 hours. ([source](https://developers.cloudflare.com/queues/platform/pricing/))
- Google Cloud Pub/Sub: Retention is configurable and charged rather than granted: $0.27 per GiB-month for messages a topic is configured to retain, for snapshots, and for a subscription's backlog older than one day. A subscription's default retention is 7 days. ([source](https://cloud.google.com/pubsub/pricing))

## Which should you choose?

Pick Cloudflare Queues if Workers applications that want a queue with no egress or throughput charges and a retention window measured in days rather than hours.

Pick Google Cloud Pub/Sub if Google Cloud systems that want messaging without capacity planning — throughput is metered rather than provisioned, and 10 GiB a month costs nothing.

Consider something else: Cloudflare Queues — Billing is per 64 KB operation rather than per message, so a large payload or a chatty retry loop costs several times what the message count suggests.

Consider something else: Google Cloud Pub/Sub — Throughput counts bytes both in and out, so a message read once is billed twice, and retention is a storage charge rather than an included window — the headline $40 per TiB is not the whole bill.

## Documented by only one

- Ingest price per GB: Google Cloud Pub/Sub: $40 per TiB, which is $0.039 per GiB, for standard publish and subscribe throughput in every Google Cloud region.
- Maximum delay: Cloudflare Queues: 24 hours, set with delaySeconds when sending or retrying.
- Concurrency: Cloudflare Queues: 250 concurrent consumer invocations, push-based only, with per-queue throughput capped at 5,000 messages a second and a 25 GB backlog.
- Dead letter queue: Cloudflare Queues: Supported

## Questions this comparison answers

**Should I choose Cloudflare Queues or Google Cloud Pub/Sub?**

Pick Cloudflare Queues if Workers applications that want a queue with no egress or throughput charges and a retention window measured in days rather than hours.
Pick Google Cloud Pub/Sub if Google Cloud systems that want messaging without capacity planning — throughput is metered rather than provisioned, and 10 GiB a month costs nothing.
