Message queue cost compared: SQS vs Pub/Sub vs Service Bus
SQS, Google Pub/Sub, and Azure Service Bus price messaging differently, SQS per request, Pub/Sub per TiB of throughput, Service Bus per operation or messaging unit. This compares the models and the surprises in each.
Quick answer
The three clouds price managed messaging differently: SQS bills per request (with batching to amortize), Pub/Sub bills per TiB of throughput (counting publish and subscribe), and Service Bus bills per operation on lower tiers or per messaging unit on Premium. All are inexpensive per message; the real cost is usually the compute the messages trigger, not the queue itself.
Every major cloud offers managed message queuing, and while the pricing models differ in form, they share a punchline: the queue is cheap, and the compute the messages drive usually costs more. Still, the model shapes how you optimize, and each has a characteristic surprise.
Three different models
| Service | Billing model | Characteristic cost |
|---|---|---|
| AWS SQS | Per request (batchable) | Request count; batching amortizes |
| GCP Pub/Sub | Per TiB of throughput | Publish + subscribe volume; fan-out multiplies |
| Azure Service Bus | Per operation (Std) or messaging unit (Premium) | Operation count or reserved capacity |
SQS charges per request, so batching messages (up to 10 per call) amortizes the cost, as in SQS, SNS, and EventBridge. Pub/Sub charges per TiB of throughput across publish and subscribe, so high fan-out to many subscriptions multiplies the subscribe volume, as in Pub/Sub cost. Service Bus charges per operation on Standard or per messaging unit on Premium, as in Service Bus cost.
The shared truth: compute costs more
Across all three, each delivered message usually triggers a handler, a function, a container, a database write, and that downstream compute typically costs far more than the messaging service. A queue delivering millions of messages drives millions of handler invocations, so optimizing the handler and batching work matters more than the per-message queue price.
The optimization levers
On SQS, batch sends and receives to cut request count. On Pub/Sub, avoid unnecessary fan-out and trim message size to reduce throughput. On Service Bus, batch on the operation-based tiers and use Premium only when its guarantees are needed. On all three, make handlers efficient and batch downstream work, since the compute is the larger cost.
Which is cheapest?
For a given workload the three are usually within a small margin on the messaging line, and the cheapest depends on message size, volume, and fan-out, not a headline rate. Choose the queue on the cloud where your producers and consumers live (to avoid cross-cloud egress and latency), and optimize the handlers, which is where the real cost sits regardless of provider.
FAQ
Is SQS, Pub/Sub, or Service Bus cheapest?
For a given workload they are usually within a small margin on the messaging line, and the cheapest depends on message size, volume, and fan-out, not a headline rate. Choose the queue on the cloud where your producers and consumers live, and optimize the handlers, which is where the real cost sits.
How do the message queue pricing models differ?
SQS bills per request (batchable up to 10 messages per call), Pub/Sub bills per TiB of throughput counting both publish and subscribe (so fan-out multiplies), and Service Bus bills per operation on Standard or per messaging unit on Premium. The models differ, but all are inexpensive per message.
What is the real cost of using a message queue?
Usually the compute the messages trigger, not the queue itself. Each delivered message typically invokes a handler, function, container, or database write, and that downstream compute costs far more than the messaging service. A queue delivering millions of messages drives millions of handler invocations.
How do I reduce message queue cost?
On SQS, batch sends and receives to cut request count; on Pub/Sub, avoid unnecessary fan-out and trim message size; on Service Bus, batch on operation-based tiers and use Premium only when needed. On all three, make handlers efficient and batch downstream work, since the compute is the larger cost.
Does fan-out increase Pub/Sub cost?
Yes. Pub/Sub counts both publish and subscribe toward throughput, so a message delivered to five subscriptions is billed for five deliveries. High fan-out to subscriptions that ignore most messages is wasteful. This subscribe-side multiplication is characteristic of Pub/Sub's per-throughput model.
Does C3X estimate message queue cost?
C3X prices the queue and messaging resources across clouds from your Terraform, along with the handlers (functions, containers) they invoke, which is where most of the cost is. Message volume and fan-out are usage inputs you model to complete the estimate.
What to do next
Compare messaging across clouds for your workload. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.